Sketcher: fix split breaking sketch (#23711)

* Sketcher: Scale: Reorder operations and delete original modified constraints to ensure validity

* Sketcher: replace boolean parameters for deletion with enum and expose solver override on some deletion functions in the python API

* Use correct flag in ::delGeometry

* Set default value of false to noSolve

* Sketcher: autoscale: use deleteAllGeometry

* Sketcher: Scale: revert to checking constraints for geoId validity and handle horizontal&vertical

* Sketcher.Split: Avoid early solve that can break sketch

* Avoid reintroducing a typo

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
theo-vt
2025-09-23 13:00:36 -04:00
committed by GitHub
parent 5961651547
commit c6c084f22c

View File

@@ -3841,9 +3841,6 @@ int SketchObject::split(int GeoId, const Base::Vector3d& point)
deriveConstraintsForPieces(GeoId, newIds, con, newConstraints);
}
// `if (noRecomputes)` results in a failed test (`testPD_TNPSketchPadSketchSplit(self)`)
// TODO: figure out why, and if that check must be used
solve();
// This also seems to reset SketchObject::Geometry.
// TODO: figure out why, and if that check must be used
geoAsCurve = getGeometry<Part::GeomCurve>(GeoId);
@@ -3878,7 +3875,7 @@ int SketchObject::split(int GeoId, const Base::Vector3d& point)
transferConstraints(GeoId, PointPos::mid, newIds.front(), PointPos::mid);
}
delConstraints(std::move(idsOfOldConstraints));
delConstraints(std::move(idsOfOldConstraints), DeleteOption::NoSolve);
replaceGeometries({GeoId}, newGeos);
addConstraints(newConstraints);