10

I am trying to implement a mesh simplification algorithm by doing a series of edge collapses. Currently, I am going through each triangle and then collapsing the shortest edge and the algorithm is stable(doesn't go out of bounds). But beyond a point, it starts to create broken(holes) artifacts. What is the correct way to determine whether an edge is collapsible or not so that it doesn't lead to non-manifold artifacts(or mesh)?

NOTE: I use a half-edge data structure. Also, I do not want to use any external libraries like OpenMesh or CGAL. I have my reasons for not using them.

JumpingJezza
  • 5,498
  • 11
  • 67
  • 106
jaykumarark
  • 2,359
  • 6
  • 35
  • 53
  • By collapsing the edge, you mean that you are combining the two vertices that make the edge into one vertex, correct? – Tim Seguine Nov 20 '14 at 20:48
  • 1
    Yep you are right. And any edge that is dependent on the end points of the collapsed edge is also modified to point to the new vertex. – jaykumarark Nov 20 '14 at 20:51

1 Answers1

39

There are two main conditions for an edge collapse:

Connectivity

On each side of the collapsed edge, only one pair of edges must be merged. This can be checked by counting the joint neighbour vertices of the two merging vertices (there must be exactly two). Consider the following example where the red edge is being collapsed:

Invalid Edge collapse

The triangle between the orange and cyan edge is not manifold anymore.

Geometry

Triangles must not flip during the edge collapse. This can be checked by calculating the angle between the triangle normal before the flip and after the flip for triangles that are kept.

Here is an example where the normal of the green triangle is flipped during the collapse:

Normal Flip

Nico Schertler
  • 32,049
  • 4
  • 39
  • 70
  • I didn't understand the connectivity. The idea kind of eludes me. Can you please put it a different way. Although, I understand the geometry part. I see that this is important because we wouldn't want the triangles to intersect or flip inwards. – jaykumarark Nov 20 '14 at 21:08
  • Thanks for taking the pain to illustrate. If I understand it right, here, there are four edges above the red edge which share the end points of it. So collapsing it would create a non-manifold. Ideally, if it were only the two oranges edges on top and two black edge below, then removing red is valid. is this right? – jaykumarark Nov 20 '14 at 21:52
  • But checking for this condition is still unclear for me. I maintain a list of incident edges for each vertex. You mentioned something like "counting the joint neighbor vertices of the two merging vertices". I didn't get this part. – jaykumarark Nov 21 '14 at 07:42
  • 7
    The collapsing edge has two incident vertices. For both vertices, gather the adjacent vertices and calculate the intersection of both sets. This intersection should contain exactly two vertices. – Nico Schertler Nov 21 '14 at 07:58
  • This makes a lot of sense now. Thanks for the explanations and illustrations. I helped a lot. – jaykumarark Nov 22 '14 at 21:25
  • 1
    Does anyone know of (a reference for) a proof of this criterion? The forward case is obvious: if there are more than two mutual neighbors it's easy to show that the result is non-manifold. But I'm curious about proving the other direction, if the result would be non-manifold there must have been more than two mutual neighbors. (Also, there's the prickly issue of a special case if the input mesh is a solitary tetrahedron: this criterion holds but the result changes topology: sphere to disk). – Alec Jacobson May 11 '15 at 18:16
  • I don't quite understand why checking for a triangle flip is necessary. Could you provide an example? – sonofrage Sep 06 '15 at 22:46
  • 1
    @sonofrage I have added another visualization for this case. – Nico Schertler Sep 07 '15 at 06:37
  • Ok, I suppose you're only considering a 2D case. For a 3D mesh though, I think it is still possible to have a valid mesh eventhough the triangle is flipped about its normal. – sonofrage Sep 11 '15 at 04:42