Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] CGAL-Bindings (Python): Mesh_3 examples

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] CGAL-Bindings (Python): Mesh_3 examples


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] CGAL-Bindings (Python): Mesh_3 examples
  • Date: Fri, 22 May 2015 11:26:34 +0200
  • Organization: GeometryFactory

The only thing that is missing is the mesh domain class (similar to the one define in Mesh_domains.h) that can handle segmented images.
Then you need to update the interface file and duplicate the calls to
declare_global_functions_domain and declare_global_functions_domain_criteria to be used with this mesh domain.

Sebastien.

PS:
The dedicated mailing list for cgal-bindings is


On 05/21/2015 11:21 AM, Joaquin Correa wrote:
Hi folks, is there a cgal-python-bindings implementation for Mesh_3
examples, particularly
http://doc.cgal.org/latest/Mesh_3/Mesh_3_2mesh_3D_image_8cpp-example.html?
I've been trying to get started on it but it seems that not all classes
are exposed via swig,
|Exact_predicates_inexact_constructions_kernel| and |Mesh_Domain| have
to be defined but are not part of the |CGAL.CGAL_Mesh_3| module. Thank you.

mesh_3D_image.cpp:

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

// Domain
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Labeled_image_mesh_domain_3<CGAL::Image_3,K> Mesh_domain;

// Triangulation
#ifdef CGAL_CONCURRENT_MESH_3
typedef CGAL::Mesh_triangulation_3<
Mesh_domain,
CGAL::Kernel_traits<Mesh_domain>::Kernel, // Same as sequential
CGAL::Parallel_tag // Tag to activate
parallelism
>::typeTr;
#else
typedef CGAL::Mesh_triangulation_3<Mesh_domain>::typeTr;
#endif
typedef CGAL::Mesh_complex_3_in_triangulation_3<Tr> C3t3;

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

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

int main()
{
// Loads image
CGAL::Image_3 image;
image.read("data/liver.inr.gz");

// Domain
Mesh_domain domain(image);

// Mesh criteria
Mesh_criteria criteria(facet_angle=30, facet_size=6,
facet_distance=4,
cell_radius_edge_ratio=3, cell_size=8);

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

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

return 0;
}|






Archive powered by MHonArc 2.6.18.

Top of Page