From 1d8b62d5f466237e9f4862e6454c675f83ff9d9d Mon Sep 17 00:00:00 2001 From: azv Date: Thu, 11 May 2017 08:11:16 +0300 Subject: [PATCH] Issue #2161: Fatal error when creating a circle coincident to an existing circle in a sketch Fatal error has been eliminated. --- src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp | 2 +- src/SketchSolver/SketchSolver_Storage.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp index 6ae62b929..7338ad4e7 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp @@ -167,7 +167,7 @@ private: double aParSol, aPonTgCurve; gp_Pnt2d aTgPnt; - for (int i = 1; i <= aNbSol && aCurve; ++i) { + for (int i = 1; i <= aNbSol && aNbSol > 1 && aCurve; ++i) { theBuilder->Tangency1(i, aParSol, aPonTgCurve, aTgPnt); if (isParamOnCurve(aPonTgCurve, aCurve)) { double aDist = distanceToClosestPoint(theBuilder->ThisSolution(i)); diff --git a/src/SketchSolver/SketchSolver_Storage.cpp b/src/SketchSolver/SketchSolver_Storage.cpp index 895edeb58..1cf9441bc 100644 --- a/src/SketchSolver/SketchSolver_Storage.cpp +++ b/src/SketchSolver/SketchSolver_Storage.cpp @@ -192,11 +192,13 @@ const EntityWrapperPtr& SketchSolver_Storage::entity(const AttributePtr& theAttr void SketchSolver_Storage::removeFeature(FeaturePtr theFeature) { myFeatureMap.erase(theFeature); + myNeedToResolve = true; } void SketchSolver_Storage::removeAttribute(AttributePtr theAttribute) { myAttributeMap.erase(theAttribute); + myNeedToResolve = true; } -- 2.39.2