Grasshopper

algorithmic modeling for Rhino

Maps: Best method to convert Mesh to Rhino single surface

I have a map surface in a complex mesh format generated by a physics-based depositional model that I would like to convert to a simple Rhino surface. After playing with various Rhino Functions and Grasshopper scripts others have suggested for converting Mesh to Breps I cannot seem to generate useful results (I can get nice Polysurfaces by various methods, but I need surfaces easier to hand edit and modify in grasshopper). For example I need to remove overlap of different superimposed surfaces, which is fairly easy with two simple Rhino surfaces built from the same number of points but not so easy with a complex mesh.  Despite two days of effort I cannot get simple surfaces from grids that are useful. I include a simple example of one of my grids here, showing a single river channel crossing a nearly flat floodplain. Other examples have more complex surface topography, but the grids are similar in that all points are a monotonic function in the vertical (Z) direction (that is, surfaces never fold over). I do not require high precision in the generated surfaces, but they need to remain reasonably similar in look to the mesh surface (i.e., no wild artifacts). Following my  efforts, and other reading in this site, I conclude that I need to buy an add on to Rhino for this type of operation ... which falls generally under the general label of reverse engineering programs.  Some choices seem to be Resurf3d (~$500), Rhinoterrain.com (~$1500), Evolutetools-for-rhino (cost?), T-Splines ($675...maybe?)... none cheap but I would pay the price if I knew it would allow me to proceed with development of the rest of my modelling workflow. Any suggestions for the best methods to get from surface meshes to simple Rhino surfaces? I guess I could just download trial versions of each, but I am on the steep end of the learning curve on Rhino and Grasshopper as is, so am hoping for some pointers in the right direction from those with experience before I jump in. Thanks for any suggestions.

Brian Willis

Views: 17261

Attachments:

Replies to This Discussion

Well...

If by a single surface you men NOT polysurface ... I have (almost) bad news.

Evolute ... er ... hmm no.

TSplines theoretically can do an "exact" translation of that ... but they have more bugs than Sahara has grains of sand. But going back to Rhino could yield a polysurface (rather totally unworkable as regards any further operation). Anyway get the 4.x Beta and give it a try.

RhinoResurf can do an approximation (more or less) of that (see a very fast "rough" test attached) but is a bit faulty, rather very slow (for good reason for a case like this) and requires a serious amount of resources (RAM and the likes). Not sure what is the "threshold" of a surface data set (c points et all) that Rhino can deal with. 

On the other hand using some code for this (separating the "landscape" from the "river") and then "stitching" the breps ... that could be interesting to try. But that could yield a polysurface as well ...

Attachments:

Plan B : Well ... since WB can give us that:

I can easily imagine "some" lines of C# that could cut the mustard quite effectively (or several GH components, but I don't use these anymore).

Thanks for the reply Peter...very helpful to hear your suggestions. Yes you’re correct that when I say “simple surface” I mean not a polysurface (and particularly not a collection of NURBS mesh faces). Your output from RhinoResurf looks promising .... I will investigate further. I make my mesh surfaces using external code (rather than constructing from a point cloud), so I have full control on separating the “parts” (e.g. in this case the river from the rest of the landscape). I have tried bringing in just a channel as a mesh, a channel centerline as a curve, contouring the channel mesh to get curves, and then generating a Rhino surface using loft or (with the centerline curve) sweep1 ...sometimes the result is a simple rhino surface but other times it is a polysurface. Sweep produces the best results, but requires that I hand select the contours before the sweep, which is laborious. When there are many geomorphic elements the number of potential parts increases and I am working with Grasshopper to automate the import of meshes to construction a Rhino polysurface in a way that allows more useful subsequent hand editing and manipulation (morphing) of the results. The devil is in the conversion of a mesh part to a reasonably simple NURBS object before reconstructing the whole as a polysurface. 

Well... the more I think of it the more I believe that an "in house" C# solution (attacking the task from many aspects: say creating sections AND using WB output like the one attached above for trimming and the likes) could be the answer. If you are familiar with that type of freak stuff start writing : if(this) { do_that;} else {go_vacations;}.

That way you can attempt having a single "component" without a myriad of cables etc etc (plus: any available "validity" check on hand etc etc). For the river I would try the sweep 2*2 (faulty in quite a few tests of mine, but when at Rome do whatever Romans do, he he).

On the other hand, I'm into the solid modeling bandwagon (I hate surfaces for AEC work especially terrains, he he. I hate meshes as well). Thus my approach could be: (a) create a SOLID terrain, (b) create a SOLID river "tool" (c) boolean this from that. 

Tip: see this: https://www.google.com/url?q=http://www.grasshopper3d.com/forum/top...

OK, just recalled that I had written some (faulty) C# thingy that "inquires" curves and ... er ... makes chaos (he he).

Using that thing and a nice cigar here's what you can do:

Step 1: get the chaotic curves made by WB and "sort" them:

Step 2: use sweep 2*2 and Brep by edges :

I hear you: but this is a very simple case ... what if this or that could happen?

he he

Attachments:

Update:

After a very embarrassing moment (resolved thanks to Hannes L) related with the CreatePatch method that does NOT accept type <Point3d> stuff (wants <Point> instead: don't ask what these mean, he he) here's what I can do for you:

1. This C# thing gets a mesh(yellow) and makes this (closed Brep == "solid"). By "this" ... think what you see or the "mold" of that if the splitter (the patched brep) is flipped:

or that (trimmed Brep == "surface"):

or that (for freaks):

So the solution may(?) be on sight: provided that we can separate the terrain from the river mesh > do a flipped river (acting as a "tool") and boolean this from that. 

Provide some real-life test - separated meshes (terrain/river) obviously (avoid meshes with 1M points if possible)

best, Peter

PS: by "flip" I mean these:

(case for the river "tool": the "mold")

(case for the terrain):

PS: for "taming" 1Z++ triangular meshes get that:

http://meshlab.sourceforge.net/

Stunningly fast, open sourced, developed (almost) by a single man: the best thing around (all things considered). Beats even the mighty Modo in certain application areas (reduce mesh etc etc).

Wow Peter...you're the man! I am still struggling to work through the components of your TerrainMeshtoNurbsPeter34D .... crawling in your wake as it were. I am still doing the dog paddle in the shallow end of the Grasshopper pond.

Yes I see where you’re heading; as I was also just starting to think of constructing some sort of “tool punch” method after your previous comment about working with solids. Can you share a copy of TerrainMeshtoNurbsPeter34E? I am very grateful for your direction.

Cheers,
Brian

Bad news: TerrainMeshtoNurbsPeter34D == prehistoric + naive + old > T-Rex stuff > avoid > forget > discard > erase > why bother?

Good news: TerrainMeshtoNurbsPeter34E_V2 == the real McCoy, only C#, plus a free bonus that makes topo curves, 123,45 bugs, 12,67 divisions by zero, 67 times slower == HEAVEN.

Of course I'll post here the thing (I'm working to reduce bugs to a reasonable amount: 123,44) - but keep in mind that is solely C# (no WB, no Kangaroo, no GH components of any kind). Start typing : if(RealMcCoy){heaven = true;} else{heaven = null;return;}

more soon, best Peter

Hmm ... flipped reality appears better than the normal reality. Should I make this "mode" the default?

Not sure about flipped.

As to: "TerrainMeshtoNurbsPeter34D == prehistoric + naive + old > T-Rex stuff > avoid > forget > discard > erase > why bother?" ... after having spent the morning digesting I can say the path does contain some interesting lessons/ideas for Neanderthals like myself. 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