David Williams wrote:
Ah, so you would expect the provided value to be a maximum error, such that a value of 1.0 would allow more collapses than a value of 0.0f. This does make some sense, but actually the value is treated as a threshold such that if two surfaces can collapse then they must have similar normals and hence a high dot product.
Sorry, what I mean is... since a normal triangle and a collapsed triangle on a cubic mesh should have the same normal, I would expect a lower threshold value to allow for more floating point error as the angle between the vectors increases.
I am guessing it was floating point error allowing the corner to incorrectly collapse.... so I was confused as to why increasing the value prevented the collapse.
But now that I think about it, it was the width of the error margin that allowed the invalid collapse in the first place, right? Since the dot product resulting from the normal comparison in Will's example case would be quite close to 1.0.... so that is why it only occurs on an straight voxel edge length of 28 or more, and raising the threshold value appears to fix it.....
I am not really sure what the best way would be to account for floating point error while simultaneously preventing invalid collapses when the normals are similar such as in Will's case. Probably as you said, a separate function for cubic meshes.