Brep.Split() returns split objects in which order?

What determines the order of the objects returned by Brep.Split()? I have to programmatically find the ones on a particular side of the splitter and have been unsuccessful so far.

This seems to depend on the tide of the sea, the phase of the moon and the distance of your computer to the nearest flock of sheep. In other words, quite random. I have even seen it give different order for the same splitter with slightly different input Brep. Frustrating, but you have to live with it :smile:

What I usually do is to determine the bounding box center and size (diagonal) of each part, and relate that to the location of the splitter. Then, based on these values make some heuristic that sorts the parts for me.

For example, if you splitter happens to be a plane, you can use the signed distance from the plane Plane.DistanceTo(Point3d) to decide if it is above or below the plane.

1 Like

Brep.Split() merges the faces of the splitter and the splittee, then traces through the faces of the result that came from the splittee, keeping together faces that are not separated by edges that came from both. The order of the results would then be determined mostly by the order in which the faces appear in the intermediate merged Brep. This is mostly determined by the order that the faces appear in the original inputs.

Thank you, for this topic,

it saves me lot of headache. Now I know, I am not able to solve some of my problems. Only one solution is to code a programe to watch all sheep flocks. :slight_smile: