0

If I have a default cube, dimensions 1 meter on each side, and I run a script to output the vertex coordinates to the console, they print correctly (i.e., the values are either 0.0 or 1.0). However, if the vertices are at any location other than 1, the values are not exact. If I scale the cube by 1/5 (and apply the scale), the UI shows the vertex coordinates as 0.2. However, outputting the vertex locations to the console produces slightly different values (0.20000000298023224). It is usually not a big deal, but there are times when I need the math to be exact. Any idea what causes this?

I did find a difference in vertex location when converting to/from Imperial units, but the above problem exists both with metric units or no units.

Rick Palo
  • 101
  • 3
  • Related https://blender.stackexchange.com/questions/3168/digits-of-precision-of-vertices-coordinates – batFINGER Dec 19 '18 at 01:26
  • Thanks, that's a good reference. It certainly explains the UI vs. python display difference. I don't think it explains why if I type in an exact value, the python output is still slightly off, unless Blender does some type of internal conversion. – Rick Palo Dec 19 '18 at 13:43

0 Answers0