[Sketcher] Fix some issues in trim

1. Don't bother deleting internal geometry first.
2. Don't assume all new constraints are well formed.
This commit is contained in:
Ajinkya Dahale
2025-01-02 10:31:19 +05:30
parent 53f7fbd66e
commit a817bcd5ac

View File

@@ -3830,7 +3830,6 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
}
// Remove internal geometry beforehand for now
// FIXME: we should be able to transfer these to new curves smoothly
deleteUnusedInternalGeometryAndUpdateGeoId(GeoId);
// auto geo = getGeometry(GeoId);
const auto* geoAsCurve = static_cast<const Part::GeomCurve*>(getGeometry(GeoId));
@@ -3964,7 +3963,7 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
delConstraints(idsOfOldConstraints);
if (isClosedCurve(geoAsCurve)) {
if (!isClosedCurve(geoAsCurve)) {
transferConstraints(GeoId, PointPos::start, newIds.front(), PointPos::start, true);
transferConstraints(GeoId, PointPos::end, newIds.back(), PointPos::end, true);
}