How to convert TopoDS_Shape to a BSpline surface (Geom_BSplineSurface)?

Can someone help? I need to be able to modify shapes using some sort of control points - such as those of BSplines.

The method I use:

OCGeom = BRep_Tool::Surface(F);
OCBSplineGeom = GeomConvert::SurfaceToBSplineSurface(OCGeom);

...doesn't work as infinite Geom_Surface objects are sometime generated, which cannot be converted by GeomConvert::SurfaceToBSplineSurface(). Is there a way around?

Thanks a lot.


Fabio Napodano's picture

surely you have already found a solution to this, anyway I write this for future reference:

I had the same problem, and solved like this:
BRepBuilderAPI_NurbsConvert nurbs(mf.Face());
Handle(Geom_Surface) geom_Extrusion = BRepLib_FindSurface(nurbs.Shape()).Surface();

Handle(Geom_BSplineSurface) geombspline_Extrusion = GeomConvert::SurfaceToBSplineSurface(geom_Extrusion);

Kreshnik's picture


I need to convert a TopoDS_Face to a BsplineSurface.
I tryed this code :

TopoDS_Face F =TopoDS::Face(ex.Current());
BRepBuilderAPI_NurbsConvert nurbs(F);
Handle(Geom_Surface) geom_Extrusion = BRepLib_FindSurface(nurbs).Surface();
Handle(Geom_BsplineSurface) geombspline_extrusion = GeomConvert::SurfaceToBSplineSurface(geom_extrusion) ;

I have this compilation error :
error C2065: 'Handle_Geom_BsplineSurface' : undeclared identifier

Can someone tell me why ?


sb go's picture

Handle(Geom_BSplineSurface) casesensitive??