As a consequence :
Remove message box when several arcs/circles are selected ...
... and enforce creation of equality constraints in this case
Former existing option of adding a dimensional constraint ...
... to each circle encouraged improper constraining
============================================================================================
On creation of a constraint from the UI (toolbar/menu):
1. if a PointOnObject constraint preexisted the addition of an
edge-to-edge tangency, substitute it with a point-to-edge tangency.
2. if an edge-to-edge tangency preexisted, addition of a PointOnObject
results in a substitution of the edge-to-edge tangency with an edge-to-curve
tangency.
Bonus:
- Refactor of this with preexisting coincident+tangent substitution.
- Activate both substitutions in continuous constraint addition mode.
==============================================================
Previously construction points was used to code bspline knots.
Now construction points are normal sketcher points, which can be
made defining.
This commit renames and adapts the checks for fixed geometry.
fixes:
https://forum.freecadweb.org/posting.php?mode=quote&f=3&p=461472#pr461472
- add missing class to UI file (found and automatically added by Qt Designer)
- add more sensible stepsize - you are dealing in practice with rations in the range 1.2 - 1.6 thus a stepsize of 1.0 is not helpful
======================================================================
Most of these crashes come from previous code not checking for Constraint::GeoUndef.
Most of these crashes come from isBSpline(), any of the two overloads.
isBSpline is made to throw exception when null, which should prevent the crash while
creating a reportable error.
=============================================================================================
This commits removes the Geometry construction data member and adapts sketcher code to use
GeometryFacade to access construction information via the SketchGeometryExtension.
========================================================================
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.
Fixes#0004478: Active constraint tool blocks sidebar tasks from working.
Many commands are interrupted by the existence of a handler. Rather than having these commands silently cancel, purge the handler if a command executes that does not need it.
When right-clicking on an item in the Constraint Task sidebar, any current operation is cancelled and the FreeCAD selection is synced with the selected items in the constraints QListWidget. This allows all of the menu items in the context menu to function properly: if the selection is not synced, anything that relies on the FreeCAD selection (like Delete) will sillently fail.
The reason for this behaviour is that root point (origin) and axes are not treated as fixed geometry. Every external geometry has negative ID which is at most GeoEnum::RefExt defined as -3 in the file src/Mod/Sketcher/App/SketchObject.cpp. Ids of root point and axes are also defined in this file with id -1 for root point and horizontal axis, and -2 for vertical axis. To fix the problem, GeoEnum::RefExt id was replaced by root point id in the condition checking for the largest id of fixed geometry.
`Sketcher_ConstrainBlock` to `Constraint_Block`.
`Sketcher_ConstrainLock` to `Constraint_Lock`, and the corresponding
`_Driven` variant.
Adjust the icons in the taskpanel for the sketcher constraints,
elements, and for the action menu for constraints.
Adjust the icon order in the `Sketcher.qrc` resource file.
====================================================
fixes#4105
When a constraint substitution is present, a solve must precede any call to the redundant removal to update the solver information.
=======================================================
When adding a reference constraint of type radius or diameter to an external geometry using the method of select the
continuous mode method (select tool first, click geometry afterwards), with ActiveUpdate checked, there was a missing
solving to bring the solver information in line with the Driven constraint.
fixes#4054
+ remove unneeded class members from EditData class
+ do not include ui-header from within header files
+ fix possible memory leak in EditDatumDialog
+ when canceling dialog make sure sketch will be updated
This integrates the ability to manage dimensional constraint driving/driven status
in the constraint edition dialog box.
It adds a checkbox in the dialog to show/select whether a constraint is driving or
driven. When the constraint value is modified, it is automatically set as driving.
Main focus is to allow to edit name (alias) of reference (driven) constraints
directly in the constraint edition box.
Resolves#3793, #3978