I am trying to implement an algorithm to remove an edge and a vertex from a half edge structure. See the attached image for an illustration:
I know there's libraries like Openmesh and CGAL etc that can help me achieve this but I plan to implement it myself.
My original idea is as follows:
1. Find out the half edges associated with that edge
2. Find out all the faces associated with each half edge
3. Find out all the edges and vertices corresponds to each face
4. Not sure how to merge them together ie how to merge edge 1 edge 2, vertex 4 and 2 and edge 5 and 4 in the attached graph.
5. Delete all the faces.
6. Delete all the half edges
Can someone please give some suggestion if I am on the right track?
I also did some research online and found an article online that seems to be helpful.
Here's the link: http://kaba.hilvi.org/homepage/blog/halfedge/halfedge.htm
Under the Removing an edge section it lists the following steps:
1.Remove all of the polygons connected to the edge.
2.Link the half-edges of the edge off from the mesh.
3.Deallocate the edge and its half-edges.
The first and last ones make sense to me. However, I am not sure what the author mean by link the half-edges of the edge off from the mesh? Can someone please explain this to me? Thanks!
Noun. half-edge (plural half-edges) (graph theory) An edge that is attached to only one node, rather than connecting two of them, or is connected in only one direction.
In computer graphics, the winged edge data structure is a way to represent polygon meshes in computer memory. It is a type of boundary representation and describes both the geometry and topology of a model. Three types of records are used: vertex records, edge records, and face records.
It typically consists of an ordered array of vertices, and a list of faces. Each face is a list of the indices of the vertices that form its boundary. In this data structure, edges are implicit in the sequence of verts around the face. One of the largest advantages of this data structure is how easy it is to populate.
I will take this question to mean "How to implement edge collapse".
The algorithm itself is not that complicated once you have a working half edge DS.
next
of the selected half edge and the pair (to avoid creating invalid pointers)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With