After this PR the `Plane` class inherits from the `PlaneBase` class.
Related issue:
#5603.
Previous PR:
#10766
The following functions have been updated:
`__init__`
* `u` argument can be a WP now.
* Input vectors are copied.
* Added the `weak` argument.
* the `doc` attribute was not used and has been removed.
`__repr__`
* Inherited.
* The `position` is now also shown.
`copy`
* Uses `match` from the parent class which uses the local `_get_prop_list` function. Again vectors are copied.
`offsetToPoint`
* I could not find evidence that this function is used anywhere.
* The `direction` argument did not make a lot of sense (only worked in 2D). It is now ignored.
* Removed the overly long docstring.
* The function now uses an external function: `DraftGeomUtils.distance_to_plane`.
`projectPoint`
* The function calls `super().project_point` which in turn calls `DraftGeomUtils.project_point_on_plane`.
* `from sys import float_info` is no longer required.
`projectPointOld`
* Obsolete and removed.
`align*`
* All align* functions now have an `offset` argument.
* All align* functions return `True` or `False`.
`alignToPointAndAxis`
* The function ignored `upvec` if `axis` was parallel to the global X axis. This meant that the "Set WP" button of the Draft_Wire command did not work properly if the WP was aligned with the Right or Left view.
* The function calls `align_to_point_and_axis` which determines the rotation with `FreeCAD.Rotation(Vector(), upvec, axis, "ZYX")`.
`alignToPointAndAxis_SVG`
* The function calls `super().align_to_point_and_axis_svg` which contains the code from the old function.
`alignToCurve`
* Was not implemented.
`alignToEdges`
* Original code required two parallel edges (for example from an axis system), else the `u` and `v` vectors would not be perpendicular.
* The function calls `super().align_to_edges_vertexes` now.
`alignToFace`
* The function now uses an external function: `DraftGeomUtils.placement_from_face`. The rotation algorithm for the `u` and `v` vectors has been moved there.
`alignTo3Points`
* Basically unchanged. `Part` is already imported at the top of the file.
`alignToSelection`
* Basically unchanged. Will be replaced in the `PlaneGui` class.
Some notes:
Earlier, when adding to the list `connected_to`. the numbers are added in order
from `range(len(groups)`, so we are already in order and every `i_group` is unique.
* 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>
Since Py3.11 the methods names __setstate__ and __getstate__ conflict with the method names added to the object class.
Thus rename them to 'loads' and 'dumps'