When specificing three values for rotation FreeCAD is usign euler angles,

See

https://wiki.freecadweb.org/Placement
It describes roughly the several way to specify a rotation:

under Yaw-Pitch and Roll it show this example

Code: Select all

```
App.getDocument("Sans_nom").Cylinder.Placement=App.Placement(App.Vector(0,0,0), App.Rotation(10,20,30), App.Vector(0,0,0))
```

Not said tthe third Vector is the center of rotation, but not everytime is consistent to what you are thinking,

in complicated case, is better to use multiply or even better:

Code: Select all

```
def do_rotate(doc, obj, angx, angy, angz, rotC):
"""Rotate an object using transformation matrix"""
ptn = Vector(rotC.x * -1, rotC.y * -1,rotC.z * -1)
m = obj.Placement.Matrix
m.move(ptn)
m.rotateX(angx)
m.rotateY(angy)
m.rotateZ(angz)
m.move(rotC)
obj.Placement.Matrix = m
```

This code is used somewhere in FreeCAD sources , i don't remember weel where.

It transform the placement in a Matrix and then operate on this matrix using the matrix operations, then reassign the matrix to the object placement.

Internally FreeCAD store the Placement as a Quaternion, so it is relatively easy to convert into and back to a matrix.

Hope it helps

Regards

Carlo D.