Wed, 03/31/2021 - 23:26
Forums:
I am trying to figure out how to create a displayable shape (eg, AIS_Shape) from a Bezier surface but cannot seem to determine the right sequence. Here is my code snippet of the surface creation:
Handle(Geom_BezierCurve) bc3 = new Geom_BezierCurve(pntArray3,whtArray3);
Handle(GeomFill_BezierCurves) bcFill = new GeomFill_BezierCurves(bc1, bc2, bc3, GeomFill_CurvedStyle);
Handle(Geom_BezierSurface) bzSurf = bcFill->Surface();
This throws no errors. At this point I would have thought that some form of BRepBuilderAPI_MakeFace() would work to give me a face:
TopoDS_Face bzFace = BRepBuilderAPI_MakeFace(bzSurf);
TopoDS_Face bzFace = BRepBuilderAPI_MakeFace(bzSurf,1E-07);
But I get an error regarding no candidate constructor. Any pointer? Am I missing something obvious?
Thanks!
Thu, 04/01/2021 - 19:51
So I finally sorted out the problem or at least the solution. The errors were likely due to incorrect combinations of pointers and references. I'm still not completely clear on some of this as the errors can sometimes be pretty obscure and I am still a c/c++ novice. Regardless, this code works to give be a displayable face. If anyone has suggestions on how to make this better, please comment. Thanks.