]> OCCT Git - occt.git/commitdiff
0028871: Various problems in SAT export
authoranv <anv@opencascade.com>
Wed, 28 Jun 2017 13:10:30 +0000 (16:10 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 27 Jul 2017 10:59:22 +0000 (13:59 +0300)
src/ShapeAnalysis/ShapeAnalysis_Curve.cxx
tests/bugs/step/bug28871 [new file with mode: 0644]

index fc6f276894fc18970778049cdbae5b0cc5c02635..e33ae0eb041268954c8012ded8554d9b30b7580e 100644 (file)
@@ -737,6 +737,7 @@ Standard_Integer ShapeAnalysis_Curve::SelectForwardSeam(const Handle(Geom2d_Curv
     gp_Pnt2d StartBC1 = BC1->StartPoint();
     gp_Pnt2d EndBC1   = BC1->EndPoint();
     gp_Vec2d VecBC1(StartBC1, EndBC1);
+    if (VecBC1.SquareMagnitude() < gp::Resolution()) return theCurveIndice;
     L1 = new Geom2d_Line(StartBC1, VecBC1);
   }
 
@@ -748,6 +749,7 @@ Standard_Integer ShapeAnalysis_Curve::SelectForwardSeam(const Handle(Geom2d_Curv
     gp_Pnt2d StartBC2 = BC2->StartPoint();
     gp_Pnt2d EndBC2   = BC2->EndPoint();
     gp_Vec2d VecBC2(StartBC2, EndBC2);
+    if (VecBC2.SquareMagnitude() < gp::Resolution()) return theCurveIndice;
     L2 = new Geom2d_Line(StartBC2, VecBC2);
   }
 
diff --git a/tests/bugs/step/bug28871 b/tests/bugs/step/bug28871
new file mode 100644 (file)
index 0000000..938b96d
--- /dev/null
@@ -0,0 +1,28 @@
+puts "========"
+puts "OCC28871"
+puts "========"
+puts ""
+##########################################################################
+# Various problems in SAT export
+##########################################################################
+
+stepread [locate_data_file bug28871_cuffie.stp] a *
+tpcompound result
+
+checkprops result -s 170790 
+checkshape result
+
+set nbshapes_expected "
+Number of shapes in shape
+ VERTEX    : 1387
+ EDGE      : 2222
+ WIRE      : 953
+ FACE      : 928
+ SHELL     : 53
+ SOLID     : 39
+ COMPSOLID : 0
+ COMPOUND  : 1
+ SHAPE     : 5583
+"
+checknbshapes result -ref ${nbshapes_expected} -t -m "importing file"
+checkview -display result -3d -path ${imagedir}/${test_image}.png