Subject: CGAL users discussion list
List archive
- From: Ram <>
- To:
- Subject: [cgal-discuss] Example program crash question
- Date: Mon, 16 Jan 2012 18:36:44 -0800 (PST)
In section 50.3.2 3D Polyhedral Domains (of the manual) the following code
is given :
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Mesh_triangulation_3.h>
#include <CGAL/Mesh_complex_3_in_triangulation_3.h>
#include <CGAL/Mesh_criteria_3.h>
#include <CGAL/Polyhedral_mesh_domain_3.h>
#include <CGAL/make_mesh_3.h>
#include <CGAL/refine_mesh_3.h>
// IO
#include <CGAL/IO/Polyhedron_iostream.h>
// Domain
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Polyhedron_3<K> Polyhedron;
typedef CGAL::Polyhedral_mesh_domain_3<Polyhedron, K> Mesh_domain;
// Triangulation
typedef CGAL::Mesh_triangulation_3<Mesh_domain>::type Tr;
typedef CGAL::Mesh_complex_3_in_triangulation_3<Tr> C3t3;
// Criteria
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
// To avoid verbose function and named parameters call
using namespace CGAL::parameters;
int main()
{
// Create input polyhedron
Polyhedron polyhedron;
std::ifstream input("data/elephant.off");
input >> polyhedron;
// Create domain
Mesh_domain domain(polyhedron);
// Mesh criteria (no cell_size set)
Mesh_criteria criteria(facet_angle=25, facet_size=0.15,
facet_distance=0.008,
cell_radius_edge=3);
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_perturb(),
no_exude());
// Output
std::ofstream medit_file("out_1.mesh");
c3t3.output_to_medit(medit_file);
medit_file.close();
// Set tetrahedron size (keep cell_radius_edge), ignore facets
Mesh_criteria new_criteria(cell_radius_edge=3, cell_size=0.03);
// Mesh refinement
CGAL::refine_mesh_3(c3t3, domain, new_criteria);
// Output
medit_file.open("out_2.mesh");
c3t3.output_to_medit(medit_file);
return 0;
}
================================================================
If I just feed it the following ".off" file:
OFF
8 6 0
0 1 0
0 0 0
0 0 1
1 0 0
1 0 1
0 1 1
1 1 0
1 1 1
4 3 4 2 1
4 0 6 3 1
4 6 0 5 7
4 5 0 1 2
4 7 5 2 4
4 7 4 3 6
It crashes. GDB gives me this cryptic error:
Program received signal SIGSEGV, Segmentation fault.
0x000000000050307f in
CGAL::Triangulation_data_structure_3<CGAL::Mesh_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick>
>, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3<CGAL::Epick,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int>
>, CGAL::Epick, CGAL::Triangle_accessor_3<CGAL::Polyhedron_3<CGAL::Epick,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int>
>, CGAL::Epick>, CGAL::Boolean_tag<false>, CGAL::Boolean_tag<true> >,
CGAL::Triangulation_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick>
>, CGAL::Triangulation_ds_vertex_base_3<void> > >,
CGAL::Mesh_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick>
>, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3<CGAL::Epick,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int>
>, CGAL::Epick, CGAL::Triangle_accessor_3<CGAL::Polyhedron_3<CGAL::Epick,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int>
>, CGAL::Epick>, CGAL::Boolean_tag<false>, CGAL::Boolean_tag<true> >,
CGAL::Regular_triangulation_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick>
>,
CGAL::Triangulation_cell_base_with_circumcenter_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick>
>, CGAL::Triangulation_ds_cell_base_3<void> >,
std::list<CGAL::Weighted_point<CGAL::Point_3<CGAL::Epick>, double>,
std::allocator<CGAL::Weighted_point<CGAL::Point_3<CGAL::Epick>,
double> > > > >
>::create_star_3(CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Mesh_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick>
>, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3<CGAL::Epick,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int>
>, CGAL::Epick, CGAL::Triangle_accessor_3<CGAL::Polyhedron_3<CGAL::Epick,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int>
>, CGAL::Epick>, CGAL::Boolean_tag<false>, CGAL::Boolean_tag<true> >,
CGAL::Triangulation_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick>
>,
CGAL::Triangulation_ds_vertex_base_3<CGAL::Triangulation_data_structure_3<CGAL::Mesh_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick>
>, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3<CGAL::Epick,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int>
>, CGAL::Epick, CGAL::Triangle_accessor_3<CGAL::Polyhedron_3<CGAL::Epick,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int>
>, CGAL::Epick>, CGAL::Boolean_tag<false>, CGAL::Boolean_tag<true> >,
CGAL::Triangulation_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick>
>, CGAL::Triangulation_ds_vertex_base_3<void> > >,
CGAL::Mesh_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick>
>, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3<CGAL::Epick,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int>
>, CGAL::Epick, CGAL::Triangle_accessor_3<CGAL::Polyhedron_3<CGAL::Epick,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int>
>, CGAL::Epick>, CGAL::Boolean_tag<false>, CGAL::Boolean_tag<true> >,
CGAL::Regular_triangulation_cell_base_3<CGAL::Robust_weighted_circumcenter_filtere---Type
<return> to continue, or q <return> to quit---
d_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick> >,
CGAL::Triangulation_cell_base_with_circumcenter_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick>
>, CGAL::Triangulation_ds_cell_base_3<void> >,
std::list<CGAL::Weighted_point<CGAL::Point_3<CGAL::Epick>, double>,
std::allocator<CGAL::Weighted_point<CGAL::Point_3<CGAL::Epick>,
double> > > > > > > > >, CGAL::Default>, false>,
CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Mesh_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick>
>, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3<CGAL::Epick,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int>
>, CGAL::Epick, CGAL::Triangle_accessor_3<CGAL::Polyhedron_3<CGAL::Epick,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int>
>, CGAL::Epick>, CGAL::Boolean_tag<false>, CGAL::Boolean_tag<true> >,
CGAL::Regular_triangulation_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick>
>,
CGAL::Triangulation_cell_base_with_circumcenter_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick>
>,
CGAL::Triangulation_ds_cell_base_3<CGAL::Triangulation_data_structure_3<CGAL::Mesh_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick>
>, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3<CGAL::Epick,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int>
>, CGAL::Epick, CGAL::Triangle_accessor_3<CGAL::Polyhedron_3<CGAL::Epick,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int>
>, CGAL::Epick>, CGAL::Boolean_tag<false>, CGAL::Boolean_tag<true> >,
CGAL::Triangulation_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick>
>, CGAL::Triangulation_ds_vertex_base_3<void> > >,
CGAL::Mesh_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick>
>, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3<CGAL::Epick,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int>
>, CGAL::Epick, CGAL::Triangle_accessor_3<CGAL::Polyhedron_3<CGAL::Epick,
CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator<int>
>, CGAL::Epick>, CGAL::Boolean_tag<false>, CGAL::Boolean_tag<true> >,
CGAL::Regular_triangulation_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick>
>,
CGAL::Triangulation_cell_base_with_circumcenter_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3<CGAL::Mesh_3::Robust_intersection_traits_3<CGAL::Epick>
>, CGAL::Triangulation_ds_cell_base_3<void> >,
std::list<CGAL::Weighted_point<CGAL::Point_3<CGAL::Epick>, double>,
std::allocator<CGAL::Weighted_point<CGAL::Point_3<CGAL::Epick>,
double> > > > > > > >,
std::list<CGAL::Weighted_point<CGAL::Point_3<CGAL::Epick>, double>,
std::allocator<CGAL::Weighted_point<CGAL::Point_3<CGAL::Epick>,
double> > > > >, CGAL::Default>, false>, int, int) ()
(gdb)
======================================================
Any ideas what I'm doing wrong? How can I get CGAL to output something
better as far as the crash report is concerned?
Thanks,
--Ram
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Example-program-crash-question-tp4302227p4302227.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Example program crash question, Ram, 01/17/2012
- Re: [cgal-discuss] Example program crash question, Laurent Rineau (GeometryFactory), 01/17/2012
- [cgal-discuss] Re: Example program crash question, Ram, 01/17/2012
- Re: [cgal-discuss] Re: Example program crash question, Laurent Rineau (GeometryFactory), 01/18/2012
- [cgal-discuss] Re: Example program crash question, Ram, 01/17/2012
- Re: [cgal-discuss] Example program crash question, Laurent Rineau (GeometryFactory), 01/17/2012
Archive powered by MHonArc 2.6.16.