Data conversion failed from Goo to Brep

I am trying to use RhinoCommon to offset my brep using the Brep.CreateOffsetBrep in python. I get an output of Rhino.Geometry.Brep but I cannot use it in my grasshopper document. I need to use RhinoCommon because there is no offsetBrep command in rhinoscriptsyntax (only offsetSrf which will not work). So how do I convert the Goo to Brep? (308.4 KB)

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
from Grasshopper.Kernel import *
import Grasshopper
surface = rs.coercebrep(x)
a = Rhino.Geometry.Brep.CreateOffsetBrep(surface,y,1,0,0)
b = []
for item in a:
    z = Grasshopper.Kernel.Types.GH_Brep()

the problem is that a is an empty brep meaning your createoffsetbrep failed.

1 Like