Subject: CGAL users discussion list
List archive
- From: Jean-Philippe Pons <>
- To:
- Subject: Re: [cgal-discuss] Re: Bug in Polyhedron_incremental_builder_3::test_facet
- Date: Tue, 29 Jun 2010 09:12:55 +0200
Thanks very much Sebastien. Your patch solves my problem. In particular it allows to implement a loader which is resilient to non-manifold polyhedra, with a user warning mentioning the number of discarded facets.
Best wishes,
Jean-Philippe
Sebastien Loriot (GeometryFactory) a écrit :
Thanks for your bug report Jean-Philippe.
Here is a patch and the modified file that should fix the problem you
have encountered. Let me now whether you still have a problem.
This bug will be fixed in the 3.6.1 bug fix release of CGAL.
Best,
S.
Jean-Philippe Pons wrote:
Dear Sebastien,
No. The case you mention may easily happen during the construction of a
manifold mesh, depending on the order of insertion of facets. As
expected, it is accepted by test_facet and do not cause the failure of
add_facet either.
The case I have in mind is a little more complex: it happens when a
novel facet closes a cycle of facets while there already was another
facet incident to the central vertex of the created cycle.
You can reproduce the aforementioned case with the piece of code given
below. The "Error in polyhedron construction" message should never
happen since all facets are tested before being inserted. But it happens
in practice when adding the fourth facet.
Cheers,
Jean-Philippe
--------------
CGAL::Polyhedron_incremental_builder_3<HDS> B(hds, true);
int nb_vertices = 6;
int f[] = {0,1,2, 0,2,3, 0,4,5, 0,3,1};
int nb_triangles = sizeof(f) / sizeof(int) / 3;
B.begin_surface(nb_vertices, nb_triangles);
for (int i=0; i<nb_vertices; i++)
B.add_vertex(Point(0,0,0));
for (int i=0; i<nb_triangles; i++)
{
int *first = f+3*i, *beyond = first+3;
if (B.test_facet(first, beyond))
{
cout << "Facet can be added" << endl;
B.add_facet(first, beyond);
if (B.error())
{
cout << "Error in polyhedron construction" << endl;
break;
}
}
else
cout << "Facet cannot be added" << endl;
}
B.end_surface();
-------------
Sebastien Loriot (GeometryFactory) [via cgal-discuss] a écrit :
> Hello Jean-Philippe,
>
> Jean-Philippe Pons wrote:
>
> > Dear CGAL developers,
> >
> > test_facet may return 'true' when testing a facet which creates a
> > non-manifold vertex. So that a subsequent call to add_facet will
> > unexpectedly fail.
> >
> > This is because test_facet only checks if one of the vertices of the
> novel
> > facet already has a full cycle of facets, which is not sufficient. It
> does
> > not check if the novel facet closes a cycle, while there is another
> > component of facets.
> Do you mean for example:
> the HDS contains only one triangle. Then we insert a new triangle
> incident to only one vertex of the first triangle?
>
> >
> > I have checked that the problem still exists in the latest version.
> >
> > Cheers,
> >
> > Jean-Philippe
> >
>
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://lists-sop.inria.fr/wws/info/cgal-discuss
>
>
>
> ------------------------------------------------------------------------
> View message @
> http://cgal-discuss.949826.n4.nabble.com/Bug-in-Polyhedron-incremental-builder-3-test-facet-tp2265287p2267270.html <http://cgal-discuss.949826.n4.nabble.com/Bug-in-Polyhedron-incremental-builder-3-test-facet-tp2265287p2267270.html?by-user=t>
>
> To unsubscribe from Bug in Polyhedron_incremental_builder_3::test_facet,
> click here
> <<Link Removed>>.
>
------------------------------------------------------------------------
View this message in context: Re: Bug in Polyhedron_incremental_builder_3::test_facet <http://cgal-discuss.949826.n4.nabble.com/Bug-in-Polyhedron-incremental-builder-3-test-facet-tp2265287p2268422.html>
Sent from the cgal-discuss mailing list archive <http://cgal-discuss.949826.n4.nabble.com/> at Nabble.com.
--
IMAGINE, CSTB/MOD-EVE, Sophia-Antipolis, France
Tél : (33) 4 93 95 67 20 ; Fax : (33) 4 93 95 67 33
http://imagine.enpc.fr/~pons
- [cgal-discuss] Bug in Polyhedron_incremental_builder_3::test_facet, Jean-Philippe Pons, 06/23/2010
- Re: [cgal-discuss] Bug in Polyhedron_incremental_builder_3::test_facet, Sebastien Loriot (GeometryFactory), 06/24/2010
- [cgal-discuss] Re: Bug in Polyhedron_incremental_builder_3::test_facet, Jean-Philippe Pons, 06/25/2010
- Re: [cgal-discuss] Re: Bug in Polyhedron_incremental_builder_3::test_facet, Sebastien Loriot (GeometryFactory), 06/28/2010
- Re: [cgal-discuss] Re: Bug in Polyhedron_incremental_builder_3::test_facet, Jean-Philippe Pons, 06/29/2010
- Re: [cgal-discuss] Re: Bug in Polyhedron_incremental_builder_3::test_facet, Sebastien Loriot (GeometryFactory), 06/28/2010
- [cgal-discuss] Re: Bug in Polyhedron_incremental_builder_3::test_facet, Jean-Philippe Pons, 06/25/2010
- Re: [cgal-discuss] Bug in Polyhedron_incremental_builder_3::test_facet, Sebastien Loriot (GeometryFactory), 06/24/2010
Archive powered by MHonArc 2.6.16.