Page MenuHome

Align to Transform Orientation precision issue
Open, Needs Triage by DeveloperPublic


Blender Version
Broken: 2.8x

Short description of error
Align to Transform Orientation introduces a small error in orientation.

Exact steps for others to reproduce the error

  1. Load the default scene.
  2. Rotate the cube.
  3. Make sure current transform orientation is set to Global.
  4. With the cube selected, go Object -> Transform -> Align to Transform Orientation

In my case, the new orientation of the cube, while close to (0, 0, 0), is actually (0.000001, -0.000002, 0). This, in turn, results in accumulation of small "errors" in coordinates when translating the object along its axes. Running the operator a second time seems to make the orientation (0, 0, 0) though.



Event Timeline

No. That thread talks about inaccuracies that accumulate while editing. These are indeed to be expected. Aligning to orientation is not a temporal operation. It should, if at all possible, match the object's orientation with the desired one, otherwise it's at best a "Try to align". Right now it's just calculated with floats, which contributes to the discrepancy listed in the task description.

If I move the cube around and do slightly different rotations then I get different values than the ones you wrote above. We are talking about the 7th digit in -0.000002, which is around the limit of floating point arithmetics. Note that these are indeed incorrect values but the behavior is expected in the sense that Blender cannot have any higher precision than that because it uses floats to represent real numbers.

Whether we should round such numbers for display is a different issue I think.

What are you talking about? Final orientation is already known and is represented to the precision available. Aligning an object should match that orientation to the same precision, not approximate it. It's not about rounding of final result, at all.