A problem when build a face,help !

TopoDS_Shape TpShape = vectoredges[0];//a bspline in vector
TopoDS_Edge aedge = TopoDS::Edge(TpShape);
TopoDS_Wire awire = BRepBuilderAPI_MakeWire(aedge);
TopoDS_Face aface = BRepBuilderAPI_MakeFace(awire);
Handle(AIS_Shape) AISFace = new AIS_Shape(aface);
myAISContext->Display(AISFace)G
//in debug it shows bulid wire ok,but when build face it fails,who can explain it? Thanks a lot!

Stephen Leary's picture

I have found MakeFace to be very random about whether it works or not. Frequently giving access violations rather than giving a meaningful error.

Stephen

David Egan's picture

I see you don't have a base surface for the face , especially if the wire does not lie in a plane , you could try constructing the underlying surface for the face first and then build the face from the surface and the bounding wire.

Divya's picture

HI,
I am new to opencascade and wanna know how does one represent vertex,edges,faces and loops in opencascade or atleast where to find them?

Thanks
Divya

Dheevatsa's picture

Hey Divya,

Try to look at the documentation under modeling data section, that would give you a better idea. You have Geom, TopoDS and the gp packages for this.

cheers

Evgeny Lodyzhehsky's picture

Dear cseason.

Could you clarify what the edge "aedge" is?
The edge "aedge" should be based on some planar and closed curve.
From your code it is not evident.
Check whether it is so, before any attempt to build a face using
BRepBuilderAPI_MakeFace(awire); .