Grasshopper

algorithmic modeling for Rhino

bone microstructure and voronoi diagram... need help

Hello,

I would like to generate the TRABECULAR area in bone (on the picture) using Voronoi diagram (or cell, whatever) in the Grasshopper software.

I have a solid part file generated from micro CT data. 

Can I have your comments on how to generate trabecular-like Voronoi structure ? 

Views: 25194

Replies to This Discussion

I thought of using an adaptive surface mesh first, and using the face normals to plunge lines down through the bunny, then trim them with the bunny brep, and then use the face areas to randomly cull lines much more so for large area triangles, leaving behind many more lines where curvature is tight and thus features are smaller. It kind of worked, but the bulk body still just fills with bulk rather than remains airy:

Attachments:

A better strategy to achieve more lines in the small ears would be to bounce a point inside the bunny brep, so it will bound around more in the small spaces, no?

No. It depends too much on the geometry and never angles right to fill fingers and knuckles:

Script reference: http://www.grasshopper3d.com/group/kangaroo/forum/topics/simple-fir...

Attachments:

I'm still thinking about this as well:

I'm I correct in assuming the Voronoi 3d is related to overall volume of the Bunny mesh. Since the volume of the Bunnies Ears is considerably less then Bunnies Body, that's perhaps why there there is such a discrepancy of lines in the ears as opposed to the body.

Alternative proposal:
1. Start with a 3d populate bounding box with lines between two points, This bounding box must encase the Target geometry. ie the Bunny.
2. Input the Bunny Mesh
3. Trim the 3d populated bounding box with lines. up to the boundary of the Bunny Mesh. What remains are the lines contained within the Bunny Mesh.
4. Now let the Cocoon script do its thing.

Does this approach make sense? But more importantly is it doable in GH?  (I have a Bounding Box)

the beauty of bounding boxes is that if you set the viewport to shaded so you cannot see inside the box then your solution is both correct and incorrect at the same time!

I present the (slow) fractal filled bunny, via XYZ slicing planes, custom flat surface meshed for lots of tiny lines where curvature is tight, cylinders made proportionally thicker for longer inner volume lines. With enough subdivision slices, the parts overlap enough to form a 3D truss, if only you have time to cap all the pipes, or convert it to use marching cubes (Cocoon) instead:

There are 28K tubes.

Attachments:

Yikes!.... I better have a fire extinguisher at the ready, next to my computer, before I try that Latest Bunny! :)

Geomagic Freeform was able to open it to combine it into a single voxel-based solid that could then be reduced to a single mesh, but the very fine struts were too small so there was still lots of bad mesh areas:

I'm now playing with much simpler 3D tetrahedral meshing via TetGen, a small precompiled Windows .exe file that I can tie into Grasshopper via simple Python scripting.

At the moment I still prefer using Sticks'n'Cocoon, I think it has some strong possibility for Jewellery design, such as pendents, etc.  If you intend to use Voxel's, it might be better to simply stay with a Cube. (see attachment)

Its a Voxel capture of a Fractal using Mandelbulb 3d

Indeed, as you can see, tetrahedral meshes are full of such sticks if only I can liberate them as single lines from old school software file formats, which Python is good at. I think I could feed the lines into Cocoon with radius or strength assigned according to length, or else just create my adaptive diameter tubes and add lines to those surfaces for Cocoon.

Equilibrating Kangaroo physics doesn't make it easy yet to pack spaces with varying sized units that generalize adaptive circle packing to spheres, nor likely do so quickly. But it will give, via MeshMachine, a curvature adaptive surface mesh which can control the surface of added inner tetrahedra meshing.

Now bunny is happier, based on using a curvature adaptive surface mesh via MeshMachine to entrain an inner tetrahedral mesh made by using a Python script to access the old school but regularly updated command line program Tetgen which thankfully has a compiled binary available, one of the standards for creating 3D meshes for finite element analysis:

Using just tubes whose diameter is relative to line length:


The relation to the adaptive surface mesh is exact, though an extra vertex may be added here and there to enable full tetrahedrons to be made inside:

Next, applying the same variable diameter influence based on line length, the new marching cube and metaballs Cocoon plugin, in 1.5 minutes, with mesh refinement included, gives a nice even single mesh surface to the rather fractal truss:

I'd like to do the dual (Voronoi instead of Delaunay) but the file format is trickier, giving inner lines just fine but outer ones are just output as unit vector directions with no ends.

I still haven't played with controlling the inner tetrahedron sizes, since they are a bit long so suddenly. It's just another flag you can add to the Python script paired with a number where it uses a string to call Tetgen at a given Windows file path ( http://wias-berlin.de/software/tetgen/1.5/doc/manual/manual005.html )

Though faster, this is not better than my use of Kangaroo to pack particles evenly within the volume, except that it has a surface curvature adaptive nature. There are still too many tetrahedrons around one inner vertex, so mass accumulates in blobs. If I made the inner tetrahedrons finer, it will all just clog up, I imagine, but so would the Kangaroo strategy I guess, only more predictably.

Ah, indeed, the dual would always only have four struts per inner node since it's all tetrahedrons. I've yet to parse the text file correctly yet, since Tetgen already has a flag to output the dual as well in separate files. The surface adaptive entrainment of inner division size is attractive enough compared to Kangaroo uniformity that it's worth more work to reveal.

Attachments:

It's called a "clipped Voronoi diagram" to take the endless vector rays that don't have two vertices and clip them with the original surface, and you can see it's not so congested on the left:

https://hal.inria.fr/hal-00647979/file/main.pdf

The whole interior structure is straightforward, just the last outer layer has these "rays" as Tetgen calls them. Not so easy to do in Python, or Grasshopper, since Rhinocommon seems to lack a split or trim with mesh command, if I make the rays as long lines first.

It's easy to make a random Delaunay mesh from filling a volume with silly random points, but an optimized and surface curvature adaptive one then converted to Voronoi? A bit more work!

The ideal perfectly uniform space filling solids related to these 3D meshes are Platonic solid tetrahedrons (with octahedrons between them):

What's the dual of this? What are the ideal polyhedra of a 3D Voronoi? Ah, the space-filling cuboctahedron:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service