Re: Iterate over faces and getting their edges

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

Re: Iterate over faces and getting their edges

Sebastien Loriot (GeometryFactory)
You can use the range provided by halfedges_around_faces():

https://doc.cgal.org/latest/BGL/group__PkgBGLIterators.html#ga37229df31508a78eb4acdaf907e637e5

Sebastien.

On 10/13/19 6:43 AM, Shrabani Ghosh wrote:

> Hi,
>
> I need the edges info for specific faces. How I can iterate over edges of
> the faces. Like here it can iterate over vertices of the faces.
>
> int i=0;
> BOOST_FOREACH(face_descriptor f, faces(surface_mesh)){
>      int j=0;
>      CGAL::Vertex_around_face_iterator<Surface_mesh> vbegin, vend;
>      for(boost::tie(vbegin, vend) =
> vertices_around_face(surface_mesh.halfedge(f), surface_mesh);
>              vbegin != vend;
>              ++vbegin){
>          j++;
>          std::cout << j << "th index of " << i << "th face: "<< *vbegin <<
> std::endl;
>      }
>      i++;
> }
>
> how to iterate over edges?
>
> 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: Iterate over faces and getting their edges

Shrabani Ghosh
Thank you . I am able  to do it. 

Regards
Shrabani Ghosh

On Wed, Oct 16, 2019 at 3:07 AM Sebastien Loriot (GeometryFactory) <[hidden email]> wrote:
You can use the range provided by halfedges_around_faces():

https://doc.cgal.org/latest/BGL/group__PkgBGLIterators.html#ga37229df31508a78eb4acdaf907e637e5

Sebastien.

On 10/13/19 6:43 AM, Shrabani Ghosh wrote:
> Hi,
>
> I need the edges info for specific faces. How I can iterate over edges of
> the faces. Like here it can iterate over vertices of the faces.
>
> int i=0;
> BOOST_FOREACH(face_descriptor f, faces(surface_mesh)){
>      int j=0;
>      CGAL::Vertex_around_face_iterator<Surface_mesh> vbegin, vend;
>      for(boost::tie(vbegin, vend) =
> vertices_around_face(surface_mesh.halfedge(f), surface_mesh);
>              vbegin != vend;
>              ++vbegin){
>          j++;
>          std::cout << j << "th index of " << i << "th face: "<< *vbegin <<
> std::endl;
>      }
>      i++;
> }
>
> how to iterate over edges?
>
> 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