I'm writing an add-on that imports vertex locations and builds a BMesh by placing vertices at those locations. I'm running into precision issues, since the imported data can be large floating point values with several digits after the decimal point.
The image below shows the values imported and the locations of the vertices as stored in the BMesh:
So I know the problem (floating point precision) but I need to know how best to handle it.
My add-on currently creates the mesh with the vertices stored using the values imported from the data, then shifts all the verts to place the mesh close to the center of the scene. It also, optionally, scales the mesh down if it's particularly enormous.
But it appears that I can't do it this way, as I can't store the verts with the required precision.
How can I build a mesh that represents the vertices with the required precision?