Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] modifying mesh_polyhedral_domain_with_features.cpp to use polyline input

Subject: CGAL users discussion list

List archive

[cgal-discuss] modifying mesh_polyhedral_domain_with_features.cpp to use polyline input


Chronological Thread 
  • From: Michel Audette <>
  • To:
  • Subject: [cgal-discuss] modifying mesh_polyhedral_domain_with_features.cpp to use polyline input
  • Date: Mon, 20 Jun 2011 15:40:48 -0400

Dear CGAL developers,

in addition to the example discussed in the previous email, I'm also trying to adapt

mesh_polyhedral_domain_with_features.cpp

to use a polyline input. See below for the code...

What I'm seeing is

michel@michel-desktop:~/simProject/NeuroSurgSim/SimplexDecimationBuild/bin$ ./OffInputCGALFaithfulTetrahedralization
Inserting protection balls...
insert_corners() done. Nb of points in triangulation: 6475
insert_balls_on_edges() done. Nb of points in triangulation: 56353

refine_balls() done. Nb of points in triangulation: 96012

Start surface scan...end scan. [Bad facets:118902]

Refining Surface...
Legende of the following line: (#vertices,#steps,#facets to refine,#tets to refine)
(96012,0,118902,0)terminate called after throwing an instance of 'CGAL::Assertion_exception'
  what():  CGAL ERROR: assertion violation!
File: /usr/local/include/CGAL/Mesh_3/Refine_facets_3.h
Line: 572
Explanation: Mesh_3 ERROR: A facet is not in conflict with its refinement point!
Debugging informations:
  Facet: (0x3de4bc8, 3) = (0.4603 0.0655065 0.0235869 8.76589e-06, 0.1473 -0.243583 0.0730855 7.10822e-06, 0.1473 -0.243097 0.0758587 2.93938e-06)
  Dual: (0.463946 -0.246924 0.0751003 0, 1.37132e+11 -1.35076e+11 2.36732e+10 0)
  Refinement point: -0.04606 0.25555 -0.0122105 0

Aborted

The code seems to die in the before_insertion() call on line 336 of Mesher_level.h...

Thanks for your kind support.

Best wishes,

Michel

PS: This is the source code adapted from mesh_polyhedral_domain_with_features.cpp...

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Polyhedron_3<K> Polyhedron;
typedef CGAL::Mesh_domain_with_polyline_features_3<CGAL::Polyhedral_mesh_domain_3<Polyhedron, K> > Mesh_domain;   
 

  Polyhedron polyhedron;
  std::ifstream input("data/fandisk.off");
  input >> polyhedron;
  Mesh_domain domain(polyhedron); //argv[1]);

  Polylines polylines;
  Polyhedron::Edge_iterator itr_e;
  for(itr_e= polyhedron.edges_begin(); itr_e!= polyhedron.edges_end(); ++itr_e )
  {
    Polyline new_polyline;
    new_polyline.push_back(itr_e->vertex()->point());
    new_polyline.push_back(itr_e->opposite()->vertex()->point());
   
    // push the polyline (actually a segment) to the set of polylines
    polylines.push_back(new_polyline);
  }
  domain.add_features(polylines.begin(), polylines.end());

  // Mesh criteria
  Mesh_criteria criteria(edge_size = 0.025,
                         facet_angle = 25, facet_size = 0.05, facet_distance = 0.005,
                         cell_radius_edge_ratio = 3, cell_size = 0.05);
 
  // Mesh generation
  C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria,
                                      odt(time_limit=200),
                                      no_perturb(),
                                      exude(time_limit=200, sliver_bound=20));




--
Michel Audette, Ph.D.
R & D Engineer,
Kitware Inc.,
Chapel Hill, N.C.



  • [cgal-discuss] modifying mesh_polyhedral_domain_with_features.cpp to use polyline input, Michel Audette, 06/20/2011

Archive powered by MHonArc 2.6.16.

Top of Page