dxf-viewer icon indicating copy to clipboard operation
dxf-viewer copied to clipboard

Add missing indices when decomposing faces

Open MPanknin opened this issue 2 years ago • 3 comments

Hi again,

we would like to suggest a small change in the decomposition of faces. In some dxf files we experienced minor rendering artifacts because the surfaces were not closed properly.

UI Before: before

After: after

Thx

MPanknin avatar Jul 11 '23 10:07 MPanknin

Hi, This fix does not look valid. What you do is adding third triangle, so ending up with three overlapping triangles (you can check resulting topology with sceneOptions.wireframeMesh option set to true). Instead it should be investigated, how to ensure proper quad decomposition into two triangles. I have already faced similar problems and tried to modify decomposition algorithm to cover all cases, but seems it is still not robust enough for a wild files. DXF does not specify vertices order of a quad, seems it may be completely arbitrary. It would be nice to have a sample file to properly fix this issue.

vagran avatar Jul 11 '23 10:07 vagran

We did not check the resulting mesh topology, to be honest, because this solution simply works in our use case.

It would be nice to have a sample file to properly fix this issue.

I will see if I can find one that exhibits this behavior if that would help?

MPanknin avatar Jul 12 '23 07:07 MPanknin

I will see if I can find one that exhibits this behavior if that would help?

Yes, that will definitely help to find proper solution.

vagran avatar Jul 12 '23 07:07 vagran