}
}
- if (aDir[0]->cross(aDir[1]) * aConstraint->value() < 0.0)
+ double anAngle = aLine[0]->direction()->angle(aLine[1]->direction()) / PI * 180;
+ if (anAngle * aConstraint->value() < 0.0)
aConstraint->setValue(-aConstraint->value());
-
- bool isChange = false;
- for (int i = 0; i < 2; i++)
- if (aLine[i]->direction()->dot(aDir[i]) < 0.0)
- isChange = !isChange;
- if (isChange)
- aConstraint->setValue(180.0 - aConstraint->value());
+ if ((90.0 - fabs(anAngle)) * (fabs(aConstraint->value()) - 90.0) > 0.0) {
+ if (aConstraint->value() < 0.0)
+ aConstraint->setValue(-180.0 - aConstraint->value());
+ else
+ aConstraint->setValue(180.0 - aConstraint->value());
+ }
}
////void adjustMirror(ConstraintWrapperPtr theConstraint)
BuilderPtr aBuilder = SketchSolver_Manager::instance()->builder();
ConstraintWrapperPtr aConstraint = myStorage->constraint(myBaseConstraint).front();
- if (fabs(myAngle - aConstraint->value()) < aTol)
- return;
+ //if (fabs(myAngle - aConstraint->value()) < aTol)
+ // return;
myAngle = aConstraint->value();
aBuilder->adjustConstraint(aConstraint);
myStorage->addConstraint(myBaseConstraint, aConstraint);