Subject: CGAL users discussion list
List archive
- From: luchia <>
- To:
- Subject: [cgal-discuss] Iterating over facets and Points of a Convex_hull_d
- Date: Thu, 26 Apr 2012 01:05:30 -0700 (PDT)
Hallo,
I'm a new CGAL user and I'm facing a problem that actually I do not know how
to solve.
I'm writing the procedure Lower_hull that takes in input a Convex_hull_d
CH_d, an empty
vector vfacet of type std::vector<Facet> with Facet of type
Convex_hull_d::Facet_handle
and returns in vfacet the vector of all the facet of CH_d that belong to the
lower hull.
Here is the code:
*void Lower_hull(Convex_hull_d& CH_d, VFacet vfacet) {
Hyperplane hp;
Vector_d normal;
for (Facet_iterator i = CH_d.facets_begin(); i != CH_d.facets_end();
++i) {
hp = CH_d.hyperplane_supporting(i); // Hyperplane of the i-th
facet
normal = hp.orthogonal_vector(); // Normal to hp
if(normal[(normal.dimension())-1]<0)
{
vfacet.push_back(i);
for (Convex_hull_d::Point_const_iterator j =
i->points_begin(); j!=
i->points_end(); ++j){}
}
}
}*
Questions:
1. The idea to use the Hyperplane passing throuth a facet to extract its
orthogonal vector
does it make sense?
2. Why the statement CH_d.hyperplane_supporting(i) is it correct? The method
hyperplane_supporting takes in input a facet_handle, while "i" its an
iterator over facet. Thus ... shouldn't we pass (*i) insteat of i?
3. The cicle:
for (Convex_hull_d::Point_const_iterator j = i->points_begin(); j!=
i->points_end(); ++j){}
was designed in order to iterate over the points of a given facet i. But it
does not work ... I obtained
a type error message.
Thaks your patience and for your help,
Luca
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Iterating-over-facets-and-Points-of-a-Convex-hull-d-tp4589157p4589157.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Iterating over facets and Points of a Convex_hull_d, luchia, 04/26/2012
- Re: [cgal-discuss] Iterating over facets and Points of a Convex_hull_d, Sebastien Loriot (GeometryFactory), 04/26/2012
- [cgal-discuss] Re: Iterating over facets and Points of a Convex_hull_d, luchia, 04/26/2012
- Re: [cgal-discuss] Re: Iterating over facets and Points of a Convex_hull_d, Sebastien Loriot (GeometryFactory), 04/27/2012
- [cgal-discuss] Re: Iterating over facets and Points of a Convex_hull_d, luchia, 04/27/2012
- Re: [cgal-discuss] Re: Iterating over facets and Points of a Convex_hull_d, Sebastien Loriot (GeometryFactory), 04/27/2012
Archive powered by MHonArc 2.6.16.