Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] segmentation fault in polyhedral_complex_mesh_domain

Subject: CGAL users discussion list

List archive

[cgal-discuss] segmentation fault in polyhedral_complex_mesh_domain


Chronological Thread 
  • From: Conny <>
  • To:
  • Subject: [cgal-discuss] segmentation fault in polyhedral_complex_mesh_domain
  • Date: Wed, 14 Aug 2019 08:17:22 -0500 (CDT)
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Neutral ; spf=Pass
  • Ironport-phdr: 9a23:FdP0QRzAJg2YOkXXCy+O+j09IxM/srCxBDY+r6Qd1OoeIJqq85mqBkHD//Il1AaPAdyBrase26GL7ejJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglVmjaxe65+IAu1oAnetsQbgJZpJ7osxBfOvnZGYfldy3lyJVKUkRb858Ow84Bm/i9Npf8v9NNOXLvjcaggQrNWEDopM2Yu5M32rhbDVheA5mEdUmoNjBVFBRXO4QzgUZfwtiv6sfd92DWfMMbrQ704RSiu4qF2QxLulSwJNSM28HvPh8J+jKxVvhGvqQFwzIHIb4+YL+Z+c6HBcd8GWWZNQthdWipcCY28dYsPCO8BMP5Goon6oVsOqxu/DhSrCezu1DBIgH720rcg3+olCw7G3RAgEMwVvXXUttr1NKASUeevwKbV0zrOdvVb0irz5ojPdxAuu/CMXbRofMrX00YgDBjKjlGOpoD/IzyV0eENvm6G5ORjTeKik3MrpgV1rzS1yMohiZPFi4EUx1ze9Ch0wYA4LsCiRkFhe96rCp5QujmaN4RoRsMiRHlluCA1x7Ecv560ZjMFx48jxxHBcfCIb4+I4hf7WOaQJzd3mm5ldaqiixu29UWs0OPxW8qu3FtJrydJiNjBu3EV2xzW8MeHS/99/km72TaI0gDe8uBLLl4ylaraMZEt2Lo+mYASsUTfACD7g0X3g7WWdkUj/eik8fnobav+qp+GK4B0kh3+MrgpmsGnHes4PRIBX2yC9euh1b3j5lH2QKhRjv0tiaTZq5DbJcEDpqGjGQNV04Aj6wy+Dzi8ytgYk2MHfxp5f0eMgIHtfl3PO/vlFuyXglK2kT4tyeqVEKfmB8DmKX7Fgf+1Tbt76kca6gMy0d139ptUDbZHLP+lCRy5j8DREhJsa1/8+O3gEtgojtpCC1LKObeQNebpiXHN/vgmerHedYYVvzG7J/V3v6e/3098okcUeOyS5bVSbXm5Gvp8JEDAOSj9i9cGFiEGs1hkFbG4uBi5STdWIk2Kcec86zU8Ud/0C9uFQImniriMmiy8G88Paw==

Hello,

I'm trying to generate a 3D mesh from a polyhedral complex. When I run the
code I get a segmentation fault. Any idea what might be causing this?
When I run the code without a call to detect_features it works fine.

Thanks in advance

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

#include <cstdlib>

// Domain
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::FT FT;
typedef CGAL::Mesh_polyhedron_3<K>::type Polyhedron;
typedef CGAL::Polyhedral_complex_mesh_domain_3<K> Mesh_domain;

#ifdef CGAL_CONCURRENT_MESH_3
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
typedef K::Point_3 Point;
typedef std::vector<std::vector&lt;Point> > Polylines;

// Triangulation
typedef
CGAL::Mesh_triangulation_3<Mesh_domain,CGAL::Default,Concurrency_tag>::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
Mesh_criteria;
typedef CGAL::Mesh_constant_domain_field_3<Mesh_domain::R,
Mesh_domain::Index> Sizing_field;

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

const char* const filenames[] = {
"data/patch1_a.off",
"data/patch1_b.off",
"data/patch2_a.off",
"data/patch2_b.off",
"data/patch3_a.off",
"data/patch3_b.off",
"data/layer1_a.off",
"data/layer1_b.off",
"data/layer2_a.off",
"data/layer2_b.off",
"data/fault_a.off",
"data/fault_b.off",
"data/fault_c.off",
"data/fault_d.off",
"data/fault_e.off",
};

const std::pair<int, int> incident_subdomains[] = {
std::make_pair(1, 0),
std::make_pair(2, 0),
std::make_pair(3, 0),
std::make_pair(4, 0),
std::make_pair(5, 0),
std::make_pair(6, 0),
std::make_pair(1, 3),
std::make_pair(2, 4),
std::make_pair(3, 5),
std::make_pair(4, 6),
std::make_pair(5, 6),
std::make_pair(3, 6),
std::make_pair(3, 4),
std::make_pair(1, 4),
std::make_pair(1, 2),
};

int main()
{
const std::size_t nb_patches = sizeof(filenames) / sizeof(const char*);
CGAL_assertion(sizeof(incident_subdomains) ==
nb_patches * sizeof(std::pair<int, int>));
std::vector<Polyhedron> patches(nb_patches);
for(std::size_t i = 0; i < nb_patches; ++i) {
std::ifstream input(filenames[i]);
if(!(input >> patches[i])) {
std::cerr << "Error reading " << filenames[i] << " as a
polyhedron!\n";
return EXIT_FAILURE;
}
}

// Create domain
Mesh_domain domain(patches.begin(), patches.end(),
incident_subdomains, incident_subdomains+nb_patches);

domain.detect_features();

// Mesh criteria
Mesh_criteria criteria(edge_size = 50,
facet_angle = 20, facet_size = 50, facet_distance =
0.5,
cell_radius_edge_ratio = 4, cell_size = 100);

// Mesh generation
std::cout << "Start meshing..." << std::endl;

C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria);

// Output
std::ofstream medit_file("out.mesh");
c3t3.output_to_medit(medit_file);

return EXIT_SUCCESS;
}


data.zip <http://cgal-discuss.949826.n4.nabble.com/file/t376108/data.zip>



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/


  • [cgal-discuss] segmentation fault in polyhedral_complex_mesh_domain, Conny, 08/14/2019

Archive powered by MHonArc 2.6.18.

Top of Page