It seems that duplicate vertices with coordinate differences very close to Python floating point tolerance can cause the normal calculation to go haywire. I am changing the normal calculation to ignore any vertices that are closer than a value that's a bit larger than floating point tolerance (1e-9) rather than using a ZeroDivisionError indicating a perfectly duplicate vertex.
I also realized that the remove_colinear_vertices method can accidentally remove both versions of a duplicate vertex, which is usually not the desired behavior as we want to leave one of them. I'm tweaking the method so that it corrects itself whenever it has already removed colinear vertices.
It seems that duplicate vertices with coordinate differences very close to Python floating point tolerance can cause the normal calculation to go haywire. I am changing the normal calculation to ignore any vertices that are closer than a value that's a bit larger than floating point tolerance (1e-9) rather than using a ZeroDivisionError indicating a perfectly duplicate vertex.
I also realized that the remove_colinear_vertices method can accidentally remove both versions of a duplicate vertex, which is usually not the desired behavior as we want to leave one of them. I'm tweaking the method so that it corrects itself whenever it has already removed colinear vertices.