From 1de0e9646723acbcad09ad9a4ad8ec7a0988953d Mon Sep 17 00:00:00 2001 From: Florian Foinant-Willig Date: Sun, 25 Jun 2023 22:45:51 +0200 Subject: [PATCH] Sketcher: fix CircleToCircle distance constraint with external Create c2c distance constraint with one external geometry raised a malformed constraint error + clang format catch by precommit hook --- src/Mod/Sketcher/App/Sketch.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/Mod/Sketcher/App/Sketch.cpp b/src/Mod/Sketcher/App/Sketch.cpp index 8c3cd564dc..c4194e334c 100644 --- a/src/Mod/Sketcher/App/Sketch.cpp +++ b/src/Mod/Sketcher/App/Sketch.cpp @@ -68,17 +68,17 @@ using namespace Part; TYPESYSTEM_SOURCE(Sketcher::Sketch, Base::Persistence) Sketch::Sketch() - : SolveTime(0), - RecalculateInitialSolutionWhileMovingPoint(false), - resolveAfterGeometryUpdated(false), - GCSsys(), - ConstraintsCounter(0), - isInitMove(false), - isFine(true), - moveStep(0), - defaultSolver(GCS::DogLeg), - defaultSolverRedundant(GCS::DogLeg), - debugMode(GCS::Minimal) + : SolveTime(0) + , RecalculateInitialSolutionWhileMovingPoint(false) + , resolveAfterGeometryUpdated(false) + , GCSsys() + , ConstraintsCounter(0) + , isInitMove(false) + , isFine(true) + , moveStep(0) + , defaultSolver(GCS::DogLeg) + , defaultSolverRedundant(GCS::DogLeg) + , debugMode(GCS::Minimal) {} Sketch::~Sketch() @@ -3102,6 +3102,9 @@ int Sketch::addDistanceConstraint(int geoId1, PointPos pos1, int geoId2, PointPo // circle-(circle or line) distance constraint int Sketch::addDistanceConstraint(int geoId1, int geoId2, double* value, bool driving) { + geoId1 = checkGeoId(geoId1); + geoId2 = checkGeoId(geoId2); + if (Geoms[geoId1].type == Circle) { if (Geoms[geoId2].type == Circle) { GCS::Circle& c1 = Circles[Geoms[geoId1].index];