Grasshopper

algorithmic modeling for Rhino

Hi all

Is there any function in SDK, or an algorithm to call a closest point on a mesh?

I have about 8000 face mesh, which, if i turn into surfaces (surface by points) and then, join them into a brep, it becomes absolutely unworkable.(crashes)

from the SDK is it possible to call somehting similar to the "pull" node? which "pulls a point to a variety of geometry"
it would be great!

Thanks!

enrique

Views: 8386

Replies to This Discussion

Yes there is. In OnUtil there's a method, ON_MeshGetClosestPoint, which will do what you're looking for. 8000 faces should be fine, but I wouldn't really use this is situations much beyond 20-30,000 faces. After that it may just be better to split up the mesh and use a more complex algorithm. Here's a quick snippet.

Dim meshPt As New OnMesh_Point()
OnUtil.ON_MeshGetClosestPoint(mesh, pt, meshPt)
A = meshPt.m_P
YEAH!thanks!
It's working...but I'd need some help over the SDK:
I'm building a hanged membrane, and I wanted to redraw a nice mesh following tension lines woven with their normals.

As a first approximation, I needed some streamlines over a mesh following the slope.
(after the topic of Gradient Descent, and following some of the steps or rotating vertex, that David suggested here)

The problem is that it's really slow, because I'm using a function to find the closest point (among 8000), when I could be doing it smartly.
the steps i'm using are:
mainly bring a seed (point list), the mesh, all the vertex from the mesh, and the normals of the mesh after the transformation into slope vectors.

1.pull the seed in the mesh
2.find the closest point of the seed, in the mesh
3.use his index to get a vector from the list
4.move the seed towards the vector x resolution
5.pull the new point to the mesh
6.collect the point and startover with the brand new point as the new seed

obviously this euler aproximation is not neat.
I'd need to use proper mesh functions:
>step 2, instead of using a brute force closest point function, I wonder if I could ask the index of the face where the point is. then I could simply find the closest point among the vertices of that face. (asking 4, instead of 8000)
>then step 3, I could ask directly the normal at that vertex. and then doing the crossproduct and rotation...

I 'm trying to use OnMeshTopology members but I'm not able to construct it.

Any help on using OnMesh related function, or similars to solve point 2 and 3 will be extremely appreciated.

Thanks!

enrique
Hi Enrique,

in OpenNurbs we use MeshTrees to very quickly find a closest point on mesh. You might be able to improve on this because you know that the next closest point is either on the same face as the previous solution, or maybe one of the neighbour faces. However, you will have to write large amounts of code to do this.

If you want to try to use the MeshTopology, you'll have to call the function OnMesh.Topology() to get access to it. You cannot construct an OnMeshTopology class yourself.

I'm not entirely certain what it is you're trying to optimise. Are you trying to generate a lot of descent paths over the mesh? Are you using those curves for further steps or are they the end-result?

I ran into some of these issues a few weeks ago when I wrote a similar function, but I used the new RhinoCommon SDK (available in Rhino 5), not the old RMA.OpenNurbs and RMA.Rhino SDK.

If you have access to Rhino5, I can try and port my function to a ScriptComponent and see if I can get it to work.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Hi David

I appreciate your answer. For the moment I have no access to Rhino5.

My aim is to produce a hanging structure net, containing water.
For the form-finding, it's somehow solved.

But actually my interest is the stress driven topology design of the net. That could be extremely complex, and far away from my scripting abilities.

so as a first target I want to draw as best as possible, the principal stresses lines.
two strategies:

1 discrete _stress vector field:
either prinicipal curvature or maximum stress direction(from FEA analysis) could be useful to produce streamlines

2 continuous _mathematical aproach: (at it's best would be Daniel Piker exemple with complex numbers) this would be neater, but, hydrostatic stressed membranes, are not minimal surfaces, so I have no idea of how to produce straight evenly spaced lines, following the topology of the surface.

(heinz Isler reinforced drawing, good old days)
In a further step, this topological analysis should end in a remeshing function, passing throught intersection of those lines, and creating polygons( but this can come later.. or in a workshop.. or in holidays)

Hi Enrique!

What's the FEM software you are using for this? Abaqus?
It looks like ANSYS Workbench...isn't it?

We could take a cofee and talk about it next Saturday (look at PIG's wiki)

Best.
yes.
what's PIG's wiki? http://pig.etsas.org/?
seville? quite far from barcelona but I'd love it..
yes Ansys, sorry for the late reply
Saturday date was an invitation to JLX, but you are welcome too :) That could be a really nice meetting :) JLX is researching about GH and structures too.

But indeed, BCN is quite far from here :(

PIG is (Proyecto de Investigación Geométrica | Geometry Research Project ), a little research group. We are 10, 3 teachers and 5 students plus 2 architects. It's an open group to talk about generative geometry, GH, architecture, etc.

I've created wiki to share definitions, links, resources, etc. Everything beguns 2 weeks ago with the end of GH + RH Training in ETSAS (Escuela Técnica Superior de Arquitectura). I was the trainner.

Best.
Hello Enrique,
I'm working on something similar for my university thesis and i was wondering were those images are coming from. I was searching for bibliography on cases where such techniques have been used i.e aligning rebar with principal stress trajectories, but didnt find anything apart from nervi's ribbed slabs.

Thanks

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service