[Bf-python] comparing 2 floating point values

Campbell Barton cbarton at metavr.com
Thu Apr 29 01:27:42 CEST 2004


Hi

I was working on a script that bakes Radiosity back into a texture.
In theory it all should work but an Issue I have is that when I copy the 
UV co-ords back onto the rediosity mesh I need to rely on the vert 
positions being the same.

Now somhow when radiosity is baked the vert positionos move a tine bit.

(I know the center or the object is moved when red is baked but I have 
accounted for that and the problem still persists)

Anyway the locations of the verts are the same within the first 6 
decimal places, I was wondering if there is a way to compare 2 floats 
ignoring the last 9 floating point values (without using any time 
consuming str(float)[0:-9]  )

 -Cam



More information about the Bf-python mailing list