Grasshopper

algorithmic modeling for Rhino

This is the script of Daniel Abalde's Peacock tapered offset post, here:

http://www.grasshopper3d.com/photo/the-variable-offset-component-sp...

Views: 93806

Replies to This Discussion

Good catch. There may be a standard way to reset Tetgen from my script.

Tetgen affords non-random 3D point distribution compared to the usual random point Voronoi alien architecture fad so common in architecture and design just by being easy. Even just a few Lloyd's algorithm cycles can relax/equilibrate such a random 3D distribution but won't retain surface mesh variation so fine features are lost or broad features require too many points as part of the overall fine mix.

Yes, Tetgen affords more regular plant-like organic structure instead of gooey slime fungus organic form.

I'm working on getting the solid Voronoi cells out, clipping the boundary ones with the mesh, with help from Rhinocommon. Lots of bookkeeping involved between four Tetgen Voronoi output files. Grasshopper was too slow and also unreliable in recreating Voronoi from the mere Voronoi points.

My latest script above anyway, doesn't do this, with several tetgen instances lingering. Tetgen shuts down and goes away. Maybe when it locks up it sticks around and you're playing with vast meshes?

I had some spare time on the weekend to investigate Tetgen further.

1. I seen to have lost the accompanying Tetgen files that came with the package, which probably contributed to Tetgen.exe not terminating on Rhino exit, My bad!

2. I used Meshmixer: but used Reduce instead OF Remesh, hence I got a vertices & triangle count more in line with the Bunny figures.

3. I scaled the Bunny in Rhino to be ~ 9 mm across, and did the same for Gyroid.stl

4. See attached for what Rhino finished with. It appears that Tetgen had not generated its tentacles to the border of the geometry. I don't quite know why? p.s. I turn ON point comp. to run my script

Attachments:

Although the idea of using Tetgen to define the entire geometry might be a good thing. Nevertheless geometry with holes can produce a geometry which inhibits the growing path.... which can also be a good thing :)

The point component wasn't internalized so I added a new internal point.

Ha, you're confusing yourself, you can almost see it in your top right image: that's the bunny mesh still you are using as your shortest walk target points, that indeed happens to just fit mostly into the obloid mesh you have open in Rhino and have assigned as the Tetgen 3D tetrahedral mesh input.

What's interesting is that it moves along the gyroid tetrahedral mesh lines to fill in the bunny, so it also loops around inside the gyroid to arc over to another part of the bunny:

I need to add Python code to output the Tetgen STL file from a single input mesh, since it sucks to have to not just input it from Grasshopper but have to remember to do two mesh inputs, one an STL file and the other a Grasshopper mesh component.

Interesting!.... But I'm not confused this time. Run my posted script again. Nothing happens till you Enable the Point comp. After it runs you will see the Tetgen tentacles follow the Gyroid structure not the Bunny.

I'm more concerned what your original internalized Mesh comp. contained?

Did you internalize the Bunny geometry? I internalized a circumscribed cube.

They are following the gyroid to try to end up at the bunny vertices, but can't since there's no lines to do that except where the bunny overlaps the gyroid, so interesting paths are taken.

I see the same ears at night... very haunting :)

So lets move on! Attached is a Neovius which fulfills the Tetgen requirement, with some added notes. Warning don't run the script without enough ram!

Attachments:

Hello,

sorry to interrupt you guys, but I have a question, and the answer could possibly be the ideal technique for my current university project.

The target is a freeform skeletal mesh witch gets denser towards the center.

I have A freeform shaped closed Brep, with I have intersected with a Voronoi3D (which gets denser towards the center of the Brep) to Have the Voronoi inside the shape. Then I tried to thicken the edges with a Bunch of Plugins, but none did quite what I wanted. 

I tried Exoskeleton , which gives really nice Cells but screws up because of too small segments (classic voronoi Issue).

I tried Cocoon, which works, but gives too straight pipes

Now I planned to use tetgen to create a 3D Delaunay Mesh of the Brep (to avoid the short Voronoi Segments). But I failed to compile it because I can use Grasshopper but have no idea when it comes to real programming. Then I stumbled over this discussion.

Do I need to prepare the mesh I feed into your tetgen component with meshmachine or something? because when i Mesh a brep with rhino, the result is always a really crappy mesh.

Sorry for all my dumb questions. If it is inappropriate here, feel free to ignor my post.

I can attach a def if anyone may bother to help me out, thanks in advance!

Nico

Yeah, either MeshMachine or Autocad Meshmixer can make much better, more uniform triangle meshes.

I covered that here:

http://www.grasshopper3d.com/photo/remeshing-techniques

Cocoon does give you some control over pipe thickness, despite only accepting one radius, you can input a series of numbers into the Cocoon Curve strength input by right clicking a number component and using Manage Number Collection. Something like 30, 10, 30 or 30, 10, 10, 30 would give less "straight" pipes, and have them be skinnier in the middle. Hmm...I've never tried that for a bunch of separate lines meeting at hubs.

I'm working on switching from the native Tetgen Voronoi output to use the Grasshopper Voronoi3D component via node-in-code from Python, since Tetgen actually has some errors, not with the lines themselves but with their ends not always meeting perfectly so they fail to form cell faces in some percent of cells. It seems to be a real Tetgen bug, but no updates have appeared since 2011. The tetrahedrons and their points seem fine.

Cocoon indeed works for more organic beams, though it's a bit blobby at the hubs including some abrupt jumps in diameter, but actually, post-smoothing with MeshMachine should be able to smooth those out and even out everything as desired if you set the Pull input small or to fast-acting zero and just limit the Iter internal iterations.

You can also vary the overall radius by how long the lines are, to afford smaller struts near the surface where the mesh is tight due to high surface curvature.

Also, you can use multiple lines around each core line, or build your own variable diameter pipe round each tube, and have the ends just meet together haphazardly and use Cocoon on the surfaces and still get an overall single outer mesh, so really, Cocoon gives you full control over form since it just links everything together into a single surface solid with holes and ends up smoothing transitions too so they just merge nicely.

I showed this with various MeshMachine remeshed/relaxed combinations of separate input solids. Here I merely did a Boolean union then MeshMachine with Pull set to zero afforded nice smooth transitions. Cocoon is crucial because it's 100% robust whereas Boolean unions so often fail due to kissing surfaces that are very hard to locate when it fails.

Using Variable Pipe on a tetrahedral mesh portion:

Surfaced with Cocoon using the Brep field component (just delete any inner surfaces to only keep the main shell):

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service