execuc/LCInterlocking

Adding same parts fails due to thickness unequality

Closed this issue · 3 comments

some parts fails to be added as "same parts" with message "partname does not have the same thickness", even when thicknesses are equal in cad. This happens due to strong equality check between floats in append_link method of PartsList (partmat.py). Comparing absolute difference with some reasonable delta value, 0.001 or so, is more reliable here.
for example two parts in attached file, with thicknesses differ by 8.881784197e-16

test1_assy2.zip

thicknesses_unequality.patch.txt

Ok, I fix it using a function defined in other file. Default tolerance is 10e-6 in this function but if issue is still present I will set to 0.001.

as far as i see, issue isn't showing anymore.

Ok, thank you for the fix and the test.