Grasshopper

algorithmic modeling for Rhino

A minor update to the remeshing component (read about the earlier release here)

This adds the option to also scale the triangle size by distance from the boundaries:

download this new version here:

MeshMachine.gha

(replaces the previous version, no need to change any of the other files)

The 2 new inputs are BoundaryScale and BoundaryDistance

If BoundaryScale is set to 1 (the default) then it has no effect and everything else works as before.

If it is set to (for example) 0.2, then the mesh edges along the boundaries will have a target length of 0.2 multiplied by the Length input value.

The BoundaryDistance input controls the size of the transition zone from this reduced boundary edge length to the standard edge length. For example, in the image below, on the left the BoundaryDistance is 4.0, and on the right 10.0

and here's an example of a circle packing with boundary gradient (generated by using the CPMesh component from Kangaroo on the output of MeshMachine):

Views: 26187

Comment

You need to be a member of Grasshopper to add comments!

Join Grasshopper

Comment by Timothy Tai on March 4, 2017 at 4:22pm

Hi All,

Might there be an example of dynamic remshing based on an image (as a map)

For example, on a b/w image and the mesh density is based on the brightness?

Thanks a lot!

Comment by Daniel Piker on December 31, 2015 at 8:46am

@Benjamin - Nice! thanks for sharing

Comment by Benjamin on December 28, 2015 at 1:38pm

Hey Check out this project I worked on for school here

It was a quick semester project but the Meshmachine was defiantly a very helpful; intuitive and very fun. Kudos Daniel!

This was one of my first GH projects, any suggestions or pointers would be greatly appreciated.  

Comment by seghier khaled on August 30, 2015 at 4:24am

i see a command in kangaroo menu : sphere collide ; maybe it can do something :)

Comment by Nik Willmore on August 30, 2015 at 4:00am

seghier: I want 3D bubbles too! No, not yet. It may be very simple. The elusive obvious? Where is our Einstein? I need better drugs.

Comment by seghier khaled on August 30, 2015 at 3:55am

thanks Nik
the Algorithm very useful and i never heard about it ; i proposed this idea of using voronoi to create points than circles to a maxwell render developper to improve their scatter plugin and avoid intersection between scattered objects

can we use this algorithm with kangaroo to create realistic bubbles ? because in reality some every bubble pressed other bubbels or new small bubbles created between the biggest and that avoid pressing
and can we packed spheres inside 3d object ?

i will learn more how to use Hoopsnake

Comment by Nik Willmore on August 30, 2015 at 3:19am

seghier: one thing to note is that you don't really need Hoopsnake for Lloyd's algorithm, since you can just copy/paste several Lloyd cycles as say 5 or 10 steps in a row, to do almost the same thing as 100+ steps. So first understand what a Voronoi diagram is, then realize that merely recalculating the center of each Voronoi cell around each original point, to give a new point in some fundamental way "relaxes" the geometry to make it more even and yet since the new points are quite close to the old ones, a newly recalculated Voronoi diagram doesn't make a huge change, but just makes it all more even.

Advanced computer programming has gone into making Lloyd's optimization faster to create "centroidal Voronoi" which is why textbooks are so terribly complicated about such a simple thing!

Comment by seghier khaled on August 30, 2015 at 2:59am

thank you Nik
i tried the script and it work fine i will try with better foam texture 
i installed Lloyd's algorithm with hoopsnake and download and example but i don't understand it 

MeshMachine more simple ; you made a nice example 

Comment by Nik Willmore on August 30, 2015 at 2:57am

seghier:

Two problems remain:

(A) To combine both border constraint with grayscale ("texture") control. Adding bias towards borders is simple enough, based on closest distance to borders for each point. Initially you populate the interior with random points then they "circle pack" by which I mean they become equally spaced as well as can be.

(B) To convert Voronoi to real "circle packing," with actual circles.

There may be a better solution but this is one idea.

Comment by Nik Willmore on August 30, 2015 at 2:38am

seghier: ah, my last thread link uses Hoopsnake to create a continuous optimization loop for Lloyd's algorithm ("centroidal Voronoi") in which each new Voronoi diagram is replaced with a new one based on new points calculated from the centers of the existing Voronoi cells. I played with this in a different way, to simply use Voronoi instead of MeshMachine to create boundary adaptive meshes, here:

http://www.grasshopper3d.com/forum/topics/voronoi-diagram-and-bone-...

The Lloyd's algorithm cycles is what affords the even regular "circle packing" whereas I found that in each cycle I merely needed to add even a mild bias towards moving points towards whatever direction I wanted, to combine both relaxation/regularity with anisotropy/bias.

Lloyd's algorithm is relatively mild each cycle, so you can indeed bias it and thus dominate it.

Translate

Search Grasshopper

Photos

  • Add Photos
  • View All

© 2017   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service