Skip to Content.
Sympa Menu

cgal-discuss - Re:[cgal-discuss] CGAL::Polyhedron_incremental_builder_3<HDS> problem

Subject: CGAL users discussion list

List archive

Re:[cgal-discuss] CGAL::Polyhedron_incremental_builder_3<HDS> problem


Chronological Thread 
  • From: "Thomas Zangl - Home" <>
  • To: "cgal-discuss" <>
  • Subject: Re:[cgal-discuss] CGAL::Polyhedron_incremental_builder_3<HDS> problem
  • Date: Wed, 18 Jul 2007 16:51:12 +0200


Am Wed, 18 Jul 2007 16:15:05 +0200, schrieb "Peter Hachenberger"
<>:

Hi!

>How do you extract the vertices from a triangle? I'm not completely sure
>how our triangulation works, but I would assume that the vertices of a
>facet should be oriented consistently if you triangulate an orientable
>surface.

I extract them like this:

Rt_Facet_iterator fIt = t.facets_begin();
Rt_Facet_iterator fEnd = t.facets_end();
if ( fIt == fEnd ) { std::cout << "no faces found" << std::endl ;}
else {
while(fIt != fEnd) {
Rt_Cell_handle cell = fIt->first;
// this is the index of the facet's opposite vertex
int faceIndex = fIt->second;
// "info" is a simple int which holds an index, assigned
// upon insertion into the triangulation.
// bascially its just 0, 1, 2, 3, 4, 5 ...
int a = cell->vertex((faceIndex+1) % 4)->info();
int b = cell->vertex((faceIndex+2) % 4)->info();
int c = cell->vertex((faceIndex+3) % 4)->info();

// I then test here if the triangle is useful for later
// processing..
if (isUseFull) {
intTriple faceOfIndices(a,b,c);
complex.push_back(faceOfIndices);
}
}

So I end up with a vector of intTriple (which hold the indices of the
points forming each facet in the vector). And I have another vector
where I have a mapping index -> point which I need later for building
the Polyhedron.
Nothing special :-)

Best regards,
--
----------------------------------------------------------------
,yours Thomas Zangl, Bakk.rer.soc.oec. -

-
- Freelancer - IT Consulting & Software Development -
- Student of Software Development-Economy (Master) -



Archive powered by MHonArc 2.6.16.

Top of Page