You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here I go again 😏,I've been looking at the SurfaceMeshSimplification Code recently.There are a few things I don't understand.
First, the purpose of the function "remove_edge"
Let's say the original graph looks like this, and we want to remove the h=1 halfedge
so, hn = 5, hp=7, o=0, on=2, op=4,vh=V1, vo = V2,
What I don't understand is what do these two lines of code mean
On line 911, why is the next halfedge of hp=7 set to hn=5?there is an halfedge h=1 in the middle. 😟
On line 912, the next halfedge of op=4 is o=0, why is it be set to on=2 on line 912? 😟
Second, in the function "collect_garbage"
Why update halfedge of the information with a hash table,I really don't know the reason 😟
Third, it's still in this function "collect_garbage", the vertices, the edges, the faces
why are we finding the first deleted and last un-deleted, and swap them 😟
The text was updated successfully, but these errors were encountered:
I found it would take much time to explain the details. So very brief answers at a higher level below:
(1) How edge collapse works in Easy3d: we move its start vertex into its target vertex. For non-boundary halfedges this function removes one vertex, three edges, and two faces. For boundary halfedges it removes one vertex, two edges and one face. This function is only valid for triangle meshes.
(2) Those are not hash tables but simply per-element properties. We want to keep the original information after the elements are re-ordered, and this information will be used to rebuild the topology.
(3) You should first know that deleting an element (not at the end) from an array is expensive because you will have to move all elements following the deleted one or rebuild the entire array. The most efficient way is to organize all elements you want to keep at the first part of the array and all elements to be deleted at the second part of the array. The reorganization of the elements can be done by the swap. "finding the first deleted and last un-deleted, and swap them" is to ensure the elements are organized in such as way. For example, if you want to delete B from the array of "AABABAAAA", try the swap operation on this string :-).
Halfedge collapses might lead to invalid faces. Call is_collapse_ok(Halfedge) to be sure the collapse is legal.
The removed items are only marked as deleted. You have to call collect_garbage() to finally remove them.
Here I go again 😏,I've been looking at the SurfaceMeshSimplification Code recently.There are a few things I don't understand.
First, the purpose of the function "remove_edge"
Let's say the original graph looks like this, and we want to remove the h=1 halfedge
so, hn = 5, hp=7, o=0, on=2, op=4,vh=V1, vo = V2,
What I don't understand is what do these two lines of code mean
On line 911, why is the next halfedge of hp=7 set to hn=5?there is an halfedge h=1 in the middle. 😟
On line 912, the next halfedge of op=4 is o=0, why is it be set to on=2 on line 912? 😟
Second, in the function "collect_garbage"
Why update halfedge of the information with a hash table,I really don't know the reason 😟
Third, it's still in this function "collect_garbage", the vertices, the edges, the faces
why are we finding the first deleted and last un-deleted, and swap them 😟
The text was updated successfully, but these errors were encountered: