From: nds Date: Thu, 3 Mar 2016 15:27:44 +0000 (+0300) Subject: Full/single angle X-Git-Tag: V_2.2.0~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=18cff8468b245dc5ff3726cc1a4a9928eaf14270;p=modules%2Fshaper.git Full/single angle --- 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(); }