Subject: CGAL users discussion list
List archive
- From: "Thomas Zangl - Home" <>
- To: <>
- Subject: CGAL::Polyhedron_incremental_builder_3<HDS> problem
- Date: Tue, 17 Jul 2007 19:34:09 +0200
Dear List!
I have a set of points and a set of faces which form a surface (can
also be a volume).
I use the CGAL::Polyhedron_incremental_builder_3 to build a Polyhedron
out of those sets. After inserting all points and all facets I get an
assertion:
CGAL::Polyhedron_incremental_builder_3<HDS>::
lookup_halfedge(): input error: facet 2 shares a halfedge from vertex 86 to
vertex 16 with facet 1.
CGAL error: assertion violation!
Expr: check_protocoll == 0
File: /home/TZi/CGAL-3.3/include/CGAL/Polyhedron_incremental_builder_3.h
Line: 198
Explanation:
Aborted (core dumped)
I know that facet 2 and facet 1 have a common edge. That is by
intention (the faces are from a triangulation). Is this a problem for
the incremental builder?
This is my code:
class Build_surface:public CGAL::Modifier_base<HalfedgeDS>
{
public:
// this is an int, Point map
IndexPointMap allPoints;
// this is a container with a triple(int, int, int)
// which holds the indices (see IndexPointMap) for each point of the
// face
FacesAsIndicesContainer allTriples;
Build_surface(IndexPointMap& allPoints_,FacesAsIndicesContainer
allTriples_):allPoints(allPoints_),allTriples(allTriples_){}
void operator()( HalfedgeDS& hds)
{
CGAL::Polyhedron_incremental_builder_3<HalfedgeDS> B( hds, true); //
verbose=False
B.begin_surface( allPoints.size(), allTriples.size());
typedef HalfedgeDS::Vertex Vertex;
int count = 0;
for(IndexPointMap::iterator
p_it=allPoints.begin();p_it!=allPoints.end();++p_it)
{
cout << count << "-adding vertice: " << p_it->second << endl;
B.add_vertex(p_it->second);
count++;
}
count = 0;
for(FacesAsIndicesContainer::iterator
t_it=allTriples.begin();t_it!=allTriples.end();++t_it)
{
Point a = allPoints[t_it->first];
Point b = allPoints[t_it->second];
Point c = allPoints[t_it->third];
Rt_Triangle tmp(a,b,c);
if(tmp.is_degenerate()) continue;
cout << count<<"-adding facet (idx): " <<
t_it->first<<"/"<<t_it->second<<"/"<<t_it->third << endl;
cout << count<<"-adding facet (coords): " << a<<"/"<<b<<"/"<<c <<
endl;
B.begin_facet();
B.add_vertex_to_facet(t_it->first);
B.add_vertex_to_facet(t_it->second);
B.add_vertex_to_facet(t_it->third);
B.end_facet();
count++;
}
B.end_surface();
}
};
This are the points which are mentioned by the error message:
(in front is the index)
16-adding vertice: 67.2414 67.2414 32.7586
27-adding vertice: 90.1561 90.1561 18.9655
11-adding vertice: 32.7586 67.2547 32.7586
86-adding vertice: 91.3793 68.9429 8.62069
88-adding vertice: 91.3793 79.5495 8.62069
0-adding facet (idx): 84/83/11
0-adding facet (coords): 8.62069 54.8008 8.62069/12.069 47.7297
12.069/32.7586 67.2547 32.7586
1-adding facet (idx): 88/86/16
1-adding facet (coords): 91.3793 79.5495 8.62069/91.3793 68.9429
8.62069/67.2414 67.2414 32.7586
2-adding facet (idx): 86/16/27
2-adding facet (coords): 91.3793 68.9429 8.62069/67.2414 67.2414
32.7586/90.1561 90.1561 18.9655
In total there are 95 vertices and 267 faces.
Whats wrong? Please help :-) Thanks!
Best regards,
--
----------------------------------------------------------------
,yours Thomas Zangl, Bakk.rer.soc.oec. -
-
- Freelancer - IT Consulting & Software Development -
- Student of Software Development-Economy (Master) -
- CGAL::Polyhedron_incremental_builder_3<HDS> problem, Thomas Zangl - Home, 07/17/2007
- Re: [cgal-discuss] CGAL::Polyhedron_incremental_builder_3<HDS> problem, Camille . Wormser, 07/17/2007
- Re:[cgal-discuss] CGAL::Polyhedron_incremental_builder_3<HDS> problem, Thomas Zangl - Home, 07/17/2007
- Re:[cgal-discuss] CGAL::Polyhedron_incremental_builder_3<HDS> problem, Camille . Wormser, 07/17/2007
- Re: [cgal-discuss] CGAL::Polyhedron_incremental_builder_3<HDS> problem, Michael George, 07/17/2007
- Re: [cgal-discuss] CGAL::Polyhedron_incremental_builder_3<HDS> problem, Camille . Wormser, 07/17/2007
- Re:[cgal-discuss] CGAL::Polyhedron_incremental_builder_3<HDS> problem, Thomas Zangl - Home, 07/17/2007
- Re:[cgal-discuss] CGAL::Polyhedron_incremental_builder_3<HDS> problem, Camille . Wormser, 07/17/2007
- Re:[cgal-discuss] CGAL::Polyhedron_incremental_builder_3<HDS> problem, Thomas Zangl - Home, 07/17/2007
- Re: Re:[cgal-discuss] CGAL::Polyhedron_incremental_builder_3<HDS> problem, Peter Hachenberger, 07/18/2007
- Re:[cgal-discuss] CGAL::Polyhedron_incremental_builder_3<HDS> problem, Thomas Zangl - Home, 07/18/2007
- Re:[cgal-discuss] CGAL::Polyhedron_incremental_builder_3<HDS> problem, Camille . Wormser, 07/17/2007
- Re: [cgal-discuss] CGAL::Polyhedron_incremental_builder_3<HDS> problem, Michael George, 07/17/2007
- Re:[cgal-discuss] CGAL::Polyhedron_incremental_builder_3<HDS> problem, Camille . Wormser, 07/17/2007
- Re:[cgal-discuss] CGAL::Polyhedron_incremental_builder_3<HDS> problem, Thomas Zangl - Home, 07/17/2007
- Re: [cgal-discuss] CGAL::Polyhedron_incremental_builder_3<HDS> problem, Camille . Wormser, 07/17/2007
Archive powered by MHonArc 2.6.16.