FreeCAD: master 95c1a262

Author Committer Branch Timestamp Parent
abdullah abdullahtahiriyo master 2020-11-25 13:27:27 master 8080e8df
Changeset Sketcher: Unit independent pole weight for B-Splines (Weight constraint)

========================================================================

Until now BSpline poles were circles relying on physical length units. This lead to several
problems:
- While the BSpline weight follows the circle size, weights do not have length units, but are adimensinal
- As representation of the BSpline depends on the physical size of the circle, the numerical value to be
  set to a pole circle differs from the numerical value of the weight.

The present commit:
1. Separates pole circle representation (physical size), from the numerical value used in the radius constraint,
so that the value in the constraint is the weight, the value representation is a factor of the weight value (in this
commit is getScaleFactor(), but this will change in the next commit). Dragging accounts for this scale factor too.
2. While Radius constraint button is used to constraint a B-Spline weight as before, this creates a Weight constraint,
which is a new type of constraint. This is done so that the value is truly adimensional and is so presented in all kind
of editors that rely on the units indicated by the constraint. It is obviously also shown as adimensional (thus without units),
in the 3D view and in the datum dialogs.
3. Because the circle of the pole of a B-Spline is not a geometric circle, but a graphical representation of the pole and how
it affects the corresponding B-Spline, constraint creation commands are limited so that no point on object, tangent, perpendicular
or SnellLaw constraints can be created on a B-Spline weight circle. This is also the case for the Diameter constraint, which won't
accept the circle. Equality constraints work either on only circles or only weights, but not on a mixture of them.

Bonus: This commit fixes a bug in master, that using the select equality constraint then click in two geometric elements mode, you
could make a circle equal to an ellipse resulting in malformed solver constraints.
mod - src/Mod/Sketcher/App/Constraint.cpp Diff File
mod - src/Mod/Sketcher/App/Constraint.h Diff File
mod - src/Mod/Sketcher/App/ConstraintPyImp.cpp Diff File
mod - src/Mod/Sketcher/App/Sketch.cpp Diff File
mod - src/Mod/Sketcher/App/SketchObject.cpp Diff File
mod - src/Mod/Sketcher/Gui/CommandConstraints.cpp Diff File
mod - src/Mod/Sketcher/Gui/CommandConstraints.h Diff File
mod - src/Mod/Sketcher/Gui/CommandCreateGeo.cpp Diff File
mod - src/Mod/Sketcher/Gui/EditDatumDialog.cpp Diff File
mod - src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp Diff File
mod - src/Mod/Sketcher/Gui/ViewProviderSketch.cpp Diff File