{
try
{
+ OCC_CATCH_SIGNALS
// get a wire theShape
TopExp_Explorer aWireExp( theShape, TopAbs_WIRE );
if ( !aWireExp.More() ) {
if (SS.IsNull()) {
break;
}
- if (SS == mySurface) {
+ if ((SS == mySurface) && (L.IsEqual(myLocation))) {
break;
}
SS.Nullify();
// mkplane
//=======================================================================
-static Standard_Integer mkplane(Draw_Interpretor& , Standard_Integer n, const char** a)
+static Standard_Integer mkplane(Draw_Interpretor& theDI, Standard_Integer n, const char** a)
{
if (n < 3) return 1;
OnlyPlane = !strcmp(a[3],"1");
}
- TopoDS_Face F = BRepBuilderAPI_MakeFace(TopoDS::Wire(S), OnlyPlane);
+ BRepBuilderAPI_MakeFace aMF(TopoDS::Wire(S), OnlyPlane);
+
+ switch(aMF.Error())
+ {
+ case BRepBuilderAPI_FaceDone:
+ DBRep::Set(a[1],aMF.Face());
+ break;
+ case BRepLib_NoFace:
+ theDI << "Error. mkplane has been finished with \"No Face\" status.\n";
+ break;
+ case BRepLib_NotPlanar:
+ theDI << "Error. mkplane has been finished with \"Not Planar\" status.\n";
+ break;
+ case BRepLib_CurveProjectionFailed:
+ theDI << "Error. mkplane has been finished with \"Fail in projection curve\" status.\n";
+ break;
+ case BRepLib_ParametersOutOfRange:
+ theDI << "Error. mkplane has been finished with \"Parameters are out of range\" status.\n";
+ break;
+ default:
+ theDI << "Error. Undefined status. Please check the code.\n";
+ break;
+ }
- DBRep::Set(a[1],F);
return 0;
}
--- /dev/null
+puts "REQUIRED: Error. mkplane has been finished with \"Not Planar\" status."
+
+puts "========"
+puts "OCC26687"
+puts "========"
+puts ""
+#################################################
+# 0026687: SIGSEGV in BRepBuilderAPI_MakeFace
+#################################################
+
+restore [locate_data_file bug26687_w.brep] w
+
+#It is impossible to create a plane there is no any surface
+#which every edge has its p-cuve in.
+
+mkplane f w
+
+smallview
+donly f
+fit
+xwd ${imagedir}/${test_image}.png