]> OCCT Git - occt.git/commitdiff
0026568: Modeling Algorithms - Exception when creating pipe
authorifv <ifv@opencascade.com>
Tue, 11 Aug 2020 14:00:03 +0000 (17:00 +0300)
committerbugmaster <bugmaster@opencascade.com>
Sat, 22 Aug 2020 09:13:10 +0000 (12:13 +0300)
BRepFill_Pipe.cxx:  protection against wrong shape type is added
GeomFill_Sweep.cxx:  protection against using 0-vector to create Direction is added

bug26568: test script is corrected: "TODO ..." is removed

src/BRepFill/BRepFill_Pipe.cxx
src/GeomFill/GeomFill_Sweep.cxx
tests/bugs/modalg_7/bug26568

index 2d7f74b36fe471ca2163d8e084d855f83421a497..d51a3c9811e5e68f6be9834109979b4c11719cdb 100644 (file)
@@ -760,8 +760,11 @@ TopoDS_Shape BRepFill_Pipe::MakeShape(const TopoDS_Shape& S,
     TopoDS_Face F;
     for (ii=InitialLength+1; ii<=myFaces->ColLength(); ii++) {
       for (jj=1; jj<=myFaces->RowLength(); jj++) {
-       F = TopoDS::Face(myFaces->Value(ii, jj));
-       if (!F.IsNull()) B.Add(result, F);
+        if (myFaces->Value(ii, jj).ShapeType() == TopAbs_FACE)
+        {
+          F = TopoDS::Face(myFaces->Value(ii, jj));
+          if (!F.IsNull()) B.Add(result, F);
+        }
       }
     }
 
index 6e8ce1426c97712c573b58274c28d2653803580a..b47d6ab0e6cc6417ea0eeaddab2b826f34b87205 100644 (file)
@@ -953,7 +953,12 @@ static Standard_Boolean IsSweepParallelSpine (const Handle(GeomFill_LocationLaw)
            // (2.2.a) Cylindre
             // si la line est orthogonale au plan de rotation
            SError = error;
-           gp_Ax3 Axis(CentreOfSurf, Dir.Direction(), DS);
+      //
+      gp_Ax3 Axis(CentreOfSurf, Dir.Direction());
+      if (DS.SquareMagnitude() > gp::Resolution())
+      {
+        Axis.SetXDirection(DS);
+      }
            S = new (Geom_CylindricalSurface) 
                    (Axis, L.Distance(CentreOfSurf));
            Ok = Standard_True;
index 7d73494d6e5761a0b18a849c2f985abdc1d19468..4bc77056320787a1ffa79b7f6f29fd9489768f07 100644 (file)
@@ -1,10 +1,6 @@
-puts "TODO OCC26568 ALL: An exception was caught"
-puts "TODO OCC26568 ALL: \\*\\* Exception \\*\\*.*"
-puts "TODO OCC26568 ALL: TEST INCOMPLETE"
-
-puts "========"
-puts "OCC26568"
-puts "========"
+puts "============================================================="
+puts "OCC26568 - Modeling Algorithms - Crash when creating pipe"
+puts "============================================================="
 puts ""
 ################################
 # Exception when creating pipe
@@ -15,4 +11,14 @@ explode b f
 circle c 0 0 0 0 1 0 10
 mkedge e c
 wire w e
-pipe p w b_1
+pipe result w b_1
+
+checkshape result
+
+checknbshapes result -solid 1 -shell 1 -face 3 -wire 3 -edge 7 -vertex 4
+
+set tolres [checkmaxtol result]
+
+if { ${tolres} > 2.e-7} {
+   puts "Error: bad tolerance of result"
+}