Grasshopper

generative modeling for Rhino

inside voronoi cells selection

Hello

i would like to select "skin cells" from voronoi body.

I have made a definitione but unfortunately it dose not work perfect.

(it makes a smal mistakes...)

Please if you have any ideas for this problem please give me a hint.

Views: 962

Attachments:

Replies to This Discussion

b from voronoi is the boundary cells :)

thanks,  but that works for voronoi in box...

I have already selelcted group of cells from voronoi (which fit in some other envelope) and now i want to divide them in to this two groups. B form voronoi would be ok if i can get it from colection of cells.

best,

karol

"Skin" cells or "skin" surfaces ? (something like naked surfaces ?)

Mateusz,

I want to divide cells in two groups;

cells which have contact with exterior (at least one wall create skin surface)

cells which are inside no contact with exterior

(to get skin surface is relatively easy solid union make the trick- unfortunately indexes are lost in the process)

best,

k

boolean operations are so inelegant...

Attachments:

just in case - naked and clothed surfaces w/o boolean :

I know. boolean are not inteligent at all...

Thank you so much i am testing definition now. few tricks like mass addiditon wich didint know. thanks for a lesson man.

this is a great method for this, I am confused by it tho, can you explain in a bit, I am kind of lost after closest point. You are grouping in twos each points closest two points. Then adding the two distances, Then path mapper to put back into the original face list structure. Then adding those distances together? I'm lost there, if I am even correct at all. Thanks in advance.

1. create 3d voronoi cells
2. explode each cell to get faces
3. find center point of each face (polygon center, faster than finding a centroid)

Each point represents center of face. faces touching each other have same center point (thats one of marvelous properties of voronoi diagram).

So there are some points in given point cloud that share same location (pairs with 0 distance between). to find these pairs we need to get closest point in point cloud for each point. to make it easier lets use closest points component, and find 2 closest points for each one (one point itself and other - potencial pair).

Closest points gives us data tree with distances (cp output D), where each branch contains 2 values - 0 for point itself and 2nd distance for potencial pair. next add these two values - it should give some value greater than 0 (what means there is only one point at that location) or equal to 0 (if point shares location with other guy)(tolerance needed due to really small values  like 1.9e-15 which for us = 0).

Now we can tell that each point has some information about neighbours. Going back to faces - we can tell that face is 'naked' or 'clothed' - if its center point has pair in same location it means face is clothed, if its alone its naked.

Next we use path mapper to add all values from faces from each cell (path mapped ->mass add). Now if all faces are clothed, than adding all values should give 0, which means cell is clothed. If this value > 0 than cell is naked.

THE END :D

100 percent understand now, if the cell is fully enclosed then the sum of that entire cell is 0, really smart method. Thanks.

This method is really close to one used in "skeletal mesh" approach, where 'pairs' with 0 distance are used to identify neighbour cells.