* Add new method ExportOCAF::exportObjects() to avoid code duplication
* Simplify handling of arguments passed to Python handler
* Fix several lint warnings
* Move ImportOCAFExt to the corresponding source files
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>
Rework of the material handling system.
This first part concntrates on a rework of the material cards.
Rather than use a fixed list of possible properties, properties can
be defined separately in their own files and mixed to provide a
complete list of possible properties. Properties can be inherited.
The cards then provide values for the properties. These can also
be inherited allowing for small changes in cards as required.
The new property definitions are more extensive than previously.
2 and 3 dimensional arrays of properties can be defined. Values
are obtained by calling an API instead of reading from a dictionary.
For compatibility, a Python dictionary of values can be obtained
similar to how it was done previously, but this is considered a
deprecated API and won't support the newer advanced features.
The editor is completely reworked. It will be able to edit older format
material cards, but can only save them in the new format.
For testing during the development phase, a system preference can
specifiy wether the old or new material editors are to be used. This
option will be removed before release.
Rework of the material handling system.
This first part concntrates on a rework of the material cards.
Rather than use a fixed list of possible properties, properties can
be defined separately in their own files and mixed to provide a
complete list of possible properties. Properties can be inherited.
The cards then provide values for the properties. These can also
be inherited allowing for small changes in cards as required.
The new property definitions are more extensive than previously.
2 and 3 dimensional arrays of properties can be defined. Values
are obtained by calling an API instead of reading from a dictionary.
For compatibility, a Python dictionary of values can be obtained
similar to how it was done previously, but this is considered a
deprecated API and won't support the newer advanced features.
The editor is completely reworked. It will be able to edit older format
material cards, but can only save them in the new format.
For testing during the development phase, a system preference can
specifiy wether the old or new material editors are to be used. This
option will be removed before release.