From 94b4ebd0def2f4659ee228f419214625f30aa855 Mon Sep 17 00:00:00 2001 From: azv Date: Wed, 1 Jun 2016 10:25:21 +0300 Subject: [PATCH] PlaneGCSSolver: update Angle constraint to be consistent with SketchPlugin_ConstraintAngle feature (issue #1536) --- .../PlaneGCSSolver/PlaneGCSSolver_Builder.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp index 3ad5b78a8..24d9cb3f0 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp @@ -955,9 +955,19 @@ ConstraintWrapperPtr createConstraintAngle( std::shared_ptr theEntity2) { std::shared_ptr aLine1 = std::dynamic_pointer_cast(theEntity1->entity()); + bool isLine1Rev = theConstraint->boolean( + SketchPlugin_ConstraintAngle::ANGLE_REVERSED_FIRST_LINE_ID())->value(); + GCS::Point aLine1Pt1 = isLine1Rev ? aLine1->p2 : aLine1->p1; + GCS::Point aLine1Pt2 = isLine1Rev ? aLine1->p1 : aLine1->p2; + std::shared_ptr aLine2 = std::dynamic_pointer_cast(theEntity2->entity()); + bool isLine2Rev = theConstraint->boolean( + SketchPlugin_ConstraintAngle::ANGLE_REVERSED_SECOND_LINE_ID())->value(); + GCS::Point aLine2Pt1 = isLine2Rev ? aLine2->p2 : aLine2->p1; + GCS::Point aLine2Pt2 = isLine2Rev ? aLine2->p1 : aLine2->p2; + GCSConstraintPtr aNewConstr(new GCS::ConstraintL2LAngle( - *(aLine1), *(aLine2), theValue->parameter())); + aLine1Pt1, aLine1Pt2, aLine2Pt1, aLine2Pt2, theValue->parameter())); std::shared_ptr aResult( new PlaneGCSSolver_ConstraintWrapper(theConstraint, aNewConstr, CONSTRAINT_ANGLE)); -- 2.39.2