Splitting Surface with Curve using brep.Faces.split not working

Hi, I am trying to Split a planar surfaces with another planar curve using the Rhinocommon API. As far as I know, the way to do this is to use the Brep.Faces[0].Split(curve) method. However, the surface is not splitting as intended. When doing the same thing with the SurfaceSplit component, it works perfectly fine with the geometry.



The code i used is as follows.

Brep[] bArray = Brep.CreatePlanarBreps(srf, 0.01);
Brep splitted = bArray[0].Faces[0].Split(crv, 0.001);
var splitCrvs = (splitted.Faces.Select(a => a.OuterLoop.To3dCurve()).ToList());
A = splitCrvs;

Could someone please explain why this happens?
P.S. I can’t just use the GH component as I’m trying to put this functionality into a custom Rhino plugin.
error2.gh (9.2 KB)

Hi yongsiang
Hope this help you

Brep[] bArray = Brep.CreatePlanarBreps(srf, 0.01);
Brep[] splitted = bArray[0].Split(crv, 0.01);
var splitCrvs = (splitted[0].Faces.Select(a => a.OuterLoop.To3dCurve()).ToList());
A = splitCrvs;
B = splitted;

Hi Naruto. Thanks for the reply, I tested it, and indeed it does solve this problem, but it brings about another issue upon further testing.


If I have a particular cutter that overlaps another cutter, the split fails.
Plus if I have a cutter that intersects the other cutters, the split occurs, but ignores the line which intersects other lines.

I managed to workaround my initial issue by reducing the size of the cutter object. however I would still be interested as to how to resolve this whole issue generally, like how splitsurface component does it.