For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

terminate called after throwing an instance of 'StdFail_NotDone'

Game Milky's picture

Dear Supervisors!

I face a problem while performing the following task. The program compile without error, and finally give me an output:
terminate called after throwing an instance of 'StdFail_NotDone'

i want to have the intersection of surface and plane! I used BRepAlgoAPI_Section. obviously the intersection is something like a curve or edge/wire. I need to mirrow this wire and finally should make a face. The face from (mirroredwire and wire). Then to calculate the area, and other properties.

I succeeded sectioning, and mirror! and couldn't make the two wires together! So that to construct face and shape to calculate properties.

In addition: BRepGProp::SurfaceProperties(myFaceProfile,l_gprop); // myFaceProfile should be TOPO_DOS-SHape how to make shape from face!

I tried as follow!

The code part
Standard_Boolean PerformNow=Standard_False;
BRepAlgo_Section l_brepinter(shape, aSurface, PerformNow=Standard_True); // shape is imported and the aSurface (geomtric surface)
TopoDS_Shape l_tdCommon = l_brepinter.Shape(); // l_tdCommon the intersection between shape and aSurface

// TopoDS_Wire WaterLineWire = TopoDS::Wire(l_brepinter.Shape());

// Now to create the face to calculate the waterline area
TopExp_Explorer aExpEdge;
TopoDS_Edge WaterLineEdge = TopoDS::Edge(aExpEdge.Current());
TopLoc_Location aLocation;
TopoDS_Wire WaterLineWire = BRepBuilderAPI_MakeWire(WaterLineEdge);
TopoDS_Face WaterLineFace = BRepBuilderAPI_MakeFace(WaterLineWire, false);
Handle(Geom_Surface) WaterLineSurface = BRep_Tool::Surface(WaterLineFace);

//Reflect or mirror the wire

gp_Pnt aOrigin(xmin , ymin , z);
gp_Dir xDir(xmax , ymin , z);
gp_Ax1 xAxis(aOrigin , xDir);

//gp_Ax1 xAxis = gp::OX();
gp_Trsf aTrsf;

BRepBuilderAPI_Transform aBRepTrsf(WaterLineWire , aTrsf);

TopoDS_Shape aMirroredShape = aBRepTrsf.Shape();

TopoDS_Wire aMirroredWire = TopoDS::Wire(aBRepTrsf.Shape());

BRepBuilderAPI_MakeWire mkWire;


TopoDS_Wire myWireProfile = mkWire.Wire();

TopoDS_Face myFaceProfile = BRepBuilderAPI_MakeFace(myWireProfile);

//Global properties of the geometric components
GProp_GProps l_gprop;
Standard_Real l_rArea = l_gprop.Mass();
Standard_Real l_rPeri = l_gprop.Mass();
Standard_Real l_rDia = 4*l_rArea/l_rPeri;
// qDebug ()

Thank so much for help, any information will be appreciated