Splitting a Brep by a curve (rhinocommon)

A have a brep that consists of an untrimmed surface and I want to split it by a curve. The split function can split a brep by another brep, but what about if I want to split a brep by a curve?
I’m suspecting I might be confused here… can a brep consist of just a curve? Figuring this might be the case, I tried TryConvertBrep on my curve and then used the resulting brep to try to split my original brep, but that didn’t seem to work for me. Any suggestions?


If your BRep consists of one untrimmed surface you can do this:

Brep b;
Curve splitCurve;
BrepFace bf = b.Faces[0]; // the first and only face of the BRep
Brep split = bf.Split(new[]{splitCurve}); // split by an array of curves
if (null != split)
foreach(BrepFace splitFace in split.Faces)
    Brep part = splitFace.DuplicateFace(); // duplicate the face into a BRep of its own

see http://4.rhino3d.com/5/rhinocommon/html/M_Rhino_Geometry_BrepFace_Split.htm

Refer to this page for more info on the various elements of a BRep http://wiki.mcneel.com/developer/brepstructure

And no, a curve cannot be a BRep (Boundary Representation).

Works great, Menno, And thanks for the links, most educational.