From a17ac10b0be017cda7179da521a70d2fbcef5950 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Fri, 17 Mar 2017 14:36:14 +0100 Subject: [PATCH] Sketcher: Expose Internal Geometry for BSplines =============================================== New convenience for the user. If the first pole is radius length constraint, then any newly exposed internal geometry is created with equality constraint to the first pole. This is really convenient in the case the user is working with polynomic bsplines, as any operation involving losing/gaining a pole (for example increase in multiplicity of a knot). --- src/Mod/Sketcher/App/SketchObject.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 53f07ed814..296f3aad40 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -3456,15 +3456,19 @@ int SketchObject::exposeInternalGeometry(int GeoId) icon.push_back(newConstr); if(it != controlpointgeoids.begin()) { - // if pole-weight newly created make it equal to first weight by default - /*Sketcher::Constraint *newConstr2 = new Sketcher::Constraint(); - newConstr2->Type = Sketcher::Equal; - newConstr2->First = currentgeoid+incrgeo+1; - newConstr2->FirstPos = Sketcher::none; - newConstr2->Second = controlpointgeoids[0]; - newConstr2->SecondPos = Sketcher::none; + // if pole-weight newly created AND first weight is radius-constrained, + // make it equal to first weight by default + + if(isfirstweightconstrained) { + Sketcher::Constraint *newConstr2 = new Sketcher::Constraint(); + newConstr2->Type = Sketcher::Equal; + newConstr2->First = currentgeoid+incrgeo+1; + newConstr2->FirstPos = Sketcher::none; + newConstr2->Second = controlpointgeoids[0]; + newConstr2->SecondPos = Sketcher::none; - icon.push_back(newConstr2);*/ + icon.push_back(newConstr2); + } } else { controlpointgeoids[0] = currentgeoid+incrgeo+1;