From b7e4e0a40586fb1a035faaa4e5aa385d70370cfd Mon Sep 17 00:00:00 2001 From: mpv Date: Wed, 12 Apr 2017 10:13:07 +0300 Subject: [PATCH] Fix for crash of unit-test TestCreateCircleByCenterAndPassed on Windows where it tries to make a circle tangent to line that goes through the circle center. --- src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp index 43e816d6e..c1dd4cd32 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp @@ -139,7 +139,8 @@ private: CurveAdaptorPtr aCurve = myTangentShapes[0]; std::shared_ptr aCircleBuilder; - if (aCurve->GetType() == GeomAbs_Line) { + if (aCurve->GetType() == GeomAbs_Line && + aCurve->Line().Distance(aCenter) > Precision::Confusion()) { aCircleBuilder = std::shared_ptr( new GccAna_Circ2dTanCen(aCurve->Line(), aCenter)); } else if (aCurve->GetType() == GeomAbs_Circle) { -- 2.39.2