]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for crash of unit-test TestCreateCircleByCenterAndPassed on Windows where it...
authormpv <mpv@opencascade.com>
Wed, 12 Apr 2017 07:13:07 +0000 (10:13 +0300)
committermpv <mpv@opencascade.com>
Wed, 12 Apr 2017 07:13:07 +0000 (10:13 +0300)
src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp

index 43e816d6ec6e61a70303cc6c567c815e3de3c2bc..c1dd4cd32936b495d6eaa71a91c411ba782c6732 100644 (file)
@@ -139,7 +139,8 @@ private:
     CurveAdaptorPtr aCurve = myTangentShapes[0];
 
     std::shared_ptr<GccAna_Circ2dTanCen> aCircleBuilder;
-    if (aCurve->GetType() == GeomAbs_Line) {
+    if (aCurve->GetType() == GeomAbs_Line &&
+        aCurve->Line().Distance(aCenter) > Precision::Confusion()) {
       aCircleBuilder = std::shared_ptr<GccAna_Circ2dTanCen>(
           new GccAna_Circ2dTanCen(aCurve->Line(), aCenter));
     } else if (aCurve->GetType() == GeomAbs_Circle) {