From: azv Date: Mon, 9 Sep 2019 10:47:09 +0000 (+0300) Subject: Task 2.11. Ability to impose a midpoint on an arc (refers issue #3002) X-Git-Tag: V9_4_0a2~4^2~127 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1f2974016e286433b3d72bc4fb83ced215b9c60a;p=modules%2Fshaper.git Task 2.11. Ability to impose a midpoint on an arc (refers issue #3002) Revert fixing of extra parameters of an arc to old approach, because the new one produces several regressions in unit-tests. --- diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp index ba86322fd..1cd94ac2e 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp @@ -299,16 +299,16 @@ static void createArcConstraints(const EntityWrapperPtr& theArc, // Additional constaints to fix arc's extra DoF (if the arc is not external): std::list anArcConstraints; - // constrain the start point on the arc - anArcConstraints.push_back(GCSConstraintPtr(new GCS::ConstraintCurveValue( - anArc->start, anArc->start.x, *anArc, anArc->startAngle))); - anArcConstraints.push_back(GCSConstraintPtr(new GCS::ConstraintCurveValue( - anArc->start, anArc->start.y, *anArc, anArc->startAngle))); - // constrain the end point on the arc - anArcConstraints.push_back(GCSConstraintPtr(new GCS::ConstraintCurveValue( - anArc->end, anArc->end.x, *anArc, anArc->endAngle))); - anArcConstraints.push_back(GCSConstraintPtr(new GCS::ConstraintCurveValue( - anArc->end, anArc->end.y, *anArc, anArc->endAngle))); + // 1. distances from center till start and end points are equal to radius + anArcConstraints.push_back(GCSConstraintPtr(new GCS::ConstraintP2PDistance( + anArc->center, anArc->start, anArc->rad))); + anArcConstraints.push_back(GCSConstraintPtr(new GCS::ConstraintP2PDistance( + anArc->center, anArc->end, anArc->rad))); + // 2. angles of start and end points should be equal to the arc angles + anArcConstraints.push_back(GCSConstraintPtr(new GCS::ConstraintP2PAngle( + anArc->center, anArc->start, anArc->startAngle))); + anArcConstraints.push_back(GCSConstraintPtr(new GCS::ConstraintP2PAngle( + anArc->center, anArc->end, anArc->endAngle))); ConstraintWrapperPtr aWrapper( new PlaneGCSSolver_ConstraintWrapper(anArcConstraints, CONSTRAINT_UNKNOWN));