From e66849378bd03373c1c0d7c754bf78db85e2aff1 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Mon, 8 Oct 2018 14:24:22 +0200 Subject: [PATCH] Sketcher: Avoid transfering angle constraints ============================================= Angle constraints are internally coded using the diverging points of the segments (PointPos != none) in normal 2 segment angle constraints. This creates a problem with the mechanism to transfer enpoints on angle deletion. fixes #3589 --- src/Mod/Sketcher/App/SketchObject.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index a6fd1fa4b1..2b03b439af 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -1148,8 +1148,17 @@ int SketchObject::transferConstraints(int fromGeoId, PointPos fromPosId, int toG constNew->First = toGeoId; constNew->FirstPos = toPosId; - if(vals[i]->Type == Sketcher::Tangent || vals[i]->Type == Sketcher::Perpendicular) + if(vals[i]->Type == Sketcher::Tangent || vals[i]->Type == Sketcher::Perpendicular){ constNew->Type = Sketcher::Coincident; + } + // with respect to angle constraints, if it is a DeepSOIC style angle constraint (segment+segment+point), then no problem arises + // as the segments are PosId=none. In this case there is not call to this function. + // + // However, other angle constraints are problematic because they are created on segments, but internally operate on vertices, PosId=start + // such constraint may not be succesfully transfered on deletion of the segments. + else if(vals[i]->Type == Sketcher::Angle) { + continue; + } newVals[i] = constNew; changed.push_back(constNew); @@ -1164,8 +1173,12 @@ int SketchObject::transferConstraints(int fromGeoId, PointPos fromPosId, int toG // Nothing guarantees that a tangent can be freely transferred to another coincident point, as // the transfer destination edge most likely won't be intended to be tangent. However, if it is // an end to end point tangency, the user expects it to be substituted by a coincidence constraint. - if(vals[i]->Type == Sketcher::Tangent || vals[i]->Type == Sketcher::Perpendicular) + if(vals[i]->Type == Sketcher::Tangent || vals[i]->Type == Sketcher::Perpendicular) { constNew->Type = Sketcher::Coincident; + } + else if(vals[i]->Type == Sketcher::Angle) { + continue; + } newVals[i] = constNew; changed.push_back(constNew);