how do i convert a shape into a surface?

Hi,
how do i convert the output of BRepOffsetAPI_ThruSections (a TopoDS_Shape) into Handle(Geom_Curve)?

i tried using
loftedSurface = BRep_Tool::Surface(TopoDS::Face(loftedShape));

(where loftedSurface is Handle(Geom_Curve) and loftedShape is the Shape generated from the sections).

but apparently this shape cannot be converted into a face... (and BRep_Tool::Surface only takes a face)
any suggestion?

Sharjith Naramparambath's picture

How can you use Geom_Curve for a surface?
Secondly, you have to explore the topology (TopDS_FACE)using TopExp and then get underlying surface of each face using BRep_Tool::Surface. It will return a Handle to Geom_Surface (Not Geom_Curve!). Then you can check for the type of surface (Geom_Spherical, Geom_Cylindrical etc.) by using the IsKind method. Hope this helps you

Regards
N. Sharjith

Jones's picture

Thanks, I meant Geom_Surface, not Geom_Curve... my code had the right type, i just wrote it wrong here...

anyway, your solution fits my needs, thank you very much!