Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] A newbie question: Mesh_complex_3_in_triangulation & VRML stream

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] A newbie question: Mesh_complex_3_in_triangulation & VRML stream


Chronological Thread 
  • From: Stephane Tayeb <>
  • To:
  • Subject: Re: [cgal-discuss] A newbie question: Mesh_complex_3_in_triangulation & VRML stream
  • Date: Mon, 17 May 2010 14:54:06 +0200

Lehtonen, Matti/HIIT wrote:
Hi!

I am using the code from chapter "47.3.2 Mesh Generation From a Polyhedral
Domain", the elephant case to generate different meshes from [classified]
point
cloud.

The problem that I am currently facing is some type mismatch for tetrahedron
struct K: public CGAL::Exact_predicates_inexact_constructions_kernel {};
typedef CGAL::Mesh_3::Robust_intersection_traits_3<K> Geom_traits;
typedef CGAL::Polyhedron_3<Geom_traits> Polyhedron;
typedef Polyhedron::Point_3 Point;
typedef Polyhedron::HalfedgeDS HalfedgeDS;
typedef CGAL::Polyhedral_mesh_domain_3<Polyhedron, Geom_traits> Mesh_domain;
typedef CGAL::Mesh_triangulation_3<Mesh_domain>::type Tr;
typedef CGAL::Mesh_complex_3_in_triangulation_3<Tr> C3t3;

{
std::ofstream vrml_file( "mesh-1-out.wrl" );
CGAL::VRML_2_ostream vrml_stream( vrml_file );

for( C3t3::Facet_iterator f = c3t3.facets_begin();
f != c3t3.facets_end(); ++f )
{
C3t3::Triangulation::Triangle t =
c3t3.triangulation().triangle( *f );

vrml_stream << t;
}

for( C3t3::Cell_iterator c = c3t3.cells_begin();
c != c3t3.cells_end(); ++c )
{
// This line won't compile...
C3t3::Triangulation::Tetrahedron t =
c3t3.triangulation().tetrahedron( *c );
// This compiles & links
///C3t3::Triangulation::Tetrahedron t;

vrml_stream << t;
}

vrml_stream.close();
}

Everything seems to be okay, but for some reason I got following error (see
end
of mail), which looks like that tetrahedron other than
C3t3::Triangulation::Tetrahedron is returned. The triangle part works fine, so
what I am doing wrong?

CGAL version is 3.5.1-1 (Ubuntu 10.04) and GCC is 4.4.3-4ubuntu5.

Lehtonen, Matti

Researcher, head programmer - Helsinki Institute for Information Technology
HIIT
http://www.hiit.fi/


Hi,

c3t3.triangulation().tetrahedron( *c ) calls tetrahedron() on a Cell and the documented function (3D Triangulation class) is:
Tetrahedron t.tetrahedron (Cell_handle c).

Calling c3t3.triangulation().tetrahedron( c ) may solve your issue (C3t3::Cell_iterator should be convertible to Cell_handle)

Regards,
Stéphane.

--
Stephane Tayeb
Software engineer - INRIA Sophia Antipolis
Geometrica Project-Team



Archive powered by MHonArc 2.6.16.

Top of Page