Brep.CreateFromRevSurface returns a Surface

Why does the Brep.CreateFromRevSurface method returns a Surface object from python component?

import rhinoscriptsyntax as rs
import Rhino.Geometry as rg
import math

HT = 8
ext_param = cir.ExtremeParameters(rg.Vector3d(0,0,1)) 
ext_pt = [cir.PointAt(i) for i in ext_param]
pt1 = ext_pt[0]
pt0 = rg.Point3d(0,0,pt1.Z)
pt2 = ext_pt[1]
pt3 = rg.Point3d(pt2.X, pt2.Y, pt1.Z-HT)
pt4 = rg.Point3d(0, 0, pt3.Z)
points = [pt0, pt1, pt2, pt3, pt4]
plc = rg.PolylineCurve(points)

axis = rg.Line(0,0,0, 0,0,1)
stk = rg.RevSurface.Create(plc, axis, 0.0, math.pi*2)
print stk.HasBrepForm
#stock = rg.Brep.TryConvertBrep(stk)
#mbrep = rg.Brep.CreateFromSurface(stk)
mbrep = rg.Brep.CreateFromRevSurface(stk,True,True)
print mbrep

Screenshot 2024-03-28 at 3.41.18 PM
RevSrf.gh (6.5 KB)

Eventually I’d like to get a brep (polysurface) to be able to complete solid different operation from that brep

Because the output of RevSurface is… a surface.

You can use srf.ToBrep() to make a brep from it.

But I am using rg.Brep.CreateFromRevSurface, nevertheless get a surface from python component output, however in Scrip editor print shows it has brep type . As well as srf.ToBrep() method returns a surface instead of brep

That may be a GH specific problem then. What is it preventing you from doing downstream? Can you for example plug the output surface into a Cap component and get a closed brep?

1 Like

Hi @sadovshikov,

If the Brep has a single face and that face is geometrically the same as the underlying surface. I.e., the face has trivial trimming, then GH reports the Brep as an untrimmed surface.

– Dale

1 Like

There is no problem with the workaround, which you’ve described. I just thought there might be a bug. But Dale clarified the reason for me. Thank you for your time!

Got it, thanks for the help!