Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] CGAL error in Skin_surface_base_3

Subject: CGAL users discussion list

List archive

[cgal-discuss] CGAL error in Skin_surface_base_3


Chronological Thread 
  • From: FX <>
  • To:
  • Subject: [cgal-discuss] CGAL error in Skin_surface_base_3
  • Date: Tue, 29 Nov 2011 13:05:53 +0100

Dear CGAL team and users,

I have encountered an assertion violation in CGAL's meshing the union of a
set of balls. I have reduced my much larger original code to a minimal
testcase that always fails on my system. The following testcase tries to mesh
the union of 4 balls:

> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
> #include <CGAL/Skin_surface_3.h>
> #include <CGAL/Union_of_balls_3.h>
> #include <CGAL/Polyhedron_3.h>
> #include <CGAL/mesh_skin_surface_3.h>
> #include <CGAL/subdivide_skin_surface_mesh_3.h>
> #include <CGAL/IO/Polyhedron_iostream.h>
>
> int main (void)
> {
> typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
> typedef CGAL::Skin_surface_traits_3<K> Traits;
> typedef CGAL::Union_of_balls_3<Traits> Skin_surface_3;
> typedef Skin_surface_3::FT FT;
> typedef Skin_surface_3::Weighted_point Weighted_point;
> typedef Weighted_point::Point Bare_point;
> typedef CGAL::Polyhedron_3<K,
> CGAL::Skin_surface_polyhedral_items_3<Skin_surface_3> > Polyhedron;
>
> std::list<Weighted_point> list;
> list.push_front(Weighted_point(Bare_point(0.30700, 6.45800, 6.45800),
> 1));
> list.push_front(Weighted_point(Bare_point(0.07400, 5.03900, 5.03900),
> 1));
> list.push_front(Weighted_point(Bare_point(0.30700, 19.37400, 19.37400),
> 1));
> list.push_front(Weighted_point(Bare_point(0.07400, 20.79300, 20.79300),
> 1));
>
> Polyhedron p;
> Skin_surface_3 skin_surface(list.begin(), list.end());
> CGAL::mesh_skin_surface_3(skin_surface, p);
> CGAL::subdivide_skin_surface_mesh_3(skin_surface, p, 1);
>
> std::cout << "Mesh has " << p.size_of_facets() << " facets" << std::endl;
>
> return 0;
> }

I compile it against CGAL-3.9 on a x86_64 Mac OS 10.7 system, with Apple's
default G++ 4.2.1 compiler. Boost is 1.46.1, GMP is 5.0.2, MPFR is 3.1.0 (+
available patches). The compilation command-line is:

> g++ bug.cpp -I/opt/CGAL-3.9/include -I/opt/boost-1.46.1/include
> -L/opt/CGAL-3.9/lib -lCGAL -L/opt/boost-1.46.1/lib -lboost_thread -lmpfr
> -lgmp -frounding-math && ./a.out


I hope you can help me understand what's going wrong, and whether I used the
CGAL functions right (I tried to stick to the examples as much as possible).

Thanks in advance,
FX Coudert



PS: the CGAL doc says that GMP and MPFR are recommended, implying that
building without them is possible. However, when I tried to do so, the build
system complains that CGAL_Core depends on GMP, and compilation will not
succeed. Did I miss something?


Archive powered by MHonArc 2.6.16.

Top of Page