Skip to content

Not collecting failed faces but directly processing them

Ghost User requested to merge fix-nonmanifold-no-collect into master

Problem description:

I encountered severe problems in my application because OpenMesh does not load attributes, such as face texture index, for failed faces (non-manifold geometry). Instead of directly handling them, the Importer class defers the handling of failed faces to a post process - but at that point, the attribute information is not available any more, since it is read and applied in the reader, which only deals with the non-failed faces.

Solution:

My simple solution was to remove the list of failed faces and instead directly handle failed faces inside the "add_face" function of the Importer class.

Discussion:

I didn't see any drawback, compared to the previous code. It would be interesting to know why the list of failed faces was maintained - was this legacy code, or was there some idea to extend this concept, which was just never realized? The only functional point that has changed is that I removed the code that adds degenerate faces to the mesh (line 129), since, in my opinion, this makes things just more complicated for some applications, and the benefit of being able to import degenerate faces seems marginal. But that's a design decision, it will be very easy to encapsulate the code that adds a separate face (line 140) into a separate function and use it also for degenerate faces.

It would be great to receive your feedback on this issue, and to know if it is possible to include this change (or something similar).

Merge request reports