Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] "Feature" at CGAL::Polyhedral_mesh_domain_3

Subject: CGAL users discussion list

List archive

[cgal-discuss] "Feature" at CGAL::Polyhedral_mesh_domain_3


Chronological Thread 
  • From: "Lehtonen, Matti/HIIT" <>
  • To:
  • Subject: [cgal-discuss] "Feature" at CGAL::Polyhedral_mesh_domain_3
  • Date: Wed, 02 Jun 2010 19:50:12 +0300

Hi!

The comment at CGAL::Polyhedron_incremental_builder_3 says:
// The correct protocol of method calls to
// build a polyhedral surface can be stated as regular expression:
//
// `begin_surface (add_vertex | (begin_facet add_vertex_to_facet*
// end_facet))* end_surface '


Primary question: Have I found some feature, or am I using polyhedron & mesh
domain incorrectly by giving only vertices for mesh refining??
Secondary question: why my delaynay trangulation to hds builder (the else
branch) generated invalid hds?

Background for questions:

Okay, a surface can contain only vertices. So I modified my existing (but
incorrectly working) template <class HDS> class Build_triangulation : public
CGAL::Modifier_base<HDS>.
void
operator()
(
HDS & hds
)
{
CGAL::Polyhedron_incremental_builder_3<HDS> pB( hds, true );

#if 1
pB.begin_surface( points->size(), 0, 0 );
for( PointList::const_iterator i = points->begin(); i != points->end(); ++i
)
{
pB.add_vertex( *i );
}
pB.end_surface();
#else
// This generates incorrect hds from valid delaunay triangylation, why??
for( DTr::Finite_facets_iterator f = triangulation->finite_facets_begin();
f != triangulation->finite_facets_end(); ++f )
{
DTr::Triangle t = triangulation->triangle( *f );

pB.begin_surface( 3, 1, 3 );

pB.add_vertex( t.vertex( 0 ) );
pB.add_vertex( t.vertex( 1 ) );
pB.add_vertex( t.vertex( 2 ) );

pB.begin_facet();

pB.add_vertex_to_facet( 0 );
pB.add_vertex_to_facet( 1 );
pB.add_vertex_to_facet( 2 );

pB.end_facet();

pB.end_surface();
}
#endif
}

Then the mesh domain is constructed by
Mesh_domain domain( polyhedron ),

it fails following way:
terminate called after throwing an instance of 'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: m_primitives.size() > 1
File: /usr/include/CGAL/AABB_tree.h
Line: 471
The reason seems that AABB tree expects that atleast 2
primititives(triangles?)
are present ...

thx for any feedback
Lehtonen, Matti


*** Halfedges *** Build hds from point set
* halfedges - 0
* vertices - 187967
*** Polyhedron *** Deletegate hds to polyhedron
* facets - 0
* halfedges - 0
* vertices - 187967
*** Border *** Normalize polyhedron border
* border halfedges - 0
* border edges - 0
* border isvalid - 1
*** domain *** Construct mesh domain
terminate called after throwing an instance of 'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: m_primitives.size() > 1
File: /usr/include/CGAL/AABB_tree.h
Line: 471



Researcher, head programmer - Helsinki Institute for Information Technology
HIIT
http://www.hiit.fi/
--
Life is complex. It has real and imaginary parts.




  • [cgal-discuss] "Feature" at CGAL::Polyhedral_mesh_domain_3, Lehtonen, Matti/HIIT, 06/02/2010

Archive powered by MHonArc 2.6.16.

Top of Page