Spyke
blender·BlenderbyLuccus

Blender .obj-export precision

I am currently creating some meshes that are then exported as OBJs. I am really only interested in the vertex positions and normals, as everything else will be done with shaders. But I keep coming across… well, not really a issue.

Some exported vertex positions deviate from their in-editor position by literally a micrometer. Again, I know that this is basically irrelevant. Perhaps, if I were to compress the files, I might have a few kilobytes more data than actually necessary.

…but I keep seeing this and it annoys me for no practical reason. Does anyone know if there is a "fix" for this behavior?

View original on feddit.org

This looks a lot like floating point errors. There's probably some math involved in exporting that causes these slight inaccuracies.

It probably isn't too hard to write a short python script to go over the exported file, and round those values.

9

The precision is default afaik, and necessary for accuracy when dealing with objects far from origin. The noise you see though is due to floating point precision which is a thing with numbers on computers. This is common to all 3d software. https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html

If you know your tolerances are much less and disk space is a concern you could post process this data in the file as text, but I wouldn’t bother.

5

For 32-bit float 6 decimal digital are precise in representation, beyond that expect to have rounding errors.

I don’t see if blender ever has 64-bit support but there were rejected requests.

3

You reached the end

Blender .obj-export precision | Spyke