From c6c084f22ce71ef907013fcbf4926e5d90324d50 Mon Sep 17 00:00:00 2001 From: theo-vt Date: Tue, 23 Sep 2025 13:00:36 -0400 Subject: [PATCH] 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> --- src/Mod/Sketcher/App/SketchObject.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 8b391210c2..7c5dccc8f3 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -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(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);