From 502b7b9a3f2e31d025e1f5227edeb8f671fc1f52 Mon Sep 17 00:00:00 2001 From: Ajinkya Dahale Date: Thu, 2 Jan 2025 10:31:19 +0530 Subject: [PATCH] [Sketcher] Fix some issues in `trim` 1. Don't bother deleting internal geometry first. 2. Don't assume all new constraints are well formed. --- src/Mod/Sketcher/App/SketchObject.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 7f2c6757ee..3beda7f640 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -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(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); }