Converting a Geom_BSplineSurface into a TopoDS_Shape object

Hi all,

By the way thanks "Angel" for the helpful tip the last time.

The problem, I'm currently on is to display a Geom_BSplineSurface as an interactive object. As the AIS_InteractiveContext->Display() only takes AIS_Shape objects, and the constructor for AIS_Shape objects needs a TopoDS object, it would mean that there must be a way to prepare the Geom_BSplineSurface as a TopoDS_Shape. Any suggestions on working around this please, or if my reasoning is incorrect.

As always thanks very much,
Suds

angel's picture

Hi,
Handle(Geom_Curve)S;
TopoDS_Shape aEdge=BRepBuilderAPI_MakeEdge(S);

Handle (AIS_Shape) AisShape=new AIS_Shape(aEdge);
myCurrentIC->Display(AisShape);

Gool Luck
Angel

angel's picture

Sorry,I misunderstand your question.

// a is Geom_BSplineSurface
Handle(Geom_Surface)aSurf=a;
TopoDS_Face aFace=BRepBuilderAPI_MakeFace(aSurf);

// myCurrentIC is AIS_InteractiveContext
Handle (AIS_Shape) AisShape=new AIS_Shape(aFace);
myCurrentIC->Display(AisShape);

977456_149023's picture

Hello,
Apologies.. i know this is a very old post... But i am facing an issue similar to this.. I am trying to convert Geom_bSplineSurface to a TopoDS_Shape or face after some local modification in the nurbs and add it back to a compound before i can export it to a step file. However i seem to be struggling to convert it to an OCC shape..( Its easier and straight forward if i were to export it in IGES format but i will need to export in stp file)

I tried the code in the last post, but it doesnot seem to work when creating the face.. It could be an OCC version upgrade.. Do you or anyone else have any information how to perform this operation?

Thank you.. :)

Ken