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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user