Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Extract face data from polyhedron
- Date: Thu, 21 Apr 2016 08:34:50 +0200
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:3j0pyRbBf1cZZAmIxFFS9Cj/LSx+4OfEezUN459isYplN5qZpcq8bnLW6fgltlLVR4KTs6sC0LqG9f6/EjVZu96oizMrTt9lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9HOnpAIma153xjLDivcOMKFwR3nKUWvBbElaflU3prM4YgI9veO4a6yDihT92QdlQ3n5iPlmJnhzxtY+a9Z9n9DlM6bp6r5YTGfayQ6NtRrNRCHEqMns++dbwnRjFVwqGoHUGAUsMlR8dSTPI5hjhQpb8tGPesfB83zXSfeL7SrU5RS6zwa5gVBjymWZNf2oi9GbNi8tsyqdfiB2krh17hYXTZdfGZ7JFYqrBcIZCFiJ6VcFLWnkZDw==
- Organization: GeometryFactory
if you're using a polyhedron type with indices in vertices then simply
set those indices and use them. If not create a std::map to associate
to each vertex an index.
Something like the following should be working:
std::map<Vertex_handle,int> v2i;
int i=0;
BOOST_FOREACH(Vertex_handle vh, vertices(P))
v2i.insert(std::make_pair(vh,i++));
BOOST_FOREACH(Vertex_handle vh, vertices_around_face(fh->halfedge(),P))
int vertex_index = v2i[vh];
Sebastien.
On 04/20/2016 04:57 PM, Zhe Cao wrote:
Hi,
I am trying to convert polyhedron type in CGAL to a mesh type I created
before. Actually I succeeded extracting vertices from it but I don't know
how to get the face data (the indices of the vertices used by that face).
Thanks a lot!
Zhe
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Extract-face-data-from-polyhedron-tp4661854.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Extract face data from polyhedron, Zhe Cao, 04/20/2016
- Re: [cgal-discuss] Extract face data from polyhedron, Sebastien Loriot (GeometryFactory), 04/21/2016
- Re: [cgal-discuss] Extract face data from polyhedron, Zhe Cao, 04/21/2016
- Re: [cgal-discuss] Extract face data from polyhedron, Sebastien Loriot (GeometryFactory), 04/21/2016
- Re: [cgal-discuss] Extract face data from polyhedron, Zhe Cao, 04/21/2016
- Re: [cgal-discuss] Extract face data from polyhedron, Sebastien Loriot (GeometryFactory), 04/21/2016
Archive powered by MHonArc 2.6.18.