Intersect Box and Voronoi-Cells

hello,
i was hoping to be able to extract the faces of all voronoi3d-cells in a cube
which are coplanar with the sides of the cube (the outer faces of the voronoi cells).

by intersecting the box as brep with the group of vornoi3d-cells.

unfortunately

the intersection works,
but edges are created only once, so i do not get a list of all closed polylines:

it also does not help to use DISCONTINUITY, since sometimes 2 edges are missing:

image

how else could i extract the OUTER faces of alle voroni3d-cells?

thanx
stan

Plan A: For each Brep in the VorCell Collection the BrepFace with a Normal parallel to some Box BrepFace (general case: Box oriented in any plane) is an “outer” Face (each Face has an Outer Loop Curve >> your Polyline).This is not 100% safe mind … better use Plan B.

Plan B: For each Brep in the VorCell Collection the BrepFace with a center that has 0 distance (or less than the doc tolerance) to any Box BrepFace is an “outer” Face … blah, blah.

PS: A 3 dim Tree would be handy for all that (first dim the index of the Cell, second the index of the Face, third the index of the Box Face).

hello Pfotiad0,
thanx for the ideas - i understand the approach b very well in my head, in gh however i did not manage it so far, but i keep on trying :_)

thanx
stan

Elementary with C#: just 3 nested loops, 5 minutes max (if you type fast):

Voronoi_OuterCellCurves_V1.gh (118.3 KB)

Output Tree Paths dims (3) are as exposed above.

With some minutes more … one can get connectivity (a must) , grouping on a per Box Face basis (the best way to do that is to define a custom Type Class) … blah, blah.

1 Like