Test1924.py
Test1966.py
Test1967.py
+ Test2095.py
TestTrimArc01.py
TestTrimArc02.py
TestTrimArc03.py
--- /dev/null
+from SketchAPI import *
+from salome.shaper import model
+
+lineStart = [26, 53]
+lineEnd = [71, 30]
+
+model.begin()
+partSet = model.moduleDocument()
+Sketch_1 = model.addSketch(partSet, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(lineStart[0], lineStart[1], lineEnd[0], lineEnd[1])
+SketchLine_2 = Sketch_1.addLine(model.selection("EDGE", "OX"))
+SketchConstraintMirror_1 = Sketch_1.addMirror(SketchLine_2.result(), [SketchLine_1.result()])
+[SketchLine_3] = SketchConstraintMirror_1.mirrored()
+
+SketchLine_4 = Sketch_1.addLine(lineEnd[0], lineEnd[1], lineEnd[0], -lineEnd[1])
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_4.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_3).endPoint(), SketchLine_4.endPoint())
+
+Sketch_1.setFillet(SketchLine_1.endPoint())
+model.do()
+
+assert(SketchLine_1.startPoint().x() == SketchAPI_Line(SketchLine_3).startPoint().x())
+assert(SketchLine_1.startPoint().y() == -SketchAPI_Line(SketchLine_3).startPoint().y())
+assert(SketchLine_1.endPoint().x() == SketchAPI_Line(SketchLine_3).endPoint().x())
+assert(SketchLine_1.endPoint().y() == -SketchAPI_Line(SketchLine_3).endPoint().y())
+assert(SketchLine_1.endPoint().x() != lineEnd[0])
+assert(SketchLine_1.endPoint().y() != lineEnd[1])
+
+model.end()
}
EntityWrapperPtr aRelated = entity(anAttribute);
+ FeaturePtr aFeature = ModelAPI_Feature::feature(anAttribute->owner());
if (!aRelated) { // Attribute does not exist, create it.
// First of all check if the parent feature exists. If not, add it.
- FeaturePtr aFeature = ModelAPI_Feature::feature(anAttribute->owner());
if (aFeature && myFeatureMap.find(aFeature) == myFeatureMap.end())
return update(aFeature, theForce); // theAttribute has been processed while adding feature
-
-//// PlaneGCSSolver_AttributeBuilder aBuilder(this);
-//// aRelated = createAttribute(anAttribute, &aBuilder);
return aRelated.get() != 0;
}
bool isUpdated = updateValues(anAttribute, aRelated);
- if (isUpdated)
+ if (isUpdated) {
setNeedToResolve(true);
+ notify(aFeature);
+ }
return isUpdated;
}
// Function: resolveConstraints
// Class: SketchSolver_Group
// Purpose: solve the set of constraints for the current group
+#include <iostream>
// ============================================================================
bool SketchSolver_Group::resolveConstraints()
{
- static const int MAX_STACK_SIZE = 3;
+ static const int MAX_STACK_SIZE = 5;
// check the "Multi" constraints do not drop sketch into infinite loop
if (myMultiConstraintUpdateStack > MAX_STACK_SIZE) {
+ myMultiConstraintUpdateStack = 0;
myPrevResult = PlaneGCSSolver_Solver::STATUS_FAILED;
// generate error message due to loop update of the sketch
getWorkplane()->string(SketchPlugin_Sketch::SOLVER_ERROR())
PlaneGCSSolver_Solver::SolveStatus aResult = PlaneGCSSolver_Solver::STATUS_OK;
try {
- if (!isGroupEmpty && myMultiConstraintUpdateStack <= 1)
+ if (!isGroupEmpty)
aResult = mySketchSolver->solve();
} catch (...) {
getWorkplane()->string(SketchPlugin_Sketch::SOLVER_ERROR())