From 0e2f538e6c7a2a210120b9258aa9da7108035dbe Mon Sep 17 00:00:00 2001 From: azv Date: Wed, 27 May 2015 16:52:11 +0300 Subject: [PATCH] Issue #567: Fixing of a vertical line --- src/SketchSolver/SketchSolver_ConstraintRigid.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/SketchSolver/SketchSolver_ConstraintRigid.cpp b/src/SketchSolver/SketchSolver_ConstraintRigid.cpp index 735412dde..6082f2fd4 100644 --- a/src/SketchSolver/SketchSolver_ConstraintRigid.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintRigid.cpp @@ -203,6 +203,13 @@ void SketchSolver_ConstraintRigid::fixLine(const Slvs_Entity& theLine) !myStorage->isPointFixed(theLine.point[1], aFixed, true)) fixPoint(theLine.point[0]); if (!isUsedInEqual(theLine, anEqual)) { + // Check the distance is not set yet + std::list aDistConstr = myStorage->getConstraintsByType(SLVS_C_PT_PT_DISTANCE); + std::list::const_iterator aDIt = aDistConstr.begin(); + for (; aDIt != aDistConstr.end(); aDIt++) + if ((aDIt->ptA == theLine.point[0] && aDIt->ptB == theLine.point[1]) || + (aDIt->ptA == theLine.point[1] && aDIt->ptB == theLine.point[0])) + return; // Calculate distance between points on the line double aCoords[4]; for (int i = 0; i < 2; i++) { -- 2.39.2