How to do Edge collapse on surface mesh using user defined cost value?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to do Edge collapse on surface mesh using user defined cost value?

Shrabani Ghosh
Hi,

I'm coding mesh simplification using edge collapse method with two different cost functions

The GetCost function calculates the cost of collapsing an edge.  I want to assign a user-defined cost value so that some edges will not collapse.  

Or if there is any other way to keep some edges untouched during the simplification process.

Please advise on how to proceed with this.

Best Regards to CGAL-ers
Shrabani
Reply | Threaded
Open this post in threaded view
|

Re: How to do Edge collapse on surface mesh using user defined cost value?

Audette, Michel A.
You have to remember the strategy that we discussed. You need to figure things out for yourself, as your question is not very detailed. I makes it look like you want someone else to do your implementation. You need to think about your program and plan it accordingly. No one on CGAL land is going to do your work. 
  1. Input meshes from holes FHi, EHj, VHk,and bone FBl, EBm, VBn, each of which should also have a corresponding label.  
    1. First, your program should enhance the CGAL vertex, edge and face data structure to add the label of the corresponding opposite vertex, edge or face. Call it match-label or something like that. The edge data structure is found here: https://doc.cgal.org/latest/Surface_mesh_simplification/classEdgeProfile.html . 
      • I.e.: if there is a double edge EH1 and EB2 then under EH1 -> match_label =   EB2 , and EB2 -> match_label =   EH1  . Do the same for faces. You may also want to do the same for vertices, maybe. 

  2.  Start with hole meshes. There will be no constraints for hole edges; we want to iterate a few times, and each time we delete an edge or a face of a hole, also delete the edge or face of the corresponding match_label edge or face within the bone model, so that the shared mesh geometry is the same on both sides. Make sure to update the match_label for each newly configured edge or face or vertex. 
  3. After simplifying hole meshes,  and propagating the simplification to the bone mesh on the other side, we are still left with more simplification to do in the rest of the bone mesh, where we want to maintain constant the shared bone edges, faces, and vertices that we obtained previously from step 2. For each of these, which we want to maintain the same, invoke the counterpart of GetCost(), which is SetCost(xxx) (obvious, no?) for each edge, vertex and face. The value xxx should be a large value, according to CGAL. Something like 
    float mi = std::numeric_limits<float>::max();
    If you SetCost(xxx) with a large value like that, this edge will not be collapsable, if I understand correctly. 
I would like you to develop more willingness to think through the algorithm and roll up your sleeves. You have the ability, but you need to take an active role, rather than wait for Prince Charming to show up on his white horse. 

Keep pinging me as you develop this. 

Michel Audette, Ph.D.
Associate Professor,
Department of Computational Modeling and Simulation Engineering,
Old Dominion University,
Norfolk, VA.
 

From: Shrabani Ghosh <[hidden email]>
Sent: Tuesday, September 3, 2019 4:12 PM
To: [hidden email] <[hidden email]>
Cc: Audette, Michel A. <[hidden email]>
Subject: How to do Edge collapse on surface mesh using user defined cost value?
 
Hi,

I'm coding mesh simplification using edge collapse method with two different cost functions

The GetCost function calculates the cost of collapsing an edge.  I want to assign a user-defined cost value so that some edges will not collapse.  

Or if there is any other way to keep some edges untouched during the simplification process.

Please advise on how to proceed with this.

Best Regards to CGAL-ers
Shrabani
Reply | Threaded
Open this post in threaded view
|

Re: How to do Edge collapse on surface mesh using user defined cost value?

Sartaj Hundal-2
A lot of us would be more willing to contribute to mailing lists if power users / researchers / others read the documentation first. This email trail is getting 'Starred'.

On Tue, Sep 3, 2019 at 2:40 PM Audette, Michel A. <[hidden email]> wrote:
You have to remember the strategy that we discussed. You need to figure things out for yourself, as your question is not very detailed. I makes it look like you want someone else to do your implementation. You need to think about your program and plan it accordingly. No one on CGAL land is going to do your work. 
  1. Input meshes from holes FHi, EHj, VHk,and bone FBl, EBm, VBn, each of which should also have a corresponding label.  
    1. First, your program should enhance the CGAL vertex, edge and face data structure to add the label of the corresponding opposite vertex, edge or face. Call it match-label or something like that. The edge data structure is found here: https://doc.cgal.org/latest/Surface_mesh_simplification/classEdgeProfile.html . 
      • I.e.: if there is a double edge EH1 and EB2 then under EH1 -> match_label =   EB2 , and EB2 -> match_label =   EH1  . Do the same for faces. You may also want to do the same for vertices, maybe. 

  2.  Start with hole meshes. There will be no constraints for hole edges; we want to iterate a few times, and each time we delete an edge or a face of a hole, also delete the edge or face of the corresponding match_label edge or face within the bone model, so that the shared mesh geometry is the same on both sides. Make sure to update the match_label for each newly configured edge or face or vertex. 
  3. After simplifying hole meshes,  and propagating the simplification to the bone mesh on the other side, we are still left with more simplification to do in the rest of the bone mesh, where we want to maintain constant the shared bone edges, faces, and vertices that we obtained previously from step 2. For each of these, which we want to maintain the same, invoke the counterpart of GetCost(), which is SetCost(xxx) (obvious, no?) for each edge, vertex and face. The value xxx should be a large value, according to CGAL. Something like 
    float mi = std::numeric_limits<float>::max();
    If you SetCost(xxx) with a large value like that, this edge will not be collapsable, if I understand correctly. 
I would like you to develop more willingness to think through the algorithm and roll up your sleeves. You have the ability, but you need to take an active role, rather than wait for Prince Charming to show up on his white horse. 

Keep pinging me as you develop this. 

Michel Audette, Ph.D.
Associate Professor,
Department of Computational Modeling and Simulation Engineering,
Old Dominion University,
Norfolk, VA.
 

From: Shrabani Ghosh <[hidden email]>
Sent: Tuesday, September 3, 2019 4:12 PM
To: [hidden email] <[hidden email]>
Cc: Audette, Michel A. <[hidden email]>
Subject: How to do Edge collapse on surface mesh using user defined cost value?
 
Hi,

I'm coding mesh simplification using edge collapse method with two different cost functions

The GetCost function calculates the cost of collapsing an edge.  I want to assign a user-defined cost value so that some edges will not collapse.  

Or if there is any other way to keep some edges untouched during the simplification process.

Please advise on how to proceed with this.

Best Regards to CGAL-ers
Shrabani