(Matrix image courtesy of mavaddat.)
In now-merged PR 8603 new FreeCAD contributor Daniel-Khodabakhsh developed a new set of matrix-construction convenience functions that are provide a much nicer API than the original matrix creation methods.
The following functions were added which are shorthand for the
|New function||Object type||Analog|
The following matrix functions were also added. These functions are following the same pattern previously established by the existing
|Rotate given object.|
|Rotate given object around the X‑axis.|
|Rotate given object around the Y‑axis.|
|Rotate given object around the Z‑axis.|
|Translate given object (|
These functions return the same type of object which was supplied with the exception of
The functions can be chained together like so:
=mtranslate(mrotatex(placement(vector(1; 2; 3); rotation(0; 0; 0)); 45); 1; 2; 3)
Thanks to Daniel-Khodabakhsh for this valuable contribution to FreeCAD’s Expression API.
2 responses to “New Matrix Functions”
This seems to be for expressions, not Python.
Yes indeed! Thanks!