Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] CGAL 4.5 beta1: Problems meshing off file

Subject: CGAL users discussion list

List archive

[cgal-discuss] CGAL 4.5 beta1: Problems meshing off file


Chronological Thread 
  • From: Benjamin Kehlet <>
  • To: cgal-discuss <>
  • Subject: [cgal-discuss] CGAL 4.5 beta1: Problems meshing off file
  • Date: Tue, 2 Sep 2014 03:06:42 +0200

Hello CGAL people!

I have been running the test suite of my mesh generation tool for
FEniCS with CGAL 4.5-beta1 and I get one error:

When trying to mesh the demo/Polyhedron/data/rotor.off with the
attached program I get the following error message

benjamik@benjamik-ThinkPad-X300:~/tmp/cgal-meshing/build$ ./main
~/software/CGAL-4.5-beta1/demo/Polyhedron/data/rotor.off
Inserting protection balls...
refine_balls = true
min_balls_radius = 0
min_balls_weight = 0
insert_corners() done. Nb of points in triangulation: 4
insert_balls_on_edges() done. Nb of points in triangulation: 350
refine_balls() done. Nb of points in triangulation: 784
Point p[0.225806 0.421836 0.0134309], dim=1 and q[0.225806 0.419777
0.0312588], dim=1 form an edge but do not intersect !
terminate called after throwing an instance of 'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: minimal_size_ > 0 || c3t3_.is_valid()
File:
/home/benjamik/software/cgal-4.5-install/include/CGAL/Mesh_3/Protect_edges_sizing_field.h
Line: 370
Aborted (core dumped)

This is with a debug build of CGAL 4.5 beta1 on 32 bit Ubuntu 14.04
with gcc 4.8.2

Regards

Benjamin Kehlet
#define CGAL_NO_DEPRECATED_CODE
#define CGAL_MESH_3_VERBOSE

#define CGAL_MESH_3_NO_DEPRECATED_SURFACE_INDEX
#define CGAL_MESH_3_NO_DEPRECATED_C3T3_ITERATORS


#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_with_features_3.h>
#include <CGAL/make_mesh_3.h>

// Domain
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Polyhedral_mesh_domain_with_features_3<K> Mesh_domain;
typedef CGAL::Mesh_polyhedron_3<K>::type MeshPolyhedron_3;

// Triangulation
typedef CGAL::Mesh_triangulation_3<Mesh_domain>::type Tr;
typedef CGAL::Mesh_complex_3_in_triangulation_3<
Tr,Mesh_domain::Corner_index,Mesh_domain::Curve_segment_index> C3t3;

// Criteria
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;

// To avoid verbose function and named parameters call
using namespace CGAL::parameters;

int main(int argc, char** argv)
{
  // CGAL::default_random = CGAL::Random( atoi(argv[1]) );

  MeshPolyhedron_3 P;
  {
    std::ifstream infile(argv[1]);
    infile >> P;
  }

  CGAL_assertion(P.is_pure_triangle());

  // Create domain
  Mesh_domain domain(P);

  // Get sharp features
  domain.detect_features();

  const double cs = 0.071684;

  // Mesh criteria
  Mesh_criteria criteria(edge_size = cs,
                         facet_angle = 30, 
                         facet_size = cs, 
                         facet_distance = cs/10.0,
                         cell_radius_edge_ratio = 3, 
                         cell_size = cs);

  // Mesh generation
  C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria,
                                      CGAL::parameters::no_perturb(),
                                      CGAL::parameters::no_exude());
}


  • [cgal-discuss] CGAL 4.5 beta1: Problems meshing off file, Benjamin Kehlet, 09/02/2014

Archive powered by MHonArc 2.6.18.

Top of Page