]> OCCT Git - occt-copy.git/commitdiff
0025104: Prism from BSpline curve can not be chamfered
authoraml <aml@opencascade.com>
Thu, 2 Nov 2017 09:08:18 +0000 (12:08 +0300)
committerbugmaster <bugmaster@opencascade.com>
Tue, 14 Nov 2017 12:56:55 +0000 (15:56 +0300)
Protection from zero-length vectors has been added.

src/IntCurveSurface/IntCurveSurface_Inter.gxx
src/IntTools/IntTools_EdgeEdge.cxx
tests/bugs/modalg_7/bug25104
tests/bugs/moddata_3/bug25693_1
tests/bugs/moddata_3/bug25693_2

index 786473581bb8744510ed567a594efebffbc927c4..d83d57cf4d9a71e34690fe4c34e01b237e4da635 100644 (file)
@@ -1436,7 +1436,8 @@ void IntCurveSurface_ComputeTransitions(const TheCurve& curve,
   NSurf = D1U.Crossed(D1V);
   TheCurveTool::D1(curve,w,Psurf,D1U);
   Standard_Real Norm = NSurf.Magnitude();
-  if(Norm>TOLERANCE_ANGULAIRE) { 
+  if(Norm>TOLERANCE_ANGULAIRE &&
+     D1U.SquareMagnitude() > TOLERANCE_ANGULAIRE) { 
     D1U.Normalize();
     CosDir = NSurf.Dot(D1U);
     CosDir/=Norm;
index 88379192eb8189ea50cae38d2348506e78af9b59..15e27e5a305c247d5abed3f576403fbaa95f171b 100644 (file)
@@ -996,15 +996,22 @@ Standard_Boolean IntTools_EdgeEdge::IsIntersection(const Standard_Real aT11,
     }
     //
     Standard_Real anAngleCriteria;
-    Standard_Real anAngle1, anAngle2;
+    Standard_Real anAngle1 = 0.0,
+                  anAngle2 = 0.0;
     //
     anAngleCriteria = 5.e-3;
-    if (bSmall_11_21 && bSmall_12_22) {
-      anAngle1 = aV11.Angle(aV21);
-      anAngle2 = aV12.Angle(aV22);
-    } else {
-      anAngle1 = aV11.Angle(aV22);
-      anAngle2 = aV12.Angle(aV21);
+    if (aV11.SquareMagnitude() > Precision::SquareConfusion() &&
+        aV12.SquareMagnitude() > Precision::SquareConfusion() &&
+        aV21.SquareMagnitude() > Precision::SquareConfusion() &&
+        aV22.SquareMagnitude() > Precision::SquareConfusion() )
+    {
+      if (bSmall_11_21 && bSmall_12_22) {
+        anAngle1 = aV11.Angle(aV21);
+        anAngle2 = aV12.Angle(aV22);
+      } else {
+        anAngle1 = aV11.Angle(aV22);
+        anAngle2 = aV12.Angle(aV21);
+      }
     }
     //
     if (((anAngle1 < anAngleCriteria) || ((M_PI - anAngle1) < anAngleCriteria)) ||
index b14321bb92497740bc79c66e01bbe546b56988bc..182e6b98fbc2b10aaf410a5d014d8f0e0e709c4b 100644 (file)
@@ -1,5 +1,3 @@
-puts "TODO OCC25104 Windows: ERROR: OCC25104 is reproduced."
-
 puts "========"
 puts "OCC25104"
 puts "========"
index 86d1aebbbdf91568fefb4e4ae0fda59047a2c7ad..bb5f1e5b9ef434affe62aa17d5d670d8c2afa8b7 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO OCC25693 Windows: Wire of BSplines fails bopcheck"
-
 puts "============"
 puts "OCC25693"
 puts "============"
index cfc7a0e05664623ef9fc60dace1c57a2e2fb0745..e0db6ea81133a99d8d7832f1a5d3ef340c40c702 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO OCC25693 Windows: Wire of BSplines fails bopcheck"
-
 puts "============"
 puts "OCC25693"
 puts "============"