I would like to convert a SubD object to a NURBS Brep in Rhino using RhinoCommon, but I want to avoid using [rs.Command(“_ToNURBS”)] or any command-line calls.
Is there a direct method or class in RhinoCommon (such as a method on the SubD or Brep class) that allows me to convert a SubD object to a NURBS Brep purely through the API?
If possible, could you provide a code example for this conversion?
var subDToBrepOptions = new SubDToBrepOptions(true, SubDToBrepOptions.ExtraordinaryVertexProcessOption.LocalG1);
var brep = subD.ToBrep(subDToBrepOptions);
Rhino.RhinoDoc.ActiveDoc.Objects.AddBrep(brep);
In the video, you have to select a SubD by clicking on it, but what I meant was—if I already know the GUID, can I directly specify it in the code without having to click on it and convert it directly?
It converts my SubD to BREP not NURBS(of course NURBS is a kind of BREP) but, what i want is right side one but it gives me the left one. Is there any other method?