Subject: CGAL users discussion list
List archive
- From: Laurent Rineau <>
- To:
- Subject: Re: [cgal-discuss] Facet_Circulator: too few facets counted..
- Date: Fri, 29 Feb 2008 14:07:39 +0100
- Organization: Inria, Sophia Antipolis, FRANCE
Thomas, your code was quite difficult to understand. You cannot assume us to
even try. Nevertheless, it was challenging, and I tried.
IĀ understand that, given a facet 'f', and an edge of that facet, you want to
turn around the edge, avoiding infinite facets, and 'f' itself.
Your mistake is the following test:
> if ((fCirc->first == f.first) && (fCirc->second == f.second)) {
> continue;
It is possible that fCirc is not equal to f, but is equal to
t_.mirror_facet (f). It depends of the orientation of the circulator around
the edge.
To correct that test, you can turn it into:
if(*fCirc == f || *fCirc == f_mirror)
continue;
given that you can put the following before the 'for' loop:
const Facet f_mirror = t_.mirror_facet(f);
You can also use a different form of the incident_facets function:
Rt_Facet_circulator fCirc = t_->incident_facets(f.first,
vertices[i%3],
vertices[(i+1) % 3],
f);
Rt_Facet_circulator fCircEnd = fCirc;
// here *fCirc == f
++fCirc;
// here *fCirc is the facet just after f
faceCounter = 0;
// the following test should be useless
// if t_.dimension()==3
if( fCirc != fCircEnd)
do {
// [...]
}
That way, you control the initialization of the Tr::FacetCirculator, and you
can be sure that fCirc will never be equal to f or to its mirror in the
do/while loop.
--
Laurent Rineau
INRIA - Sophia Antipolis
BP 93, 2004 Route des Lucioles
06902 Sophia Antipolis Cedex FRANCE
Tel: +33 4 92 38 78 62 (Fax: +33.4.97.15.53.95)
- Facet_Circulator: too few facets counted.., Thomas Zangl, 02/29/2008
- Re: [cgal-discuss] Facet_Circulator: too few facets counted.., Laurent Rineau, 02/29/2008
- Re: [cgal-discuss] Facet_Circulator: too few facets counted.., Thomas Zangl, 02/29/2008
- Re: [cgal-discuss] Facet_Circulator: too few facets counted.., Laurent Rineau, 02/29/2008
Archive powered by MHonArc 2.6.16.