Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Is it convenient to change the surface_mesh_simplification a little?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Is it convenient to change the surface_mesh_simplification a little?


Chronological Thread 
  • From: Mael <>
  • To:
  • Subject: Re: [cgal-discuss] Is it convenient to change the surface_mesh_simplification a little?
  • Date: Mon, 14 Oct 2019 11:37:32 +0200
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=None ; spf=None
  • Ironport-phdr: 9a23:wsmlPBLGBGbWpbAL+dmcpTZWNBhigK39O0sv0rFitYgeL/vxwZ3uMQTl6Ol3ixeRBMOHsqkC1LOd6v+ocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeTpAI7SiNm82/yv95HJbAhEmTSwbalwIRmrogndq8sbipZ+J6gszRfEvmFGcPlMy2NyIlKTkRf85sOu85Nm7i9dpfEv+dNeXKvjZ6g3QqBWAzogM2Au+c3krgLDQheV5nsdSWoZjBxFCBXY4R7gX5fxtiz6tvdh2CSfIMb7Q6w4VSik4qx2ThLjlSUJOCMj8GzPl8J+kqxbrhKiqRJxzYHbb4OaO+Zlc6zHYd8XX3BMUtpfWiFDBI63cosBD/AGPeZdt4TzoEEBogW6BQKxA+7vzyVHiWHy3aEgyeQhFhzG3QM+ENIKqnjUqM/6O7wJXu+r16TIwivMb/RT2Tjj9IjIaBAgof+WUr1sbcrRzlMvFgPfglqMrozlOiqY2+IQuGaV6OpgUPigi28hqwxppDig3NwjhZLNho0L0FzL6SJ5wIMtKdKkR050e9qkHIFXtyGAOIt7RN4pTWJwuCsiybALu4S3cSwJxZg92hLSa/+Kf5KV7h7+SOqdOSl0iGh4dL+/nRq+7Eetx+/mWsWqzFpHqixImcTWuH8XzRzc8M2HR+N9/ki/3TaP0Bje5+NeLUAxkqrXNoQtwrsqmZoStUTPByj2mFjqjKOMcUUk5Oio5/7hYrr4up+QL450igfgPaQygsGyAuY1PhIKUmWY4+iwyb3u8E7jTLlXk/E6jrHVsJXAKsQaoq65DRVV0oEm6xunCjepysoXnX0dIFJffxKHkofoNE/KIPziCfewmU+jnyx1yP3dMb3uHJLNLn3dn7f9Z7Z860BcxxAvwtBD4JJUELEALOjvVU/2sdzUFgU5PBCsw+b7FNV90ZsTVn6AAqCDNKPeqEKH5uM0I+aQeY8Voy39JuM+5//uiH85gUUScbOo3ZsRcnC4H+5pL1+XYXr20Z89FjIBsQM6CeDrk1afSiV7ZnCoXqt66CtoJpihCNLmT42pyOiE1Sq/WIdRe3BLDhaIGH3ieq2LVvAJZT6IM8FomSADT6nnQIgkg0L9/DTmwqZqe7KHshYTsojugYAstr/j0Coq/DkxNPyzlmSETmV6hGQNHWZk0614pEFh0EaN2KNkhOZJU9dU4qERC1poBdvn1+V/TuvKdEfBc9OOEgr0HZOjBmh3S9swx5oJflo7HMuiyBbOw3jyWuNHp/mwHJUxt5nk8T3pPc8nkiTJ2a4kgkU8U8VGPnGhnL85/A/WVdbE

Hello,

With CGAL, you can pass any policy you want as long as it fits some requirements. The requirements on a placement class is very light and is defined there: https://doc.cgal.org/5.0/Surface_mesh_simplification/classGetPlacement.html. thus, your class  must provide the functor:

    boost::optional< Point > operator() (Profile const &edge_profile) const

The "edge profile" is a class that regroups all information useful during the collapse of an edge. Its interface is described there: https://doc.cgal.org/5.0/Surface_mesh_simplification/classEdgeProfile.html. In particular, you see that you can obtain the edge being collapse via v0_v1 (or v1_v0, since these are halfedges). You can use the function is_border_edge (https://doc.cgal.org/5.0/BGL/group__PkgBGLHelperFct.html#ga63695419c5ce7f68949ff2fb4f42d733) to know if your edge is on the border (check out https://doc.cgal.org/5.0/BGL/index.html for details on the graph API).

You can then simply derive a new policy from Lindstrom-Turk and do something like:

struct my_custom_placement
   : public lindstorm-turk placement
{
    boost::optional< Point > operator() (Profile const &edge_profile) const
   {
      if(is_border_edge(edge_profile.v0_v1()))
        return whichever extremity point you want;
      else
        return base::operator()(edge_profile);
   }  

};

Best,
Mael

On 13/10/2019 01:46, tdchen wrote:
I'm a newbie both to STL and CGAL.
I found that the CGAL surface_mash_simplification might be very helpful to
my work.
But I have to change it a little to suit my needs.
Specifically, I want to change the placement policy to that: the border edge
will be collapsed to one of its vertices and others to the Lindstrom-Turk
position.
I wonder if it is convenient in CGAL.
It seems there is no such a placement policy in curent version of CGAL.
Thanx.



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/




Archive powered by MHonArc 2.6.18.

Top of Page