gaiku icon indicating copy to clipboard operation
gaiku copied to clipboard

Duplicate vertex artifact

Open QuantumEntangledAndy opened this issue 4 years ago • 1 comments

mostly copied form the discussion in #34

This is another issue with unnecessarily duplicated vertices which causes this artifact:

Screenshot 2021-01-19 at 18 10 12

There are two verticies at this point:

Screenshot 2021-01-19 at 18 10 32

It seems the deduplication step of the meshing algorithm is not tolerant enough

I think it is caused here, which I was thinking of when I wrote this part:

cx - sx * (1. + EPSILON),
cy - sy * (1. + EPSILON),
cz - sz * (1. + EPSILON),
  • When checking for duplicates sx = 1e-5
  • sx * (1. + EPSILON) = 1e-5*( 1+1e-5) = 1.00001e-05 which is 6sf so it is fine`
  • cx is the coordinate center which could be anything lets say 123.0
  • cx + 1.00001e-05 = 123.0 + 1.00001e-05 = 123.00001 Which is 8 sf too many sf for f32
  • Truncating previous to 6sf we get 123.000 which is equivalent boundary size of 0.
  • Which means if there is any rounding error in the coordinate it won't be treated as duplicate

QuantumEntangledAndy avatar Jan 20 '21 00:01 QuantumEntangledAndy

This artifact happens in amethyst too or just blender?

Also I want to work tomorrow in merging #35, so if you can wait until this PR lands before submitting new ones.

norman784 avatar Jan 20 '21 19:01 norman784