From 18cff8468b245dc5ff3726cc1a4a9928eaf14270 Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 3 Mar 2016 18:27:44 +0300 Subject: [PATCH] Full/single angle --- src/SketchSolver/SketchSolver_ConstraintMultiRotation.cpp | 8 ++++++-- .../SketchSolver_ConstraintMultiTranslation.cpp | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/SketchSolver/SketchSolver_ConstraintMultiRotation.cpp b/src/SketchSolver/SketchSolver_ConstraintMultiRotation.cpp index e2839f7b9..bd53679d9 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMultiRotation.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMultiRotation.cpp @@ -143,8 +143,12 @@ void SketchSolver_ConstraintMultiRotation::adjustConstraint() myCenterCoord[0] = aParams.front()->value(); myCenterCoord[1] = aParams.back()->value(); - myRotationVal[0] = sin(myAngle * PI / 180.0); - myRotationVal[1] = cos(myAngle * PI / 180.0); + double anAngleValue = myAngle; + if (myIsFullValue && myNumberOfCopies > 0) + anAngleValue /= myNumberOfCopies; + + myRotationVal[0] = sin(anAngleValue * PI / 180.0); + myRotationVal[1] = cos(anAngleValue * PI / 180.0); SketchSolver_ConstraintMulti::adjustConstraint(); } diff --git a/src/SketchSolver/SketchSolver_ConstraintMultiTranslation.cpp b/src/SketchSolver/SketchSolver_ConstraintMultiTranslation.cpp index dd740003a..2bea9a217 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMultiTranslation.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMultiTranslation.cpp @@ -148,9 +148,15 @@ void SketchSolver_ConstraintMultiTranslation::adjustConstraint() EntityWrapperPtr aEnd = myStorage->entity( myBaseConstraint->attribute(SketchPlugin_MultiTranslation::END_POINT_ID())); std::list aEndParams = aEnd->parameters(); + myDelta[0] = aEndParams.front()->value() - aStartParams.front()->value(); myDelta[1] = aEndParams.back()->value() - aStartParams.back()->value(); + if (myIsFullValue && myNumberOfCopies > 0) { + myDelta[0] /= myNumberOfCopies; + myDelta[1] /= myNumberOfCopies; + } + SketchSolver_ConstraintMulti::adjustConstraint(); } -- 2.39.2