bevy_mod_outline icon indicating copy to clipboard operation
bevy_mod_outline copied to clipboard

Would generate outline normals differently works for non-manifold meshes?

Open thmxv opened this issue 6 months ago • 4 comments

I am using this plugin to outline the selected objects in an editor like application. One of the issue I have is with non-manifold meshes (meshes where all the edges are not part of exactly 2 faces). I saw a related issue regarding "flat" meshes for which I assume the issue is the same, and I am not concerned with the case where edges are part of more than 2 faces. The "solutions" I saw were to add "dummy/degenerate" triangles to force the calculation of "outline normals" to produce different normals. But this would not work for me (or at least I do not think so).

My question is the following:

If I implement a function that does more of less the same thing as generate_outline_normals (at a bigger performance cost) but that generate normals pointing "outwards" for vertices that are part of the non-manifold edges. By "outward", I mean perpendicular to the edge, but tangent to the face (instead of normal) but pointing in the opposite direction of the face. And averaging those normals, for vertices that are part of more than one edge. Would this work without having to modify the mesh?

thmxv avatar Aug 29 '24 17:08 thmxv