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: 92531

Replies to This Discussion

Hi Nik

nice bunny !

FYI: If I replace your .stl file with my own file : Gyroid10.obj your script does not work

Attachments:

Several issues:

(1) Tetgen won't work with if the mesh isn't fully triangulated.

(2) Your mesh, for its volume, is too fine, so it gives over 100K tetrahedrons that slow down Grasshopper.

(3) Tetgen requires ASCII format STL files, a Rhino export option.

(4) Compared to the bunny, your mesh was huge so I scaled it down 1/100th, so the same maximum tetrahedron size setting would blow up the output.

(5) I updated the Python to make Voronoi and Tetrahedron meshes output optional and added a file path input.

So I reduced your mesh after saving as an STL, using Autodesk Meshmixer, to half the number of triangles.

Before reducing the triangles I got a very fine tree that took a long time, with some segments so short it was hard to make a mesh pipe without artifacts:

After reducing:

Shortest walk won't yet work with the more open and direct path Voronoi diagram lines, since the target points are not the same surface mesh points and thus I can't specify each path endpoint yet.

The Tetgen internal Python -q quality setting dominates internal tetrahedron size unless you specify a very small maximum tetrahedron size input such as 0.01. With such an overly fine mesh, there were quite a few internal tetrahedra, since the angle quality settings won't let it expand to bigger ones very fast away from the surface.

Attachments:
Ah, I don't have to rush to extract the Voronoi cells somehow from Tetgen and calculate the intersection of unit vector boundary rays with the mesh and build faces somehow, all since Tetgen doesn't offer clipped Voronoi cells along the solid boundary, only open cells. I can just output the tetrahedral lattice points and use the native Grasshopper Voronoi component to recreate it. Getting nice even 3D mesh points that adapt to the existing l existing mesh is the only trick I need from Tetgen to enjoy even instead of silly random 3D points.

I had not installed Meshmixer yet,(I got an i7 with 32gb ram for Xmas ....and I'm still married :))

1. I was under the mistaken impression .obj was supposed to work with Tetgen

2. Unfortunately my Gyroid10.obj was produced with K3Dsurf, which is unable to create clean Triangles. Its better to use a vb script component in grasshopper: see attached pic.

3. I'm curious, how did you convert Gyroid10.obj to clean triangles?

again thanks for your input.

Attachments:

I answered my own question 3. It came back to me as soon as I installed Meshmixer :) it appears to be as good as MeshLab and or Blender

After Meshmixer was bought by Autodesk, they have turbocharged it with powerful internals.

To use just Rhino I would have done a mesh reduction (ReduceMesh) then triangulated (Triangulate Nonplanar Quads menu command = TriangulateNonPlanarQuads), but neither this nor MeshMachine are near as good as Kangaroo MeshMachine that attempts to make equilateral triangles while retaining curvature adaptive size variation:

Tetgen should indeed accept OBJ files, but if using STL it needs to be ASCII format.

Attachments:

Typo: second example is Meshmixer, not MeshMachine.

Full infographic is here:

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

OK, Meshmixer has a better option than Reduction, called Remeshing, which has a Regularity slider, while retaining an Adaptive Density menu option:


Hello Nic,

After that I have iterated experiments on Tetgen Parser F.gh on Page 2 and want to ask a question.

Although the shared original files are all working as same as the photos you are showing(Gyroid10_REDUCED.stl), the coral like tubes don't spread well in the mesh I set instead.  The tubes only head for a specific surface, which is the dome in my stl file, and don't spread to all over the volume.

I ticked all tips you noted such as triangulating mesh / adjusting mesh number and size/ exporting stl as ASCII file... etc and the mesh was controlled by MeshMachine Reduction A.gh, the Kangaroo MeshMachine definition you shared.

Could you give me any ideas?  Thank you in advance.

Attachments:

Hello Nic,

Thank you for sharing inspirational experiments.  Enjoying them very much.!

Actually I would like to ask one very basic question on this experiment.  After succeeding the compilation of Tetgen, I downloaded the attachments above, gh and stl.  You explained the python script is somehow connected to tetgen but I couldn't find out how to do it.  Could you kindly tell me how to do it please?

Thank you in advance.

What's the red error message when you hover the  mouse over the blurb or "out"? Run "out" into a Panel to see it easier too. Tetgen needs to be in your C directory in a directory named Tetgen, for starters.

You're also using a very early version of the script that only read meshes from disk whereas later I added a mesh input and had the script create its own temp disk file for Tetgen.

http://www.grasshopper3d.com/forum/topics/shortest-walk-tapered-bra...

Thank you for your kind response, Nik.

The error message from "out" says as follows;

{0;0}
0. Runtime error (Win32Exception): WindowsError
1. Traceback:
line 877, in _execute_child, "C:\Program Files\Rhinoceros 5 (64-bit)\Plug-ins\IronPython\Lib\subprocess.py"
line 13, in script
line 669, in __init__, "C:\Program Files\Rhinoceros 5 (64-bit)\Plug-ins\IronPython\Lib\subprocess.py"

I thought there was some problem with IronPython so re-installed the latest 2.7.5 version but the message has stayed same.  I also tried the later version script as you suggested but it showed exactly same error with this so maybe after solving this I would like to utilize it.

Would be great if I can have some advice.

Thank you very much.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service