The python interface does what I expect
Code: Select all
>>> obj.Placement.Rotation.Axis = App.Vector(1,1,1)
>>> obj.Placement.Rotation.RawAxis
Vector (1.0, 1.0, 1.0)
>>> obj.Placement.Rotation.Axis
Vector (0.5773502691896258, 0.5773502691896258, 0.5773502691896258)
>>> obj.Placement.Rotation.Axis.x =2
>>> obj.Placement.Rotation.Axis
Vector (0.9258200997725515, 0.26726124191242445, 0.26726124191242445)
>>> obj.Placement.Rotation.RawAxis
Vector (2.0, 0.5773502691896258, 0.5773502691896258)
>>>
When I execute
obj.Placement.Rotation.Axis.x =2, it first does exactly that, setting its x-component to 2, becoming Vector (2.0, 0.5773502691896258, 0.5773502691896258).
But, Axis is stored normalized, so it becomes Vector (0.9258200997725515, 0.26726124191242445, 0.26726124191242445), leaving the intermediate unnormalized value in RawAxis.
If I make successive changes of Axis.x, Axis.y and Axis.z, I'll obviously get a different result than from setting them simultaneously with
Code: Select all
obj.Placement.Rotation.Axis = App.Vector( x, y, z)
because of the intermediate normalizations.
However, there
IS a problem with expressions. If I use expressions to set Axis.x, Axis.y, Axis.z separately, the Placement.Axis and the Axis components get out of sync, as has already been noted. It's a related issue, in that if, I set the rotation Axis by expression, not component-wise it works fine.
Note that if I change Axis.x etc. in the Properties window (not by expression) , it behaves properly - but what is displayed and modified is the RawAxis. So maybe the problem is that the expressions are driving Axis not RawAxis.
- Screen Shot 2022-12-07 at 2.24.44 PM.png (38.71 KiB) Viewed 750 times