From fc82d71c1517449b986297f40e84ff2fae5cb766 Mon Sep 17 00:00:00 2001 From: PaddleStroke Date: Tue, 13 Jan 2026 20:48:41 +0100 Subject: [PATCH] Sketcher: Fix symmetry of slot redundancy false positive (#26604) * Sketcher: Fix symmetry of slot redundancy false positive Perturb symmetric geometries when using the 'create symmetric constraints' option to avoid numerical singularities in the solver (Jacobian Rank). If geometry is "perfect", the solver cannot distinguish between the derivative of a Symmetry constraint and an Equal constraint, flagging one as redundant. --- src/Mod/Sketcher/App/SketchObject.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index e33be032d7..9e28156fd8 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -4385,6 +4385,21 @@ int SketchObject::addSymmetric( std::vector symgeos = getSymmetric(geoIdList, geoIdMap, isStartEndInverted, refGeoId, refPosId); + // Perturb geometry to avoid numerical singularities in the solver (Jacobian Rank). + // If geometry is "perfect", the solver cannot distinguish between the derivative + // of a Symmetry constraint and an Equal constraint, flagging one as redundant. + // see https://github.com/FreeCAD/FreeCAD/issues/13551 + // This does not happen with other arcs types. + if (addSymmetryConstraints) { + for (auto* geo : symgeos) { + if (auto* arc = dynamic_cast(geo)) { + double start, end; + arc->getRange(start, end, true); + arc->setRange(start + Precision::Angular(), end, true); + } + } + } + { addGeometry(symgeos);