geometry-central icon indicating copy to clipboard operation
geometry-central copied to clipboard

collapseEdgeTriangular loses halfedge data

Open lfyMeta opened this issue 3 years ago • 1 comments

When we edge collapse, we also remove the degenerate face(s) incident to the edge, which results in removing further edge(s):

 |        x           |
edge degenerate-face edge

 |        x           +
edge degenerate-face deleted-edge

This destroys halfedge data that we still need in the neighborhood post collapse:

 he1 | he2        x            he3 | he4
    edge      degenerate-face     edge

 he1 | he2        x            -- | --
    edge      degenerate-face    deleted-edge

 he1 |  he2 (lost he4!)
    edge (after)

he2 and he3 become completely unnecessary post collapse, but we've lost he4, which disrupts invariants the user may have wanted to maintain, such as parameterization boundaries (e.g., if he1 and he4 were on opposite sides of a UV boundary).

Although we'd like to do so, we cannot directly perform

 he1 | --         x             -- | he4
    edge      degenerate-face     edge

because this violates the implicit sibling property of manifold meshes (a part of which seems to assume that abs(he - he.twin) = 1).

Also, the data may be stored in parallel structures outside this mesh object.

lfyMeta avatar Nov 28 '22 21:11 lfyMeta

See https://github.com/nmwsharp/geometry-central/pull/135 for a potential solution, where we provide a callback for the user to fix up their own containers depending on which halfedges are lost.

lfyMeta avatar Nov 28 '22 21:11 lfyMeta