-Set algorithm flag NotDone if there is a non-degenerated edge with absent 3D curve.
-Check IsDone flag in thrusection command.
-Add test case bugs/modalg_5/bug25568.
Small correction of test case for issue CR25568
#include <BRepTools_WireExplorer.hxx>
#include <BRepTools.hxx>
-
+#include <Standard_NullObject.hxx>
//=======================================================================
}
else {
curv1 = BRep_Tool::Curve(Edge1, loc, first1, last1);
+ if (curv1.IsNull())
+ Standard_NullObject::Raise("Null 3D curve in edge");
curv1 =
Handle(Geom_Curve)::DownCast(curv1->Transformed(loc.Transformation()));
ff = first1;
}
else {
curv = BRep_Tool::Curve(Edge2, loc, first2, last2);
+ if (curv.IsNull())
+ Standard_NullObject::Raise("Null 3D curve in edge");
curv =
Handle(Geom_Curve)::DownCast(curv->Transformed(loc.Transformation()));
ff = first2;
}
else {
C1 = BRep_Tool::Curve(Edge1, loc, a1, b1);
+ if (C1.IsNull())
+ Standard_NullObject::Raise("Null 3D curve in edge");
C1 = Handle(Geom_Curve)::DownCast(C1->Transformed(loc.Transformation()));
aa = a1;
bb = b1;
}
else {
C2 = BRep_Tool::Curve(Edge2, loc, a1, b1);
+ if (C2.IsNull())
+ Standard_NullObject::Raise("Null 3D curve in edge");
C2 = Handle(Geom_Curve)::DownCast(C2->Transformed(loc.Transformation()));
if (Edge2.Orientation() == TopAbs_REVERSED) {
C2->Reverse();
}
else {
C1 = BRep_Tool::Curve(Edge1,L1,f1,l1);
+ if (C1.IsNull())
+ Standard_NullObject::Raise("Null 3D curve in edge");
}
if (degen2) {
Extremities(1) = BRep_Tool::Pnt(V2l);
}
else {
C2 = BRep_Tool::Curve(Edge2,L2,f2,l2);
+ if (C2.IsNull())
+ Standard_NullObject::Raise("Null 3D curve in edge");
}
// compute the location
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_FindPlane.hxx>
+#include <Standard_NullObject.hxx>
//=======================================================================
myWires = WorkingSections;
}
- // Calculate the resulting shape
- if (myWires.Length() == 2 || myIsRuled) {
- // create a ruled shell
- CreateRuled();
+ try {
+ // Calculate the resulting shape
+ if (myWires.Length() == 2 || myIsRuled) {
+ // create a ruled shell
+ CreateRuled();
+ }
+ else {
+ // create a smoothed shell
+ CreateSmoothed();
+ }
}
- else {
- // create a smoothed shell
- CreateSmoothed();
+ catch (Standard_Failure)
+ {
+ NotDone();
+ return;
}
// Encode the Regularities
BRepLib::EncodeRegularity(myShape);
-
}
TopLoc_Location aLoc;
Standard_Real aFirst, aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve (theEdge, aLoc, aFirst, aLast);
+ if (aCurve.IsNull())
+ Standard_NullObject::Raise("Null 3D curve in edge");
// convert its part used by edge to bspline; note that if edge curve is bspline,
// conversion made via trimmed curve is still needed -- it will copy it, segment
Generator.Build();
- TopoDS_Shape Shell = Generator.Shape();
-
- DBRep::Set(a[index-1], Shell);
-
+ if (Generator.IsDone()) {
+ TopoDS_Shape Shell = Generator.Shape();
+ DBRep::Set(a[index-1], Shell);
+ }
+ else {
+ cout << "Algorithm is not done" << endl;
+ }
return 0;
}
--- /dev/null
+puts "============"
+puts "OCC25568"
+puts "============"
+puts ""
+#########################################################################
+# SIGSEGV in thrusections with edge without 3D curve
+#########################################################################
+
+restore [locate_data_file bug25568_loft-inv1-draw-Loft-00-section.brep] Loft-00-section
+restore [locate_data_file bug25568_loft-inv1-draw-Loft-01-section.brep] Loft-01-section
+
+if [info exists result] {unset result}
+
+thrusections result 0 0 Loft-00-section Loft-01-section
+
+if ![isdraw result] {
+ if {[info commands fixshape] == ""} {pload XSDRAW}
+ fixshape Loft-00-section_fixed Loft-00-section
+ thrusections result 0 0 Loft-00-section_fixed Loft-01-section
+ if ![isdraw result] {
+ puts "Error : thrusection is failed even after fixing arguments"
+ }
+}
+
+set square 25.236
+set 2dviewer 0