Inconsistent Rotations and Angles
Cakery started this discussion in Bug Reporting
  1. Whenever I use my left or right arrow keys, sometimes, on medium grid, it doesn't fully go to 90 degrees after two turns (rather 89.999999999912 or something like that). It also only happens on models with a large number of pieces and this problem only happens when rotating on the y-axis.

  2. Some of the angled pieces aren't exactly angled as they are named. For example, piece 32192 is suppose to be angled at 135 degrees but in the workshop, the bent angle is marked as 134.9225760415. Is this a part modeling error, or something else?

12 replies · Page 1 of 1
Avatar of Scrubs
Administrator

The first one is due to how computers handle floating numbers. However I am unsure how you get to see it in the object panel as default decimal number is set to 3 which iron any of these tiny inaccuracies.

I am unsure about the second one and I will check when I have a chance as the difference is not negligible. 3D models and snap points are decoupled anyway. They are defined with quaternions not Euler angles.

For the first one, I set the decimal to 10 places.

The second one also happens (albeit in placement); part 6120's only snap joint is noticeably misplaced.

Avatar of Scrubs
Administrator

Keeping 10 decimals is completely irrelevant. It is 0.1pm (picometer) which is a unit used to measure atoms...
More reading about floating point numbers

Is this also related to why, when I save a model with something rotated at 15 degrees and open it later, it props it to 14.9999909544?

Avatar of Scrubs
Administrator

yes.
I also updated point for 32192.

Hello again. Is there a way to round all the pieces in a build to a certain place? I rotated a whole model on a pivot point and when I reset it back later on all the pieces were weirdly misaligned.

Avatar of Scrubs
Administrator

Please provide a process to reproduce or even better, as short video of your screen when the issue occur.

Will images count? (computer does not support screen recording)

"The first one is due to how computers handle floating numbers. However I am unsure how you get to see it in the object panel as default decimal number is set to 3 which iron any of these tiny inaccuracies."

The object panel only rounds the precise location of the brick to the decimal places (the Precision); it doesn't actually round the position of the brick to that number. For example, if I place a brick on (4, 1.6479054248, 6) and set the precision to 3, the panel reads (4.000, 1.648, 6.000) even though the position of the brick is very much not at (4, 1.648, 6). If I set the precision back to 10, the display reads (4.0000000000, 1.6479054248, 6.0000000000).

However, if I set the precision back to 3 (to where the panel would read (4.000, 1.648, 6.000) again) and hit "Apply", the coordinates of the brick is set to exactly (4, 1.648, 6), and if I set the precision to 10, the panel would read (4.0000000000, 1.6480000000, 6.0000000000), the new position of the brick.

The above applies to angles as well.

"This means that floating point numbers have between 6 and 7 digits of precision, regardless of exponent." Is this what you're referring to as well?

Avatar of Scrubs
Administrator

Yes, this is how the Transform panel works. It rounds the value read from the object. When you apply, it applies the values from the fields (rounded values).

Javascript encodes numbers as double precision floating point numbers. The more operations you do with a decimal number, the bigger the error at the end. Try to paste this in your browser console:
0.3 + 0.6
Result 0.8999999999999999

2 * 0.3 + 2 * 0.6
Result: 1.7999999999999998

👍

On another note, may you adjust the rotation for part 24116? When you spawn it, the base is not perfectly parallel to the axes.

Advertising
2 participants
Avatar of Cakery
Avatar of Scrubs

LEGO, the LEGO logo, the Minifigure, and the Brick and Knob configurations are trademarks of the LEGO Group of Companies. ©2024 The LEGO Group.

Mecabricks, the Mecabricks logo and all content not covered by The LEGO Group's copyright is, unless otherwise stated, ©2011-2024 Mecabricks.