diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 3d268f2644..fdd946fc2a 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -694,6 +694,24 @@ int SketchObject::setUpSketch() Constraints.touch(); return lastDoF; +} + +int SketchObject::diagnoseAdditionalConstraints(std::vector additionalconstraints) +{ + auto objectconstraints = Constraints.getValues(); + + std::vector allconstraints; + allconstraints.reserve(objectconstraints.size()+additionalconstraints.size()); + + std::copy(objectconstraints.begin(), objectconstraints.end(), back_inserter(allconstraints)); + std::copy(additionalconstraints.begin(), additionalconstraints.end(), back_inserter(allconstraints)); + + lastDoF = solvedSketch.setUpSketch(getCompleteGeometry(), allconstraints, + getExternalGeometryCount()); + + retrieveSolverDiagnostics(); + + return lastDoF; } diff --git a/src/Mod/Sketcher/App/SketchObject.h b/src/Mod/Sketcher/App/SketchObject.h index 316f1f0ca4..95dde505b9 100644 --- a/src/Mod/Sketcher/App/SketchObject.h +++ b/src/Mod/Sketcher/App/SketchObject.h @@ -211,6 +211,9 @@ public: */ int setUpSketch(); + /** Performs a full analysis of the addition of additional constraints without adding them to the sketch object */ + int diagnoseAdditionalConstraints(std::vector additionalconstraints); + /** solves the sketch and updates the geometry, but not all the dependent features (does not recompute) When a recompute is necessary, recompute triggers execute() which solves the sketch and updates all dependent features When a solve only is necessary (e.g. DoF changed), solve() solves the sketch and