Subject: CGAL users discussion list
List archive
- From: tang <>
- To:
- Subject: [cgal-discuss] Bug of 'join_vertex' in CGAL?
- Date: Tue, 14 Jan 2014 18:38:57 -0800 (PST)
Dear all,
I installed latest CGAL 4.3 and run the following code:
void SimplifySurfaceMeshCGAL(Polyhedron *obj,double edgelengthmin)
{
double minimum_edge_length = edgelengthmin*edgelengthmin; // squared
double len;
{std::ofstream log("update.off");log << *obj; } update.off
<http://cgal-discuss.949826.n4.nabble.com/file/n4658645/update.off>
int count=0,n20=0;
while(1)
{
int found=0;
Halfedge_iterator eb0=obj->halfedges_begin() ;
for( Polyhedron::Halfedge_iterator eb =
obj->halfedges_begin() ; eb !=
obj->halfedges_end() ; ++ eb )
{
len=get_edge_length<Polyhedron>(eb);
if(len<minimum_edge_length)
{
*obj->join_vertex(eb);
eb=eb0 ;
if(found==0)found=1;
count++;
int n2=0;
for ( Facet_iterator i = obj->facets_begin(); i != obj->facets_end(); ++i)
{
Halfedge_facet_circulator j = i->facet_begin();
if((int)CGAL::circulator_size(j)==2)n2++;
}
if(n2>n20)
{
printf("%d %d\n",count,n2);
n20=n2;
{std::ofstream log("update1.off");log << *obj; } update1.off
<http://cgal-discuss.949826.n4.nabble.com/file/n4658645/update1.off>
exit(0);
}
}
else
eb0=eb;
}
if(found==0)break;
}
}
I found that every time running the function "join_vertex", two degenerated
facets (facets contains only two vertices) generated. Is it a bug of the
function "join_vertex"? If not, how can I remove the degenerated facets?
Thanks
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Bug-of-join-vertex-in-CGAL-tp4658645.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Bug of 'join_vertex' in CGAL?, tang, 01/15/2014
- Re: [cgal-discuss] Bug of 'join_vertex' in CGAL?, Sebastien Loriot (GeometryFactory), 01/15/2014
- Re: [cgal-discuss] Bug of 'join_vertex' in CGAL?, tang, 01/16/2014
- Re: [cgal-discuss] Bug of 'join_vertex' in CGAL?, Sebastien Loriot (GeometryFactory), 01/24/2014
- Re: [cgal-discuss] Bug of 'join_vertex' in CGAL?, tang, 01/26/2014
- Re: [cgal-discuss] Bug of 'join_vertex' in CGAL?, Sebastien Loriot (GeometryFactory), 01/27/2014
- Re: [cgal-discuss] Bug of 'join_vertex' in CGAL?, tang, 01/26/2014
- Re: [cgal-discuss] Bug of 'join_vertex' in CGAL?, Sebastien Loriot (GeometryFactory), 01/24/2014
- Re: [cgal-discuss] Bug of 'join_vertex' in CGAL?, tang, 01/16/2014
- Re: [cgal-discuss] Bug of 'join_vertex' in CGAL?, Sebastien Loriot (GeometryFactory), 01/15/2014
Archive powered by MHonArc 2.6.18.