The following commits were squashed into this
[Sketcher] Handle some corner cases in AngleViaPoint
[Sketcher] Avoid redundant constraints with B-splines...
When involving tangent, perpendicular and angle constraints.
[Sketcher] Add pre-commit changes
[Sketcher] Do not allow 2-selection tangent with B-spline
Also...
[Sketcher] Report error when using direct tangency with B-splines
[Sketcher] Fix malformed constraint when B-spline is selected second
To clarify, this means the second curve selected. The position of the point in
selection order does not matter in angle-via-point.
[Sketcher] Fix wrong number for B-Spline tangent on redundancy
[Sketcher] Remove existing point-on-object in some redundant cases
Particularly when point constrained on a B-spline is being used for
tangent, perpendicular or angle via point with the same B-spline.
[Sketcher] Fix direction issue with B-spline tangents.
Without these changes the solver might try to "twist" the B-spline to make the
angle between curves be 0 instead of PI (which may be closer to the initial shape).
* fix 10742
* moved expression string modifier to helper function
* Tests: Add example tests for SketchObject
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* made expr modifier func static, pass by value and added unit tests
---------
Co-authored-by: Chris Hennes <chennes@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Needs changes in TopoShape and creation of ExternalGeometryFacade.
Also contains the squashed ticket:
[Sketcher] Hide unimplemented code
These will eventually be implemented in phase 3 of toponaming.
[Sketcher] Implement trivial `checkSubName` to appease Windows
[Sketcher] Modify `GeoEnum` usage
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, ...