_ToNURBS in Grasshopper Python

Hello everyone, I’m looking for a way to bring the _ToNURBS command from Rhino into Grasshopper through the GhPython Script Component. I would like to be able to connect a SubD geometry in through one side and get a surface out of the other.

My problem with the existing means of achieving this in grasshopper ( shown here: _ToNurbs component in GH? - #2 by Mahdiyar ) is that the outputted Brep is a Polysurface. Meanwhile, using the _ToNURBS command in Rhino outputs a singular, combined surface.

I’m a bit of a beginner in Python and as a result have been struggling to wrap my head around this. Any help would be much appreciated.

Thanks

Python

import Rhino.Geometry as rg
a = subD.ToBrep(rg.SubDToBrepOptions(packFaces, rg.SubDToBrepOptions.ExtraordinaryVertexProcessOption(vertexProcess)))

C#

private void RunScript(SubD subD, int vertexProcess, bool packFaces, ref object A)
{
  A = subD.ToBrep(new SubDToBrepOptions(packFaces, (SubDToBrepOptions.ExtraordinaryVertexProcessOption) vertexProcess));
}

ToNurbs.gh (44.7 KB)

3 Likes

It worked perfectly… Thanks so much! :pray: