Support for creation of Rotation from matrices which is a combination of non uniform scale and a rotation
Fixes according to review
Scale -1 is Uniform, Not NoScaling
Fix hasScale() when negative scale
* Add Placement::isSame() and expose to Python
* Add Placement::multRight/Placement::multLeft
* Fix PlacementPy::rotate
* Add Rotation::multRight/Rotation::multLeft
* Add a test feature FeatureTestPlacement for uni tests
* Add unit tests
+ fix issues found by clang's clazy tool
+ fix cppcoreguidelines-pro-type-member-init
* Make sure that all class members are initialized in the constructor
Exposed to Python as new constructor parameters and
Rotation.toEulerAngles()
This function uses the code from OCCT
gp_Quaternion::Get/SetEulerAngles() to support all 24 possible
generalized euler rotation sequences. Call Rotation.toEulerAngles()
without argument to obtain all possible sequence types.
Convenience macros/function (in Interpreter.h)
* FC_PY_GetObject/Callable(), look for callables in a python object,
which will be used in future patch to improve performance in various
python observer/features.
* pyCall(WithKeywords)(), helper function to invoke the callable
Matrix4D:
* hasScale(), check if there is any scale in the transformation. If so,
further check if the scale is uniform or not. This will be used in
future patch for Part::TopoShape to decide which type of transform to
apply.
Placement:
* translate/rotate(), new convenience API
Rotation:
* isSame/multiVec(), new convenience API
Polygon2d:
* Intersect(), GetCenter(), new convenience API.
FlagToggler:
* New class for exception safe flag toggling, similar to StateLocker
but with template (actually, FlagToggler is added earlier by me).
BitsetLocker:
* New class for exception manipulation of a std::bitset variable.
Rotation:
- Add a private attribute Vector to store the direction of the rotation, and manage not to erase this direction when the angle id 0.
- Add a private attribute to store the angle as defined (no modulo etc)
- Keep the quaternion for calculations
PropertyGeo
- Saves the rotation with angle and direction instead of saving the quaternion.
- Attribute name chosen: Ox, Oy and Oz for the coordinates of the axis and A for the angle in radians. This has to be validated.
- Backward compatibility with the saved files with quaternion (test presence of A to determine which of the Quaternion (old way) or the direction and angle is stored (new way). New files can be opened by old FreeCAD and vice-versa.
The only side effect I can imagine is that it was possible to set a vector to 0, 0, 0 if the angle was not 0, what is somehow non sense. Now when setting to 0, 0 0 the last not null vector is kept. The vector can not be null any longer.
The new constructor accepts wanted directions of x,y,z axes of rotated
frame, and a priority string that affects how the vectors are made
perpendicular to each other.
Example - construct placement for sketch on XZ plane:
v = App.Vector
App.Rotation(v(1,0,0),v(0,0,1),v())