From eac4352b75f21bdac2c1a8ff2f69bcbf68c1f934 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Sun, 4 Nov 2018 09:15:40 +0100 Subject: [PATCH] Sketcher: Trim bug ================== Trim tool fails to generate coincidence upon trimming an arc of ellipse at the end of the arc. https://forum.freecadweb.org/viewtopic.php?f=3&t=31594&start=50#p266765 --- src/Mod/Sketcher/App/SketchObject.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index d1cb1da5ed..7fa8fdcfa5 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -2534,7 +2534,19 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point) delConstraintOnPoint(GeoId, end, false); Part::GeomArcOfEllipse *aoe1 = static_cast(geomlist[GeoId]); aoe1->setRange(startAngle, startAngle + theta1, /*emulateCCW=*/true); - + + Sketcher::Constraint *newConstr = new Sketcher::Constraint(); + newConstr->Type = constrType; + newConstr->First = GeoId; + newConstr->FirstPos = end; + newConstr->Second = GeoId1; + + if (constrType == Sketcher::Coincident) + newConstr->SecondPos = secondPos; + + addConstraint(newConstr); + delete newConstr; + if(noRecomputes) // if we do not have a recompute, the sketch must be solved to update the DoF of the solver solve(); return 0;