On_NurbsSurface to ON_RevSurface

Hello ,

With RhinoSdk , do you know if there is a function to convert/simplify a ON_BrepFace with basis surface ON_NurbsSurface to a ON_BrepFace with ON_RevSurface ?

Thanks
Laurent

You’ll probably have to do something like: (disclaimer: I haven’t tested this)

  • add the ON_RevSurface to the ON_Brep.m_S surfaces array, use brep.AddSurface(ON_Surface *)
  • call face.ChangeSurface(<new-surface-array-index>, true) with the second argument true to indicate a rebuild of the edge curves, because the parameterisation of the old and new surfaces will most likely be different.
  • afterwards, use brep.Compact() to remove any unused surfaces.

https://developer.rhino3d.com/api/cpp/class_o_n___brep.html#a6bca40652af99b3785b19f45dfd571db

https://developer.rhino3d.com/api/cpp/class_o_n___brep_face.html#a5d1589acfe5b4a6d59d5e77ec2a81d06

hello menno ,

I succeed , I create the brep with nurbs surfaces , use RhinoRepairBrep to correct the different tolerance on edge and vertex , and then I replace all revolution by the ON_RevSurface , and use again RhinoRepairBrep for getting a better tolerance .

thanks
Laurent

1 Like