This commit is part of a project funded by the Open Toolchain Foundation under the title "Open Toolchain Foundation - Curve drawing tool in Sketcher Workbench"
========================================================
- CriticalMessage old signal is reconverted to new notification system. This enables to remove the obsolete old system.
- An example of how common errors can be provided with translation support is added, so that App notifications appear
translated in the NotificationArea.
Fixes#7770.
Until Point-on-B-spline is actually merged this will result in a malformed
constraint. It will however still allow a trim of the B-spline to result in a
coincident constraint.
=======================================================================
In uncommon situations, the analysis of QR decomposition leads to full rank, but the result does not converge.
We avoid marking a sketch as fully constrained when no convergence is achieved.
Also squashes:
[Sketcher] Make tangent-at-knot with just knot and line
[Sketcher] Disallow tangent at C0 knot
If passed on to planegcs can cause segmentation fault.
[Sketcher] (Re-)Support tangent at B-spline end-knots
New code had introduced problems for non-periodic spline end-points, and
periodic spline "end-points" were not supported anyway.
(here end-points mean star/end points)
It is possible to ask for splitting at an end point of the curve. This leads to
a `CADKernelError` and leaves us with a "hanging" clone. This check prevents that.
===================================
Changes from naked pointers to smart pointers are motivated to the use of functions that can reasonably throw under certain circumnstances (such as trim).
When introducing smart pointers, it is not necessary to explicitly delete the new geometry array at the end of the function.
When using the new facility to add a smart pointer geometry (previous commit), the copies generated in the split algorithm can be reused, which renders
keeping track of the new geometry for memory management unnecessary.
As geometry is added to the property which each call to addGeometry, the stored newIds can be reused if access is necessary to geometry pointers afterwards
(e.g. for constraint management).
================================================================
This new facility avoids to have to create a new copy() when a user copy is already created.
As the user copy is reused via move semantics, memory management is simplified.
CAVEAT: When this facility is used, the client code has to ensure whether a copy() or a clone() of the Part::Geometry
should be undertaken. The different between both is that the former creates a new uuid (tag), whereas the latter does not.
=========================================================================
A migrated parabola cannot be openned with a previous version of FreeCAD. The user is notified upfront.
Algorithm to join b-splines:
The code simple concatenates the knots, poles, weights, and knot multiplicities
together, removing data on the connection point of the second curve. Some
further study is needed to see if/when it will give an exact/good connection.
Icon courtesy @bitacovir.
Fixes issue #7442.
Also, the following commits are squashed into this one:
[Sketcher] Remove unnecessary variables
[Sketcher] Use `setDriving` within `toggleDriving`
Suggestion courtesy @0penbrain.
[Sketcher] Remove redundant check: `SketchObject::testDrivingChange`
`GeoEnum::GeoUndef = -2000` so checking if it's `< 0` is redundant.
======================================================================================
It preserves the SketchObject properties. Therefore it does not trigger any property update, redraws, ...
Apparently B-Spline knot insertion is challenging the sketcher update process
and spurious GUI updates sometimes occur in the intermediate step after the
knot is inserted but before the internal geometries are re-defined. This set of
comments points to a previous fix and related discussion as a suggestion.
When new control points are created in a b-spline in a sketch, do not constrain
their weights to be equal to the first, unless they are already equal. This way
if we have unequal weights to begin with and OCC has computed the appropriate
weights so that the new spline is closer to the original, the weights are not
disturbed.