Grasshopper

algorithmic modeling for Rhino

Remove Short lines from Voronoi but preserve voronoi cells

Anyone got any ideas for a strategy to do this...?

I want to remove any lines in a voronoi that are shorter than a length I select with a slider but I want to rebuild the voronoi cells.

I've tried with Kangaroo which can magnetic snap points together but the output is a flattened list of points so I can't redraw the polyline voronoi cell boundaries.

Anyone got any ideas?

Views: 2010

Replies to This Discussion

martyn,

It's your lucky day.  I extracted this portion from a larger definition I put together but the logic is sound if you can follow it.  Lots of set work to track paths for a find-n-replace operation of short edge verticies with an averaged edge mid-point. You can incrementally see short edges collapsing as you scrub the slider and polylines are maintained.

BEFORE (5 x 8 bounding area):

AFTER (0.4 edge merge tolerance)

Cheers,

taz

Attachments:

Thanks Taz!

After attempting to do this with VBScript and posting in the code section of the forum, 2 other ways of doing this with GH components emerged...

funny how everything can always be done in many different ways!

Attachments:

Cool! Thanks for the cross-reference. I'll have a look at the code too.

OK, yeah it looks like I too overcomplicated a bit, so why stop now? To close my own loop, the addition to the definition is another find-and-replace operation that will snap merged edges to the boundary.

Still trying to figure out how Daniel's 4 component solution works so nicely...

Attachments:

tas. very nice work. helped me a lot. thanx

i am refering to the attached above.   vor2D_edgeCollapse.gh 

if it is not too much, could you please explain the "mind set" of the def you made.

i am trying to understand (and learn) "how and why"s.  

A

 Also search the forum for Lloyd's algorithm and also centroidal.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service