Notifications
Clear all

[Closed] how should i solve this rounding error?

 ulb

hi all,

i have a little problem with a script i’m writing:

I want to test in a scene if objects with the same name have the same geometry, and i choosed to use their vertex count, volume and surface to make the test.

my problem is that for the volume and the surface, copied objects are often tested as different geometries due to rounding errors.

I made a spinner to choose a tolerance for the test, but i’m not satisfied with that option.

So my question is:
Is there anything i should do to avoid those rounding errors or is the spinner the best choice?

thanks in advance

2 Replies

Would the rounding errors be mitigated by using a simpler less manipulated value like say: the distance between vertex00001 and vertex00002? I would imagine a double should be sufficiently accurate, or at least consistant when checking. It should also take up less processor power than doing a full volume calculation. Of course it would be less accurate, but just how accurate does your script really have to be?

Anyway… take this with a grain of salt I’m not a programmer.

1 Reply
 ulb
(@ulb)
Joined: 10 months ago

Posts: 0

thanks for your propositions!

It’s true that the test is quite slow now (smth like 1 seconds to test 1000 boxes on my x2 3800+), but it’s still reasonable in the kind of scenes i’m working on, although i would like it to be a lot faster.
Actually the script has to check multiple pieces that are quite similar, or are almost identical and just a bit longer, so i cant trust only the distance between two verticles, but simplifying the test is certainly the way to go.

I’m still thinking to workarounds to identify similar objects without rounding errors, and if anyone has any idea about that, he’s welcome!