How to specify Edge Collapse Constrained Border

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

How to specify Edge Collapse Constrained Border

Shrabani Ghosh
Hi,

I am trying to use the edge collapse constrained border example. I have
tried on a few example data. Every time there are 6 edges that are
nonremovable. I think somewhere the program sets 6 edges as non-removable.
Could you please help me which part of the program specifies that? I am
referring to this example.
https://doc.cgal.org/latest/Surface_mesh_simplification/Surface_mesh_simplification_2edge_collapse_constrained_border_surface_mesh_8cpp-example.html

I am new on CGAL. Any help will be really appreciated.

Regards
Shrabani Ghosh





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

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: How to specify Edge Collapse Constrained Border

MaelRL

Hello,

The documentation for the edge collapse function is here: https://doc.cgal.org/latest/Surface_mesh_simplification/group__PkgSurfaceMeshSimplificationRef.html#ga5f51d0ea2897f3c22e870279cfb4bd41.

This optional parameter must be a property map (see https://www.boost.org/doc/libs/1_49_0/libs/property_map/doc/property_map.html) that will answer whether an edge of your mesh can be simplified or not (if not, it is said to be constrained). The API that the simplification algorithm uses to query the map and that your property map must respect is "get(the_property_map, edge_descriptor)". In the example, the property map that we use is called "bem" (for "border edge map"), and is of type "Border_is_constrained_edge_map". It's a simple struct that simply calls CGAL::is_border() for any query edge of 'surface_mesh' and thus we will never collapse any border edge. As you can see, it defines the "get(pmap, edge)" operator required. The one that is passed to the algorithm is constructed at line with the following: 'Border_is_constrained_edge_map bem(surface_mesh);'.

Now, to pass this property map to the function, we use something called named parameters (also from the boost library originally). Named parameters a way to pass optional parameters without having to respect a specific order. Instead you just use a tag to indicate what you are passing as parameter. In the example, this is the part ", CGAL::parameters::edge_is_constrained_map(bem).get_placement(Placement(bem)": the last parameter of the edge collapse function is all the optional parameters. Here, we are passing two optional parameters: a specific placement (this is completely irrelevant for your question), and an edge constraint map (tag: edge_is_constrained_map, object: bem). Thus the algorithm will call the get operator of bem (the object of type Border_is_constrained_edge_mapĀ  defined above) to check if it is allowed to collapse some edges or not.

I hope this clarifies things for you.

Best
Mael

On 02/08/2019 22:26, Shrabani Ghosh wrote:
Hi,

I am trying to use the edge collapse constrained border example. I have
tried on a few example data. Every time there are 6 edges that are
nonremovable. I think somewhere the program sets 6 edges as non-removable.
Could you please help me which part of the program specifies that? I am
referring to this example.
https://doc.cgal.org/latest/Surface_mesh_simplification/Surface_mesh_simplification_2edge_collapse_constrained_border_surface_mesh_8cpp-example.html

I am new on CGAL. Any help will be really appreciated.

Regards
Shrabani Ghosh





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

Reply | Threaded
Open this post in threaded view
|

Re: How to specify Edge Collapse Constrained Border

Shrabani Ghosh
Thank You very much for your explanation. I used the edge collapse
constrained border surface mesh on a bone model.  But after the edge
reduction, it loses its shape.
<http://cgal-discuss.949826.n4.nabble.com/file/t376134/25.png>

Is that possible to do edge reduction such a way so that all the triangles
will have a similar size?

<http://cgal-discuss.949826.n4.nabble.com/file/t376134/24.png>

And what this parameter defines here?
SMS::Count_stop_predicate<Surface_mesh> stop(0);
Which  values can be used here instead of 0?

Thanks in advance
Shrabani Ghosh



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

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: How to specify Edge Collapse Constrained Border

Shrabani Ghosh
In reply to this post by MaelRL
Hi,

I am able to use property_map. But each vertex of the mesh has material
information in my data.
Like each vertex material information (0,2,5) or (2,0,5) or (0,3,5) or
(3,0,5) or (2,3,9) or (3,2,9).

How can I see the material information?

Like to see the location information I am writing like this.
  Mesh::Property_map<vertex_descriptor, K::Point_3> location = m.points();
  BOOST_FOREACH( vertex_descriptor vd, m.vertices()) {
    std::cout << "point " << vd << " location " << location[vd] <<
std::endl;
  }

What should I use to see the material information instead of m.points()?



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

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss