Grasshopper

algorithmic modeling for Rhino

The Holy Grail of NURBS design is conversion of easily manipulated and often Grasshopper created meshes into smooth and efficient polysurfaces instead of huge yet still ridiculously sharp-faceted polysurfaces. Geomagic Freeform Pro will do this for tens of thousands of dollars.

I have achieved this goal in Grasshopper by creating both a very fine re-mesh using Kangaroo MeshMachine also a crude yet curvature adaptive re-meshing that I take the *dual* of to afford mostly hexagons/pentagons whose outlines I then project onto the fine mesh, and I also use some random points inside each face to create several tiny little surface normal circles upon the mesh. This lets me use a short Python script to create patch surfaces using parallel processing that is 4X as fast on my four core CPU.

I also included a little Python script to access a brep join command that accepts tolerance so you don't have to tweak the main Rhino tolerance setting to get it to work.

When I updated my Python for Rhino 6 WIP, my Python patch script now crashes in Rhino 5, which is why I'm using Rhino 6 WIP and Grasshopper 1 but it should open in Grasshopper 0.9.X in Rhino 5. I'm not sure if a normal Rhino 5 Python set up will crash too much for other users with this script.

Views: 17280

Replies to This Discussion

Would it be possible to unroll these double curved patches to some sort of approximation?

Not easily in Grasshopper, and the Rhino Smash command doesn't look incredibly promising either:

This should be linked in FAQ because someone is always asking how to turn their mesh into a NURBS surface.

I think you're missing the point of mesh to nurbs conversion, that is reduction in amount of polygons (be it mesh or trimmed surfaces). Producing surfaces in a similar amount doesn't give you any advantage... 

This is a standard mesh to nurbs conversion result: http://www.tsplines.com/j/subdtonurbs/MeshToNurbsBoatShell.png

You want to start with a proper mesh reparametrization:

http://www3.cs.stonybrook.edu/~gu/software/RiemannMapper/figures/ti...

Once you have your mesh reparametrized it's relatively easy to divide it into surfaces. That is the easiest approach but it doesn't take into account any features(creases etc)... 

This illustrates a nice mesh parametrization with features.

https://www.graphics.rwth-aachen.de/media/paper_images/qgp_340.png

EDIT: 

Got a brief look at the Geomagic thingy... seems like it's a subd modeler (like tsplines). Creating nurbs out of subd meshes is easy cause you can basically trace back the subdivision. With Giulios help I was able to make a rough version of that process here: http://www.grasshopper3d.com/forum/topics/skeletal-mesh?commentId=2...;

(the point is that subd meshes to nurbs are not as much challenging as mesh to nurbs).

Anything else done in Rhino automatically gives highly faceted surfaces as NURBS, useless for industrial design. This system is smooth and the only two subdivision modelers for Rhino are T-Splines and Clayoo, neither of which will convert such normal meshes to subdivision models.

What you're talking about is indeed my usual workflow of using ZRemesher in ZBrush to obtain a smart feature-aware quad mesh, then use T-Splines to convert that to a smooth instead of highly faceted NURBS model. That extra software triples the cost of Rhino for my potential clients and the various young Rhino users out there.

I can obtain the same efficient polysurface no matter what mesh input, crazy fine like a typical STL or 3D scan, or unrefined output from marching cubes Cocoon, or quite crude like I started with above.

Meshes, no matter how reparametrized, have straight line edges, whereas I'm making curved lines with patches that include detailed mesh surface matching that, being patches, create nice smooth features.

What I have achieved is an ingenious breakthrough for Rhino users. I wish it wasn't a bit tweaky, bit the parallel processing means it's not too slow to be tweakable indeed.

In fact, my using mostly hexagons is more efficient than a bunch of quads, though that said, I'm using trimmed surfaces, unlike a T-Splines result, so there's some extra complexity in the model. Rhino/Grasshopper won't even do hexa/penta meshes, let alone convert them to polysurfaces.

Geomagic Freeform is mostly a clay modeler that uses voxels, and it's subdivision modeler is rather limited, which isn't actually how it auto-surfaces, since the result is patches rather than smooth quad meshing, these extra features costing an extra ten or twenty thousand dollars.

Your last link, fixed:

http://www.grasshopper3d.com/forum/topics/skeletal-mesh?commentId=2...

Here is autosufacing output from Geomagic Freeform, before (manually set to 1700 faces) and after smoothing (then set to 800 faces) to remove original mesh facets, but oh boy, ZBrush ZRemesher then run through T-Splines smooth mode to give NURBS beats it by a mile:

The ZBrush/T-Splines workflow gave only 118 faces! Granted, it's smoother, but T-Splines has serious code in it to combine faces into bigger patches when converting to NURBS.

If I tell Geomagic Freeform to stick to 118 faces...it does work, actually, but you can tell how much direction smart ZBrush ZRemesher is due to its recent update:

If I use a much finer ZRemesher output for T-Splines, I still get only 162 faces, and retain a bit more detail:

These systems are relying on highly bent surfaces running along edges, whereas mine relies on smaller rather flat patches to adaptively capture such detail. That I rely on projecting points and curves onto a very fine version of the original mesh, means I cannot just increase my hexa/penta cell size, since the projection to the closest mesh point will be wrong in tight areas.

I could possibly combine three adjacent cells at a time and make a super-patch by using the same little circle guides but only the outline of all the cells in the group to cut the count to about a third, if I had a strategy to select them, with a few lone stragglers left ungrouped.

Python bug report about Rhino 5 crashes of my Python patch component after I installed Rhino 6 WIP, here:

http://www.grasshopper3d.com/forum/topics/python-crashing-in-rhino-...

I used Python to sort the mostly hexagonal patch outline curves and associated mesh surface little guide circles into interior curve removed clusters to make bigger patches at once. However the loss of simple hexagons meant I had to turn the patch UV spans up high, slowing it down and yet still leaving several failed patch trims. The higher span alone would ruin the larger patch advantage even if it didn't fail in giving a closed polysurface.

A more orderly system now uses offset curves projected onto a finely remeshed version of the original mesh instead of random points and little circles at them to feed the patch script.

Attachments:

 An entirely new strategy presented itself when I realized that any uniform triangular mesh such as MeshMachine produces can be directly converted to an all quad mesh without needing any of the face multiplying subdivisions that Weaverbird requires to create a quad mesh. Each edge becomes a diamond quad face.

I tweak it by then re-projecting the vertices onto a fine remeshed model to round out the flatness of the new vertices within the original mesh faces.

Though making little simple untrimmed NURBS surfaces out of these worked, there was much worse subtle little kinks between faces than my large patches showed, which was already a hassle.

This is a perfect mesh to now directly feed into T-Splines though, which can smooth out all kinks and convert to NURBS. It's not as efficient as ZBrush ZRemesher but it nicely leaves lots of little quads where there is high surface detail. It's still efficient enough to allow T-Splines soft selection editing too.

 File uploading from Dropbox via iPhone failed the first time. Script still requires Weaverbird and Soapbox since I lacked the time to redo it in Python. It will always rely on Kangaroo 1 MeshMachine.

Attachments:

Nik, you need you own blog page on this site; these explorations are advance and priceless.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service