Align to Transform Orientation precision issue #71438

Closed
opened 2019-11-09 07:55:07 +01:00 by Stanislav Blinov · 12 comments

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.

**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.

Added subscriber: @Stan_Pancakes

Added subscriber: @Stan_Pancakes
Member

Added subscriber: @zazizizou

Added subscriber: @zazizizou
Member
This inaccuracy is expected, see https://devtalk.blender.org/t/inaccuracy-of-values-in-transform/2655/4

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.

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.
Member

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.

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.

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.

Added subscriber: @Lambdadelta

Added subscriber: @Lambdadelta

Interestingly, that bpy.ops.transform.transform() operator has "Accurate" parameter (use_accurate), that is set by default to False.
But toggling in on have no effect on align precision. Does anyone know why it there?

Interestingly, that `bpy.ops.transform.transform()` operator has "Accurate" parameter (use_accurate), that is set by default to False. But toggling in on have no effect on align precision. Does anyone know why it there?
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

Changed status from 'Needs Triage' to: 'Archived'

Changed status from 'Needs Triage' to: 'Archived'
Jacques Lucke self-assigned this 2020-01-08 17:33:10 +01:00
Member

While in this special case, the exact target orientation is known, the code that computes this has to deal with more complex situations. E.g. when the object is parented to some other rotated object. Then when aligning it to world coordinates is more difficult than just copying the values over.
Blender could have a special case for the case you describe, but I think it is fine if it does not have it. Therefore, do not consider this to be a bug. It is working as expected with an error smaller than the machine precision.

While in this special case, the exact target orientation is known, the code that computes this has to deal with more complex situations. E.g. when the object is parented to some other rotated object. Then when aligning it to world coordinates is more difficult than just copying the values over. Blender could have a special case for the case you describe, but I think it is fine if it does not have it. Therefore, do not consider this to be a bug. It is working as expected with an error smaller than the machine precision.

"Special" case would be the parented one. Trivial case should be indistinguishable from copy-pasting the orientation.

"Special" case would be the parented one. Trivial case should be indistinguishable from copy-pasting the orientation.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#71438
No description provided.