zeux / meshoptimizer

Mesh optimization library that makes meshes smaller and faster to render
MIT License
5.49k stars 473 forks source link

Simplification produces reversed faces #698

Closed roenyroeny closed 3 months ago

roenyroeny commented 3 months ago

Simplifying this mesh produces output with 1 face reversed. input wireframe: image output wireframe: image output with backface culling showing 1 reversed face: image

Here is the input mesh, and a small repro to make sure the settings for the simplifier are just right.

The repro outputs a reduced.obj which should contains the rogue reversed face. It should also output the following:

face 27 [18 14 16] is flipped
zeux commented 3 months ago

Duplicate of #346

zeux commented 3 months ago

P.S. Pretty sure it's a duplicate of the issue I linked (same symptom, can be resolved by changing threshold in hasTriangleFlips from 0 to 1e-9 - not a generally correct fix but still), but it's the best repro out of that entire issue by far in terms of being easy to investigate :) Thanks for preparing that!