]> OCCT Git - occt-copy.git/commitdiff
0025879: result of blend fails the bopcheck
authoraml <aml@opencascade.com>
Fri, 10 Nov 2017 15:21:21 +0000 (18:21 +0300)
committerbugmaster <bugmaster@opencascade.com>
Wed, 22 Nov 2017 12:45:26 +0000 (15:45 +0300)
Protection from the zero-length gp_Dir construction is added.

src/ElCLib/ElCLib.cxx
tests/bugs/modalg_7/bug25879

index 8801ef8a3bed82f85adfea91cf42b109cc8d62d4..c16bb6c7dd751405d52fd63d707e6aa5bcb5c933 100644 (file)
@@ -1312,8 +1312,10 @@ Standard_Real ElCLib::LineParameter (const gp_Ax1& L, const gp_Pnt& P)
 Standard_Real ElCLib::CircleParameter (const gp_Ax2& Pos,
                                       const gp_Pnt& P)
 {
-  Standard_Real Teta = (Pos.XDirection()) .AngleWithRef
-    (gp_Vec (Pos.Location(), P), Pos.Direction());
+  gp_Vec aVec(Pos.Location(), P);
+  Standard_Real Teta = 0.0;
+  if (aVec.SquareMagnitude() > gp::Resolution())
+    Teta = (Pos.XDirection()).AngleWithRef(aVec, Pos.Direction());
   if      (Teta < -1.e-16)  Teta += PIPI;
   else if (Teta < 0)        Teta = 0;
   return Teta;
index e344c396ab7ca98048b29182c9be2eb1076661cc..77ec00112548ff3845db713b4736e4d7c29def1c 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO OCC25879 Windows: Error : result of blend fails the bopcheck"
-
 puts "============"
 puts "OCC25879"
 puts "============"