From b50f8f57fc0aa336a30b773dedeb766774d3a1b7 Mon Sep 17 00:00:00 2001 From: azv Date: Mon, 5 Sep 2016 13:32:17 +0300 Subject: [PATCH] The set of constraints must be resolved when copies of multi-constraint used in other constraints and change their position (issue #1608) --- src/SketchSolver/SketchSolver_ConstraintMulti.cpp | 13 ++++++++++--- src/SketchSolver/SketchSolver_Group.cpp | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/SketchSolver/SketchSolver_ConstraintMulti.cpp b/src/SketchSolver/SketchSolver_ConstraintMulti.cpp index f89f31421..df18477ed 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMulti.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMulti.cpp @@ -132,9 +132,16 @@ void SketchSolver_ConstraintMulti::adjustConstraint() for (; aSIt != aSubs.end(); ++aSIt) { if ((*aSIt)->type() != ENTITY_POINT) continue; - std::list aParameters = (*aSIt)->parameters(); - aXCoord = aParameters.front()->value(); - aYCoord = aParameters.back()->value(); + AttributePoint2DPtr aPoint = + std::dynamic_pointer_cast((*aSIt)->baseAttribute()); + if (aPoint) { + aXCoord = aPoint->x(); + aYCoord = aPoint->y(); + } else { + std::list aParameters = (*aSIt)->parameters(); + aXCoord = aParameters.front()->value(); + aYCoord = aParameters.back()->value(); + } getRelative(aXCoord, aYCoord, aXCoord, aYCoord); aX.push_back(aXCoord); aY.push_back(aYCoord); diff --git a/src/SketchSolver/SketchSolver_Group.cpp b/src/SketchSolver/SketchSolver_Group.cpp index 106ba9b33..0e4211a3a 100644 --- a/src/SketchSolver/SketchSolver_Group.cpp +++ b/src/SketchSolver/SketchSolver_Group.cpp @@ -392,7 +392,7 @@ bool SketchSolver_Group::resolveConstraints() myStorage->refresh(); updateMultiConstraints(myConstraints); if (myStorage->isNeedToResolve()) // multi-constraints updated some parameters, need to store them - myStorage->refresh(); + resolveConstraints(); if (myPrevResult != STATUS_OK || myPrevResult == STATUS_UNKNOWN) { getWorkplane()->string(SketchPlugin_Sketch::SOLVER_ERROR())->setValue(""); -- 2.39.2