Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Iterating over Polyhedron facets

Subject: CGAL users discussion list

List archive

[cgal-discuss] Iterating over Polyhedron facets


Chronological Thread 
  • From: Geordie Moffatt <>
  • To: "" <>
  • Subject: [cgal-discuss] Iterating over Polyhedron facets
  • Date: Mon, 31 Aug 2009 16:17:31 +1000
  • Accept-language: en-US, en-AU
  • Acceptlanguage: en-US, en-AU

Hi all, I’m developing a plugin for some 3D software and need to convert CGAL’s Polyhedron type to a “Mesh” type.

 

I can successfully iterate over the Polyhedron’s vertices and extract their position.but am having trouble with the facets.

 

How do I extract the indices of the vertices used by a facet relative to the main list of vertices? 

 

For example, if a polyhedron has 8 verts, face 2 might use verts  2, 3, 4.  I need to get at these vertex indices.

 

Here’s the code snippet where I’m iterating over my facets:

 

// Creating faces

int fc = 0;            

for (CGAL_Facet_iterator fIter = inPoly.facets_begin(); fIter != inPoly.facets_end(); fIter++)

{

      int faceDeg = fIter->facet_degree();

      CGAL_Halfedge_circulator edgecirculator = fIter->facet_begin();                    

                       

      for(int i = 0; i < faceDeg ;i++)

      {

            // ****** Need to get at facet vertex indices here ******        

            edgecirculator++;

      }

 

      fc++;

}

 

Thanks!

 

Geordie






This message and its attachments may contain legally privileged or confidential information. This message is intended for the use of the individual or entity to which it is addressed. If you are not the addressee indicated in this message, or the employee or agent responsible for delivering the message to the intended recipient, you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e-mail. Any content of this message and its attachments, which does not relate to the official business of the sending company must be taken not to have been sent or endorsed by the sending company or any of its related entities. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect.


  • [cgal-discuss] Iterating over Polyhedron facets, Geordie Moffatt, 08/31/2009

Archive powered by MHonArc 2.6.16.

Top of Page