BrepFaceList.SplitKinkyFaces() not creating subfaces

Hi there,
I am trying to subdivide a brep that is to “smooth” for other software. My aim is to split the brep at the kinky faces.

I am trying this:

obj = rs.GetObject()
brep = rs.coercebrep(obj)

brep.Faces.SplitKinkyFaces()

for f in brep.Faces:
    sc.doc.Objects.AddBrep(f.ToBrep(), Rhino.DocObjects.ObjectAttributes(), None, False, True)

which only adds the isocurves in the brep.


Am I misunderstanding the method or what am I missing?

Thanks,
T.

Can you post the input geometry? This helps in pinpointing the problem.

@menno, here you go. :slight_smile:

TestSplitKinkyFaces.3dm (68.8 KB)

The crossed out lines would of course not have to be split, but I guess you have assumed this anyways.

The left surface has “Isocurve Density” set to -1 because the “Show surface isocurve” is switched off (see Properties panel). If you switch it on, the surfaces look exactly the same.

Neither surface has a kinky face. You can also test this using DivideAlongCreases SplitAtTangents=No SplitAtKinks=Yes without any Python code. If you were to have a surface with a crease, a.k.a. kink, it would split. A kink is a mathematical thing where knot values in the surface definition repeat, causing the control point to always lie directly on the surface.

Also, it looks like DivideAlongCreases only works if there is a true crease. If there is a fully-multiple knot but the control points are aligned such that there is higher than G0-continuity, it won’t split.

@menno
Gotcha.
Once I replace brep.Faces.SplitKinkyFaces() with brep.Faces.SplitFacesAtTangents() it works perfectly.

Thanks!

1 Like