Nurbs surfaces from brep faces

Hi. We’re developing a plugin using RhinoCommon. The plugin get surfaces from Rhino or imports them. The surfaces are represented as breps. We need to convert the breps to nurbs surfaces for export. Our understanding so far is that we need to convert each face in a brep to a nurbs surface. Faces are untrimmed, and some of the models we are working with will have overlapping geometry if we use untrimmed faces. Is there a way to convert trimmed faces to nurbs surfaces, or another way to convert “trimmed” breps to nurbs surfaces?

B&A Software AS

Surfaces are always represented as breps in a Rhino model. As far as I know there is no way around that. A trimmed or untrimmed surface is a brep with only one brepface.

You should explain better what that means.

What file format are you using for export? -Is it IGES?
Is the problem that some of your brep faces are in non-nurbs form (like a RevSurface) and you want to convert to a Nurbs form and retain the trimmed edges?
Assuming you want to convert from a non-nurbs form to a nurbs form:

What you may be able to do is use brep.CopyTrimCurves to get the trimmed surface you want after converting to Nurbs surface.

There is also brep.MakeValidForV2 which might be all you need.

There is no way of telling what exactly these brep methods do because the RhinoCommon documentation is horrible.

Hi @Stig_With,

In general, no. In some cases RefitTrim can help.

– Dale