Subject: CGAL users discussion list
List archive
- From: Philipp Moeller <>
- To:
- Subject: Re: [cgal-discuss] Re: Take the triangles of a polyhedron
- Date: Fri, 09 Mar 2012 20:34:48 +0100
- Organization: GeometryFactory
sgdimitris
<>
writes:
> Thank you for the quick and helpful answer.
> Yes I meant iterate by "take".
> I would like to ask you one more question. How can I refer to vertices of
> each facet.
> for example i want to print the vertices of each facet
> So I have to do something like
> "
> for(Facet_iterator f = polyhedron.facets_begin();
> f != polyhedron.facets_end();
> ++f) {
> // Print the vertices
> }
> "
> as I did with edges in the following code
> "
> for ( Edge_iterator w = poly.edges_begin(); w != poly.edges_end(); ++w)
> std::cout << "First Vertex of the edge" <<
> w->opposite()->vertex()->point() << " Second Vertex of the edge" <<
> w->vertex()->point() << std::endl;
> "
> Best regards,
> Dimitris
>
If you have a look at the documentation [1] you will see that each facet
gives you Halfedge_around_facet_circulator through the facet_begin and
facet_end member functions.
You then can use this circulator to walk all halfedges and get their
vertices through the vertex member function [2].
Is the documentation that confusing?
--
Philipp Moeller
GeometryFactory
[1] :
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Polyhedron_ref/Class_Polyhedron_3-Traits---Facet.html
[2] :
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Polyhedron_ref/Class_Polyhedron_3-Traits---Halfedge.html
- [cgal-discuss] Take the triangles of a polyhedron, sgdimitris, 03/09/2012
- Re: [cgal-discuss] Take the triangles of a polyhedron, Philipp Moeller, 03/09/2012
- [cgal-discuss] Re: Take the triangles of a polyhedron, sgdimitris, 03/09/2012
- Re: [cgal-discuss] Re: Take the triangles of a polyhedron, Philipp Moeller, 03/09/2012
- [cgal-discuss] Re: Take the triangles of a polyhedron, sgdimitris, 03/09/2012
- Re: [cgal-discuss] Re: Take the triangles of a polyhedron, Philipp Moeller, 03/09/2012
- [cgal-discuss] Re: Take the triangles of a polyhedron, sgdimitris, 03/09/2012
- Re: [cgal-discuss] Take the triangles of a polyhedron, Philipp Moeller, 03/09/2012
Archive powered by MHonArc 2.6.16.