mirror of https://github.com/CGAL/cgal
update examples to the new API
This commit is contained in:
parent
54a6462273
commit
b0a144c6e7
|
|
@ -23,8 +23,7 @@ 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;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
int main(int argc, char*argv[])
|
||||
{
|
||||
|
|
@ -37,12 +36,12 @@ int main(int argc, char*argv[])
|
|||
}
|
||||
/// [Domain creation]
|
||||
Mesh_domain domain =
|
||||
Mesh_domain::create_gray_image_mesh_domain(image, iso_value = 2.9f, value_outside = 0.f);
|
||||
Mesh_domain::create_gray_image_mesh_domain(image, params::iso_value(2.9f).value_outside(0.f));
|
||||
/// [Domain creation]
|
||||
|
||||
// Mesh criteria
|
||||
Mesh_criteria criteria(facet_angle=30, facet_size=6, facet_distance=2,
|
||||
cell_radius_edge_ratio=3, cell_size=8);
|
||||
Mesh_criteria criteria(params::facet_angle(30).facet_size(6).facet_distance(2).
|
||||
cell_radius_edge_ratio(3).cell_size(8));
|
||||
|
||||
// Meshing
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria);
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@ 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;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
template <typename Set>
|
||||
struct Image_to_multiple_iso_level_sets {
|
||||
|
|
@ -63,18 +62,17 @@ int main(int argc, char*argv[])
|
|||
}
|
||||
|
||||
// Domain
|
||||
namespace p = CGAL::parameters;
|
||||
Mesh_domain domain =
|
||||
Mesh_domain::create_gray_image_mesh_domain
|
||||
(p::image = image,
|
||||
p::image_values_to_subdomain_indices =
|
||||
Image_to_multiple_iso_level_sets<Flat_set>(iso_values),
|
||||
p::value_outside = 0.f
|
||||
(params::image(image).
|
||||
image_values_to_subdomain_indices(
|
||||
Image_to_multiple_iso_level_sets<Flat_set>(iso_values)).
|
||||
value_outside(0.f)
|
||||
);
|
||||
|
||||
// Mesh criteria
|
||||
Mesh_criteria criteria(facet_angle=30, facet_size=6, facet_distance=2,
|
||||
cell_radius_edge_ratio=3, cell_size=8);
|
||||
Mesh_criteria criteria(params::facet_angle(30).facet_size(6).facet_distance(2).
|
||||
cell_radius_edge_ratio(3).cell_size(8));
|
||||
|
||||
// Meshing
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria);
|
||||
|
|
|
|||
|
|
@ -32,8 +32,7 @@ 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;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
|
@ -46,12 +45,12 @@ int main(int argc, char* argv[])
|
|||
}
|
||||
/// [Domain creation]
|
||||
Mesh_domain domain =
|
||||
Mesh_domain::create_gray_image_mesh_domain(image, iso_value = 2.9f, value_outside = 0.f);
|
||||
Mesh_domain::create_gray_image_mesh_domain(image, params::iso_value(2.9f).value_outside(0.f));
|
||||
/// [Domain creation]
|
||||
|
||||
/// [Mesh criteria]
|
||||
Mesh_criteria criteria(facet_angle = 30, facet_size = 6, facet_distance = 2,
|
||||
cell_radius_edge_ratio = 3, cell_size = 8);
|
||||
Mesh_criteria criteria(params::facet_angle(30).facet_size(6).facet_distance(2).
|
||||
cell_radius_edge_ratio(3).cell_size(8));
|
||||
|
||||
/// [Meshing]
|
||||
C3t3 c3t3;
|
||||
|
|
|
|||
|
|
@ -79,18 +79,17 @@ int main(int argc, char* argv[])
|
|||
return 0;
|
||||
}
|
||||
/// [Domain creation]
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
Mesh_domain domain = Mesh_domain::create_gray_image_mesh_domain
|
||||
(image,
|
||||
image_values_to_subdomain_indices = Less(iso),
|
||||
value_outside = 0);
|
||||
params::image_values_to_subdomain_indices(Less(iso)).
|
||||
value_outside(0));
|
||||
/// [Domain creation]
|
||||
|
||||
// Mesh criteria
|
||||
Mesh_criteria criteria(facet_angle=30, facet_size=fs, facet_distance=fd,
|
||||
cell_radius_edge_ratio=3, cell_size=cs);
|
||||
Mesh_criteria criteria(params::facet_angle(30).facet_size(fs).facet_distance(fd).
|
||||
cell_radius_edge_ratio(3).cell_size(cs));
|
||||
|
||||
// Meshing
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria);
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@ 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;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
|
@ -45,8 +44,8 @@ int main(int argc, char* argv[])
|
|||
/// [Domain creation]
|
||||
|
||||
// Mesh criteria
|
||||
Mesh_criteria criteria(facet_angle=30, facet_size=6, facet_distance=4,
|
||||
cell_radius_edge_ratio=3, cell_size=8);
|
||||
Mesh_criteria criteria(params::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);
|
||||
|
|
|
|||
|
|
@ -31,8 +31,7 @@ typedef CGAL::Mesh_criteria_3<Tr> 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;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
|
@ -55,8 +54,8 @@ int main(int argc, char* argv[])
|
|||
domain.index_from_subdomain_index(127));
|
||||
|
||||
// Mesh criteria
|
||||
Mesh_criteria criteria(facet_angle=30, facet_size=6, facet_distance=2,
|
||||
cell_radius_edge_ratio=3, cell_size=size);
|
||||
Mesh_criteria criteria(params::facet_angle(30).facet_size(6).facet_distance(2).
|
||||
cell_radius_edge_ratio(3).cell_size(size));
|
||||
|
||||
// Meshing
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria);
|
||||
|
|
|
|||
|
|
@ -31,8 +31,7 @@ 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;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
int main()
|
||||
{
|
||||
|
|
@ -44,8 +43,8 @@ int main()
|
|||
Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image);
|
||||
|
||||
// Mesh criteria
|
||||
Mesh_criteria criteria(facet_angle=30, facet_size=3, facet_distance=1,
|
||||
cell_radius_edge_ratio=3, cell_size=3);
|
||||
Mesh_criteria criteria(params::facet_angle(30).facet_size(3).facet_distance(1).
|
||||
cell_radius_edge_ratio(3).cell_size(3));
|
||||
|
||||
/// [Meshing]
|
||||
C3t3 c3t3;
|
||||
|
|
|
|||
|
|
@ -32,8 +32,7 @@ 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;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
/// [Add 1D features]
|
||||
#include "read_polylines.h"
|
||||
|
|
@ -92,9 +91,9 @@ int main(int argc, char* argv[])
|
|||
/// [Call add_1D_features]
|
||||
|
||||
/// Note that `edge_size` is needed with 1D-features [Mesh criteria]
|
||||
Mesh_criteria criteria(edge_size=6,
|
||||
facet_angle=30, facet_size=6, facet_distance=4,
|
||||
cell_radius_edge_ratio=3, cell_size=8);
|
||||
Mesh_criteria criteria(params::edge_size(6).
|
||||
facet_angle(30).facet_size(6).facet_distance(4).
|
||||
cell_radius_edge_ratio(3).cell_size(8));
|
||||
/// [Mesh criteria]
|
||||
|
||||
// Meshing
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@ using C3t3 = CGAL::Mesh_complex_3_in_triangulation_3<Tr>;
|
|||
// Criteria
|
||||
using Mesh_criteria = CGAL::Mesh_criteria_3<Tr>;
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
|
@ -45,13 +44,13 @@ int main(int argc, char* argv[])
|
|||
|
||||
Mesh_domain domain
|
||||
= Mesh_domain::create_labeled_image_mesh_domain(image,
|
||||
weights = img_weights,
|
||||
relative_error_bound = 1e-6);
|
||||
params::weights(img_weights).
|
||||
relative_error_bound(1e-6));
|
||||
/// [Domain creation]
|
||||
|
||||
// Mesh criteria
|
||||
Mesh_criteria criteria(facet_angle=30, facet_size=6, facet_distance=0.5,
|
||||
cell_radius_edge_ratio=3, cell_size=8);
|
||||
Mesh_criteria criteria(params::facet_angle(30).facet_size(6).facet_distance(0.5).
|
||||
cell_radius_edge_ratio(3).cell_size(8));
|
||||
|
||||
/// [Meshing]
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
// IO
|
||||
#include <CGAL/IO/File_medit.h>
|
||||
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
// Domain
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
|
||||
|
|
@ -76,18 +76,18 @@ int main()
|
|||
Mesh_domain domain(Function_wrapper(v, vps), K::Sphere_3(CGAL::ORIGIN, 5.*5.));
|
||||
|
||||
// Set mesh criteria
|
||||
Mesh_criteria criteria(edge_size = 0.15,
|
||||
facet_angle = 30, facet_size = 0.2,
|
||||
cell_radius_edge_ratio = 2, cell_size = 0.4);
|
||||
Mesh_criteria criteria(params::edge_size(0.15).
|
||||
facet_angle(30).facet_size(0.2).
|
||||
cell_radius_edge_ratio(2).cell_size(0.4));
|
||||
|
||||
// Mesh generation
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_exude(), no_perturb());
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, params::no_exude().no_perturb());
|
||||
|
||||
// Perturbation (maximum cpu time: 10s, targeted dihedral angle: default)
|
||||
CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10);
|
||||
CGAL::perturb_mesh_3(c3t3, domain, params::time_limit(10));
|
||||
|
||||
// Exudation
|
||||
CGAL::exude_mesh_3(c3t3,time_limit=12);
|
||||
CGAL::exude_mesh_3(c3t3,params::time_limit(12));
|
||||
|
||||
// Output
|
||||
std::ofstream medit_file("out_cubes_intersection.mesh");
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
// IO
|
||||
#include <CGAL/IO/File_medit.h>
|
||||
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
// Domain
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
|
||||
|
|
@ -163,18 +163,18 @@ int main()
|
|||
domain.add_features(polylines.begin(),polylines.end());
|
||||
|
||||
// Set mesh criteria
|
||||
Mesh_criteria criteria(edge_size = 0.15,
|
||||
facet_angle = 30, facet_size = 0.2,
|
||||
cell_radius_edge_ratio = 2, cell_size = 0.4);
|
||||
Mesh_criteria criteria(params::edge_size(0.15).
|
||||
facet_angle(30).facet_size(0.2).
|
||||
cell_radius_edge_ratio(2).cell_size(0.4));
|
||||
|
||||
// Mesh generation
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_exude(), no_perturb());
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, params::no_exude().no_perturb());
|
||||
|
||||
// Perturbation (maximum cpu time: 10s, targeted dihedral angle: default)
|
||||
CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10);
|
||||
CGAL::perturb_mesh_3(c3t3, domain, params::time_limit(10));
|
||||
|
||||
// Exudation
|
||||
CGAL::exude_mesh_3(c3t3,CGAL::parameters::time_limit = 12);
|
||||
CGAL::exude_mesh_3(c3t3, params::time_limit(12));
|
||||
|
||||
// Output
|
||||
std::ofstream medit_file("out_cubes_intersection_with_features.mesh");
|
||||
|
|
|
|||
|
|
@ -190,8 +190,7 @@ FT sphere_centered_at_111 (const Point& p)
|
|||
return dx*dx+dy*dy+dz*dz-1;
|
||||
}
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
int main()
|
||||
{
|
||||
|
|
@ -239,7 +238,7 @@ int main()
|
|||
|
||||
// Mesh generation (without optimization)
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria,
|
||||
no_perturb(), no_exude());
|
||||
params::no_perturb().no_exude());
|
||||
|
||||
// Output
|
||||
dump_c3t3(c3t3, "out");
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
// IO
|
||||
#include <CGAL/IO/File_medit.h>
|
||||
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
#ifdef CGAL_CONCURRENT_MESH_3
|
||||
typedef CGAL::Parallel_tag Concurrency_tag;
|
||||
|
|
@ -50,7 +50,7 @@ int main()
|
|||
|
||||
// Domain (Warning: Sphere_3 constructor uses square radius !)
|
||||
Mesh_domain domain(Function_wrapper(v), K::Sphere_3(CGAL::ORIGIN, 5.*5.),
|
||||
CGAL::parameters::relative_error_bound(1e-6));
|
||||
params::relative_error_bound(1e-6));
|
||||
|
||||
// Set mesh criteria
|
||||
Facet_criteria facet_criteria(30, 0.2, 0.02); // angle, size, approximation
|
||||
|
|
@ -58,13 +58,13 @@ int main()
|
|||
Mesh_criteria criteria(facet_criteria, cell_criteria);
|
||||
|
||||
// Mesh generation
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_exude(), no_perturb());
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, params::no_exude().no_perturb());
|
||||
|
||||
// Perturbation (maximum cpu time: 10s, targeted dihedral angle: default)
|
||||
CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10);
|
||||
CGAL::perturb_mesh_3(c3t3, domain, params::time_limit(10));
|
||||
|
||||
// Exudation
|
||||
CGAL::exude_mesh_3(c3t3, time_limit=12);
|
||||
CGAL::exude_mesh_3(c3t3, params::time_limit(12));
|
||||
|
||||
// Output
|
||||
std::ofstream medit_file("out.mesh");
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ int main()
|
|||
namespace params = CGAL::parameters;
|
||||
Mesh_domain domain(Function_wrapper(v, vps),
|
||||
K::Sphere_3(CGAL::ORIGIN,5.*5.),
|
||||
params::relative_error_bound = 1e-6);
|
||||
params::relative_error_bound(1e-6));
|
||||
/// [Domain creation]
|
||||
|
||||
// Set mesh criteria
|
||||
|
|
@ -56,13 +56,13 @@ int main()
|
|||
Mesh_criteria criteria(facet_criteria, cell_criteria);
|
||||
|
||||
// Mesh generation
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, params::no_exude(), params::no_perturb());
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, params::no_exude().no_perturb());
|
||||
|
||||
// Perturbation (maximum cpu time: 10s, targeted dihedral angle: default)
|
||||
CGAL::perturb_mesh_3(c3t3, domain, params::time_limit = 10);
|
||||
CGAL::perturb_mesh_3(c3t3, domain, params::time_limit(10));
|
||||
|
||||
// Exudation
|
||||
CGAL::exude_mesh_3(c3t3,12);
|
||||
CGAL::exude_mesh_3(c3t3, params::time_limit(12));
|
||||
|
||||
// Output
|
||||
std::ofstream medit_file("out.mesh");
|
||||
|
|
|
|||
|
|
@ -35,8 +35,7 @@ FT ellipsoid_function (const Point& p)
|
|||
return x2+2*y2+4*z2-1;
|
||||
}
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
int main()
|
||||
{
|
||||
|
|
@ -51,7 +50,7 @@ int main()
|
|||
Mesh_criteria criteria(facet_criteria, cell_criteria);
|
||||
|
||||
// Mesh generation (without optimization)
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_perturb(), no_exude());
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, params::no_perturb().no_exude());
|
||||
|
||||
// Output
|
||||
std::ofstream medit_file("out_wo.mesh");
|
||||
|
|
@ -59,7 +58,7 @@ int main()
|
|||
medit_file.close();
|
||||
|
||||
// Perturbation (5s, 12degree)
|
||||
CGAL::perturb_mesh_3(c3t3, domain, time_limit=5, sliver_bound=12);
|
||||
CGAL::perturb_mesh_3(c3t3, domain, params::time_limit(5).sliver_bound(12));
|
||||
|
||||
// Exudation
|
||||
CGAL::exude_mesh_3(c3t3);
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@ 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;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
// Function
|
||||
FT sphere_function (const Point& p)
|
||||
|
|
@ -44,8 +43,8 @@ int main()
|
|||
/// [Domain creation]
|
||||
|
||||
// Mesh criteria
|
||||
Mesh_criteria criteria(facet_angle=30, facet_size=0.1, facet_distance=0.025,
|
||||
cell_radius_edge_ratio=2, cell_size=0.1);
|
||||
Mesh_criteria criteria(params::facet_angle(30).facet_size(0.1).facet_distance(0.025).
|
||||
cell_radius_edge_ratio(2).cell_size(0.1));
|
||||
|
||||
// Mesh generation
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria);
|
||||
|
|
|
|||
|
|
@ -42,8 +42,7 @@ struct Spherical_sizing_field
|
|||
}
|
||||
};
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
// Function
|
||||
FT sphere_function (const Point& p)
|
||||
|
|
@ -52,7 +51,6 @@ FT sphere_function (const Point& p)
|
|||
int main()
|
||||
{
|
||||
/// [Domain creation] (Warning: Sphere_3 constructor uses squared radius !)
|
||||
namespace p = CGAL::parameters;
|
||||
Mesh_domain domain = Mesh_domain::create_implicit_mesh_domain
|
||||
(sphere_function, K::Sphere_3(CGAL::ORIGIN, 2.)
|
||||
);
|
||||
|
|
@ -60,11 +58,11 @@ int main()
|
|||
|
||||
// Mesh criteria
|
||||
Spherical_sizing_field size;
|
||||
Mesh_criteria criteria(facet_angle=30, facet_size=0.1, facet_distance=0.025,
|
||||
cell_radius_edge_ratio=2, cell_size=size);
|
||||
Mesh_criteria criteria(params::facet_angle(30).facet_size(0.1).facet_distance(0.025).
|
||||
cell_radius_edge_ratio(2).cell_size(size));
|
||||
|
||||
// Mesh generation
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_exude(), no_perturb());
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, params::no_exude().no_perturb());
|
||||
|
||||
// Output
|
||||
std::ofstream medit_file("out.mesh");
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3<Tr> C3t3;
|
|||
// Mesh Criteria
|
||||
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
|
@ -42,20 +41,20 @@ int main(int argc, char* argv[])
|
|||
Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image);
|
||||
|
||||
// Mesh criteria
|
||||
Mesh_criteria criteria(facet_angle=30, facet_size=5, facet_distance=1.5,
|
||||
cell_radius_edge_ratio=2, cell_size=7);
|
||||
Mesh_criteria criteria(params::facet_angle(30).facet_size(5).facet_distance(1.5).
|
||||
cell_radius_edge_ratio(2).cell_size(7));
|
||||
|
||||
// Mesh generation and optimization in one call (sliver_bound is the
|
||||
// targeted dihedral angle in degrees)
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria,
|
||||
no_exude(),
|
||||
perturb(sliver_bound=10, time_limit=15));
|
||||
params::no_exude().
|
||||
perturb(params::sliver_bound(10).time_limit(15)));
|
||||
|
||||
// Mesh generation and optimization in several call
|
||||
C3t3 c3t3_bis = CGAL::make_mesh_3<C3t3>(domain, criteria,
|
||||
no_perturb(), no_exude());
|
||||
params::no_perturb().no_exude());
|
||||
|
||||
CGAL::perturb_mesh_3(c3t3_bis, domain, time_limit=15);
|
||||
CGAL::perturb_mesh_3(c3t3_bis, domain, params::time_limit(15));
|
||||
|
||||
// Output
|
||||
std::ofstream medit_file("out.mesh");
|
||||
|
|
@ -68,3 +67,4 @@ int main(int argc, char* argv[])
|
|||
|
||||
return 0;
|
||||
}
|
||||
.
|
||||
|
|
@ -26,8 +26,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3<Tr> C3t3;
|
|||
// Mesh Criteria
|
||||
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
int main(int argc, char*argv[])
|
||||
{
|
||||
|
|
@ -41,21 +40,21 @@ int main(int argc, char*argv[])
|
|||
Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image);
|
||||
|
||||
// Mesh criteria
|
||||
Mesh_criteria criteria(facet_angle=30, facet_distance=1.2,
|
||||
cell_radius_edge_ratio=2);
|
||||
Mesh_criteria criteria(params::facet_angle(30).facet_distance(1.2).
|
||||
cell_radius_edge_ratio(2));
|
||||
|
||||
// Mesh generation and optimization in one call
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria,
|
||||
lloyd(time_limit=30),
|
||||
no_perturb(),
|
||||
exude(time_limit=10, sliver_bound=10));
|
||||
params::lloyd(params::time_limit(30)).
|
||||
no_perturb().
|
||||
exude(params::time_limit(10).sliver_bound(10)));
|
||||
|
||||
// Mesh generation and optimization in several call
|
||||
C3t3 c3t3_bis = CGAL::make_mesh_3<C3t3>(domain, criteria,
|
||||
no_perturb(), no_exude());
|
||||
params::no_perturb().no_exude());
|
||||
|
||||
CGAL::lloyd_optimize_mesh_3(c3t3_bis, domain, time_limit=30);
|
||||
CGAL::exude_mesh_3(c3t3_bis, sliver_bound=10, time_limit=10);
|
||||
CGAL::lloyd_optimize_mesh_3(c3t3_bis, domain, params::time_limit(30));
|
||||
CGAL::exude_mesh_3(c3t3_bis, params::sliver_bound(10), params::time_limit(10));
|
||||
|
||||
// Output
|
||||
std::ofstream medit_file("out.mesh");
|
||||
|
|
|
|||
|
|
@ -31,8 +31,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3<
|
|||
// Criteria
|
||||
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
const char* const filenames[] = {
|
||||
"meshes/patch-01.off",
|
||||
|
|
@ -71,9 +70,9 @@ int main()
|
|||
domain.detect_features(); //includes detection of borders
|
||||
|
||||
// Mesh criteria
|
||||
Mesh_criteria criteria(edge_size = 8,
|
||||
facet_angle = 25, facet_size = 8, facet_distance = 0.2,
|
||||
cell_radius_edge_ratio = 3, cell_size = 10);
|
||||
Mesh_criteria criteria(params::edge_size(8).
|
||||
facet_angle(25).facet_size(8).facet_distance(0.2).
|
||||
cell_radius_edge_ratio(3).cell_size(10));
|
||||
|
||||
// Mesh generation
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria);
|
||||
|
|
|
|||
|
|
@ -33,8 +33,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3<
|
|||
// Criteria
|
||||
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
const char* const filenames[] = {
|
||||
"meshes/patch-01.off",
|
||||
|
|
@ -94,9 +93,9 @@ int main()
|
|||
domain.detect_features(); //includes detection of borders
|
||||
|
||||
// Mesh criteria
|
||||
Mesh_criteria criteria(edge_size = 8,
|
||||
facet_angle = 25, facet_size = 8, facet_distance = 0.2,
|
||||
cell_radius_edge_ratio = 3, cell_size = 10);
|
||||
Mesh_criteria criteria(params::edge_size(8).
|
||||
facet_angle(25).facet_size(8).facet_distance(0.2).
|
||||
cell_radius_edge_ratio(3).cell_size(10));
|
||||
|
||||
#ifdef CGAL_MESHING_STEPS_WITH_CIN
|
||||
std::cout << "Ready for mesh generation ? (y or n)";
|
||||
|
|
|
|||
|
|
@ -29,8 +29,7 @@ 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;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
int main(int argc, char*argv[])
|
||||
{
|
||||
|
|
@ -54,11 +53,11 @@ int main(int argc, char*argv[])
|
|||
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_ratio=3);
|
||||
Mesh_criteria criteria(params::facet_angle(25).facet_size(0.15).facet_distance(0.008).
|
||||
cell_radius_edge_ratio(3));
|
||||
|
||||
// Mesh generation
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_perturb(), no_exude());
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, params::no_perturb().no_exude());
|
||||
|
||||
// Output
|
||||
std::ofstream medit_file("out_1.mesh");
|
||||
|
|
@ -66,10 +65,10 @@ int main(int argc, char*argv[])
|
|||
medit_file.close();
|
||||
|
||||
// Set tetrahedron size (keep cell_radius_edge_ratio), ignore facets
|
||||
Mesh_criteria new_criteria(cell_radius_edge_ratio=3, cell_size=0.03);
|
||||
Mesh_criteria new_criteria(params::cell_radius_edge_ratio(3).cell_size(0.03));
|
||||
|
||||
// Mesh refinement (and make the output manifold)
|
||||
CGAL::refine_mesh_3(c3t3, domain, new_criteria, manifold());
|
||||
CGAL::refine_mesh_3(c3t3, domain, new_criteria, params::manifold());
|
||||
|
||||
// Output
|
||||
medit_file.open("out_2.mesh");
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@ 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;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
int main(int argc, char*argv[])
|
||||
{
|
||||
|
|
@ -53,11 +52,11 @@ int main(int argc, char*argv[])
|
|||
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_ratio=3);
|
||||
Mesh_criteria criteria(params::facet_angle(25).facet_size(0.15).facet_distance(0.008).
|
||||
cell_radius_edge_ratio(3));
|
||||
|
||||
// Mesh generation
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_perturb(), no_exude());
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, params::no_perturb().no_exude());
|
||||
|
||||
// Output
|
||||
std::ofstream medit_file("out_1.mesh");
|
||||
|
|
@ -65,7 +64,7 @@ int main(int argc, char*argv[])
|
|||
medit_file.close();
|
||||
|
||||
// Set tetrahedron size (keep cell_radius_edge_ratio), ignore facets
|
||||
Mesh_criteria new_criteria(cell_radius_edge_ratio=3, cell_size=0.03);
|
||||
Mesh_criteria new_criteria(params::cell_radius_edge_ratio(3).cell_size(0.03));
|
||||
|
||||
// Mesh refinement
|
||||
CGAL::refine_mesh_3(c3t3, domain, new_criteria);
|
||||
|
|
|
|||
|
|
@ -29,8 +29,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3<
|
|||
// Criteria
|
||||
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
int main(int argc, char*argv[])
|
||||
{
|
||||
|
|
@ -55,9 +54,9 @@ int main(int argc, char*argv[])
|
|||
domain.detect_features();
|
||||
|
||||
// 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_criteria criteria(params::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);
|
||||
|
|
|
|||
|
|
@ -30,8 +30,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3<
|
|||
// Criteria
|
||||
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
int main(int argc, char*argv[])
|
||||
{
|
||||
|
|
@ -56,9 +55,9 @@ int main(int argc, char*argv[])
|
|||
domain.detect_features();
|
||||
|
||||
// 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_criteria criteria(params::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);
|
||||
|
|
|
|||
|
|
@ -34,8 +34,7 @@ typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
|
|||
// Sizing field
|
||||
typedef CGAL::Mesh_3::Lipschitz_sizing<K, Mesh_domain, Mesh_domain::AABB_tree> Lip_sizing;
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
int main(int argc, char*argv[])
|
||||
{
|
||||
|
|
@ -69,12 +68,12 @@ int main(int argc, char*argv[])
|
|||
0.5); //max_size
|
||||
|
||||
// Mesh criteria
|
||||
Mesh_criteria criteria(edge_size = min_size,
|
||||
facet_angle = 25,
|
||||
facet_size = min_size,
|
||||
facet_distance = 0.005,
|
||||
cell_radius_edge_ratio = 3,
|
||||
cell_size = lip_sizing);
|
||||
Mesh_criteria criteria(params::edge_size(min_size).
|
||||
facet_angle(25).
|
||||
facet_size(min_size).
|
||||
facet_distance(0.005).
|
||||
cell_radius_edge_ratio(3).
|
||||
cell_size(lip_sizing));
|
||||
// Mesh generation
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria);
|
||||
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3<
|
|||
// Criteria
|
||||
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
int main(int argc, char*argv[])
|
||||
{
|
||||
|
|
@ -53,13 +52,16 @@ int main(int argc, char*argv[])
|
|||
domain.detect_features();
|
||||
|
||||
// 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_criteria criteria(params::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,
|
||||
no_perturb(), no_exude());
|
||||
params::no_perturb().no_exude());
|
||||
|
||||
std::cerr << t.time() << " sec." << std::endl;
|
||||
// Output
|
||||
|
|
|
|||
|
|
@ -37,8 +37,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3<
|
|||
// Criteria
|
||||
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
// Function
|
||||
FT sphere_function1 (const Point& p)
|
||||
|
|
@ -65,9 +64,11 @@ int main()
|
|||
K::Sphere_3(Point(1, 0, 0), 6.));
|
||||
|
||||
// Mesh criteria
|
||||
Mesh_criteria criteria(edge_size = 0.15,
|
||||
facet_angle = 25, facet_size = 0.15,
|
||||
cell_radius_edge_ratio = 2, cell_size = 0.15);
|
||||
Mesh_criteria criteria(params::edge_size(0.15).
|
||||
facet_angle(25).
|
||||
facet_size(0.15).
|
||||
cell_radius_edge_ratio(2).
|
||||
cell_size(0.15));
|
||||
|
||||
// Create edge that we want to preserve
|
||||
Polylines polylines (1);
|
||||
|
|
@ -85,7 +86,7 @@ int main()
|
|||
|
||||
// Mesh generation without feature preservation
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria,
|
||||
CGAL::parameters::no_features());
|
||||
params::no_features());
|
||||
|
||||
std::ofstream medit_file("out-no-protection.mesh");
|
||||
CGAL::IO::write_MEDIT(medit_file, c3t3);
|
||||
|
|
|
|||
|
|
@ -22,8 +22,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3<
|
|||
// Criteria
|
||||
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
int main()
|
||||
{
|
||||
|
|
@ -49,13 +48,13 @@ int main()
|
|||
domain.detect_features(); //includes detection of borders
|
||||
|
||||
// Mesh criteria
|
||||
Mesh_criteria criteria(edge_size = 0.025,
|
||||
facet_angle = 25,
|
||||
facet_size = 0.1,
|
||||
facet_distance = 0.001);
|
||||
Mesh_criteria criteria(params::edge_size(0.025).
|
||||
facet_angle(25).
|
||||
facet_size(0.1).
|
||||
facet_distance(0.001));
|
||||
|
||||
// Mesh generation
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_perturb(), no_exude());
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, params::no_perturb().no_exude());
|
||||
|
||||
// Output the facets of the c3t3 to an OFF file. The facets will not be
|
||||
// oriented.
|
||||
|
|
|
|||
|
|
@ -21,8 +21,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3<
|
|||
// Criteria
|
||||
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
int main()
|
||||
{
|
||||
|
|
@ -48,13 +47,13 @@ int main()
|
|||
domain.detect_features(); //includes detection of borders
|
||||
|
||||
// Mesh criteria
|
||||
Mesh_criteria criteria(edge_size = 0.025,
|
||||
facet_angle = 25,
|
||||
facet_size = 0.1,
|
||||
facet_distance = 0.001);
|
||||
Mesh_criteria criteria(params::edge_size(0.025).
|
||||
facet_angle(25).
|
||||
facet_size(0.1).
|
||||
facet_distance(0.001));
|
||||
|
||||
// Mesh generation
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_perturb(), no_exude());
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, params::no_perturb().no_exude());
|
||||
|
||||
// Output the facets of the c3t3 to an OFF file. The facets will not be
|
||||
// oriented.
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3<Tr> C3t3;
|
|||
typedef CGAL::Mesh_criteria_3<Tr> Periodic_mesh_criteria;
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
// Implicit functions
|
||||
FT sphere_function(const Point& p)
|
||||
|
|
@ -78,11 +78,11 @@ int main(int argc, char** argv)
|
|||
Multi_domain_wrapper multi_domain_function(funcs, vps);
|
||||
Periodic_mesh_domain domain(multi_domain_function, canonical_cube);
|
||||
|
||||
Periodic_mesh_criteria criteria(facet_angle = 30,
|
||||
facet_size = 0.04,
|
||||
facet_distance = 0.025,
|
||||
cell_radius_edge_ratio = 2.,
|
||||
cell_size = 0.04);
|
||||
Periodic_mesh_criteria criteria(params::facet_angle(30).
|
||||
facet_size(0.04).
|
||||
facet_distance(0.025).
|
||||
cell_radius_edge_ratio(2.).
|
||||
cell_size(0.04));
|
||||
|
||||
// Mesh generation
|
||||
C3t3 c3t3 = CGAL::make_periodic_3_mesh_3<C3t3>(domain, criteria);
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3<Tr> C3t3;
|
|||
typedef CGAL::Mesh_criteria_3<Tr> Periodic_mesh_criteria;
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
// Implicit function
|
||||
FT schwarz_p(const Point& p)
|
||||
|
|
@ -57,11 +57,11 @@ int main(int argc, char** argv)
|
|||
Periodic_mesh_domain domain =
|
||||
Periodic_mesh_domain::create_implicit_mesh_domain(schwarz_p, canonical_cube);
|
||||
|
||||
Periodic_mesh_criteria criteria(facet_angle = 30,
|
||||
facet_size = 0.035 * domain_size,
|
||||
facet_distance = 0.025 * domain_size,
|
||||
cell_radius_edge_ratio = 2.,
|
||||
cell_size = 0.05);
|
||||
Periodic_mesh_criteria criteria(params::facet_angle(30).
|
||||
facet_size(0.035 * domain_size).
|
||||
facet_distance(0.025 * domain_size).
|
||||
cell_radius_edge_ratio(2.).
|
||||
cell_size(0.05));
|
||||
|
||||
// Mesh generation
|
||||
C3t3 c3t3 = CGAL::make_periodic_3_mesh_3<C3t3>(domain, criteria);
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3<
|
|||
typedef CGAL::Mesh_criteria_3<Tr> Periodic_mesh_criteria;
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
// Implicit function
|
||||
static const FT cx = 0.51, cy = 0.51, cz = 0.5;
|
||||
|
|
@ -91,11 +91,11 @@ int main(int argc, char** argv)
|
|||
Periodic_function(cone_function, canonical_cube), canonical_cube);
|
||||
|
||||
// Mesh criteria
|
||||
Periodic_mesh_criteria criteria(edge_size = 0.02 * domain_size,
|
||||
facet_angle = 0.05 * domain_size,
|
||||
facet_size = 0.02 * domain_size,
|
||||
cell_radius_edge_ratio = 2,
|
||||
cell_size = 0.5);
|
||||
Periodic_mesh_criteria criteria(params::edge_size(0.02 * domain_size).
|
||||
facet_angle(0.05 * domain_size).
|
||||
facet_size(0.02 * domain_size).
|
||||
cell_radius_edge_ratio(2).
|
||||
cell_size(0.5));
|
||||
|
||||
// Create the features that we want to preserve
|
||||
Polylines polylines;
|
||||
|
|
@ -108,14 +108,18 @@ int main(int argc, char** argv)
|
|||
domain.add_corner(Point(0.51, 0.51, 0.5));
|
||||
|
||||
// Mesh generation WITHOUT feature preservation (and no optimizers)
|
||||
C3t3 c3t3 = CGAL::make_periodic_3_mesh_3<C3t3>(domain, criteria, no_features(),
|
||||
no_exude(), no_perturb());
|
||||
C3t3 c3t3 = CGAL::make_periodic_3_mesh_3<C3t3>(domain, criteria,
|
||||
params::no_features().
|
||||
no_exude().
|
||||
no_perturb());
|
||||
std::ofstream medit_file("output_implicit_shape_without_protection.mesh");
|
||||
CGAL::IO::output_periodic_mesh_to_medit(medit_file, c3t3, number_of_copies_in_output);
|
||||
|
||||
// Mesh generation WITH feature preservation (and no optimizers)
|
||||
C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3<C3t3>(domain, criteria, features(),
|
||||
no_exude(), no_perturb());
|
||||
C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3<C3t3>(domain, criteria,
|
||||
params::features().
|
||||
no_exude().
|
||||
no_perturb());
|
||||
std::ofstream medit_file_bis("output_implicit_shape_with_protection.mesh");
|
||||
CGAL::IO::output_periodic_mesh_to_medit(medit_file_bis, c3t3_bis, number_of_copies_in_output);
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3<Tr> C3t3;
|
|||
typedef CGAL::Mesh_criteria_3<Tr> Periodic_mesh_criteria;
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
// Implicit function
|
||||
FT double_p(const Point& p)
|
||||
|
|
@ -62,35 +62,37 @@ int main(int argc, char** argv)
|
|||
Periodic_mesh_domain domain =
|
||||
Periodic_mesh_domain::create_implicit_mesh_domain(double_p, canonical_cube);
|
||||
|
||||
Periodic_mesh_criteria criteria(facet_angle = 30,
|
||||
facet_size = 0.05 * domain_size,
|
||||
facet_distance = 0.025 * domain_size,
|
||||
cell_radius_edge_ratio = 2.,
|
||||
cell_size = 0.05);
|
||||
Periodic_mesh_criteria criteria(params::facet_angle(30).
|
||||
facet_size(0.05 * domain_size).
|
||||
facet_distance(0.025 * domain_size).
|
||||
cell_radius_edge_ratio(2.).
|
||||
cell_size(0.05));
|
||||
|
||||
// Mesh generation with optimizers
|
||||
C3t3 c3t3 = CGAL::make_periodic_3_mesh_3<C3t3>(domain, criteria,
|
||||
odt(convergence=0.03, freeze_bound=0.02, time_limit=30),
|
||||
lloyd(max_iteration_number=10),
|
||||
perturb(sliver_bound=10, time_limit=30),
|
||||
exude(sliver_bound=10, time_limit=0));
|
||||
params::odt(params::convergence(0.03).freeze_bound(0.02).time_limit(30)),
|
||||
params::lloyd(params::max_iteration_number(10)),
|
||||
params::perturb(params::sliver_bound(10).time_limit(30)),
|
||||
params::exude(params::sliver_bound(10).time_limit(0)));
|
||||
|
||||
std::ofstream medit_file("output_implicit_shape_optimized.mesh");
|
||||
CGAL::IO::output_periodic_mesh_to_medit(medit_file, c3t3);
|
||||
|
||||
// Below, the mesh generation and the optimizations are done in several calls
|
||||
C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3<C3t3>(domain, criteria,
|
||||
no_odt(), no_lloyd(),
|
||||
no_perturb(), no_exude());
|
||||
params::no_odt().
|
||||
no_lloyd().
|
||||
no_perturb().
|
||||
no_exude());
|
||||
|
||||
std::ofstream medit_file_bis("output_implicit_shape_non-optimized.mesh");
|
||||
CGAL::IO::output_periodic_mesh_to_medit(medit_file_bis, c3t3_bis);
|
||||
|
||||
// Now, call each optimizer with its global function
|
||||
CGAL::odt_optimize_periodic_3_mesh_3(c3t3_bis, domain, convergence=0.03, freeze_bound=0.02, time_limit=30);
|
||||
CGAL::lloyd_optimize_periodic_3_mesh_3(c3t3_bis, domain, max_iteration_number=10);
|
||||
CGAL::perturb_periodic_3_mesh_3(c3t3_bis, domain, sliver_bound=10, time_limit=30);
|
||||
CGAL::exude_periodic_3_mesh_3(c3t3_bis, sliver_bound=10, time_limit=0);
|
||||
CGAL::odt_optimize_periodic_3_mesh_3(c3t3_bis, domain, params::convergence(0.03).freeze_bound(0.02).time_limit(30));
|
||||
CGAL::lloyd_optimize_periodic_3_mesh_3(c3t3_bis, domain, params::max_iteration_number(10));
|
||||
CGAL::perturb_periodic_3_mesh_3(c3t3_bis, domain, params::sliver_bound(10).time_limit(30));
|
||||
CGAL::exude_periodic_3_mesh_3(c3t3_bis, params::sliver_bound(10).time_limit(0));
|
||||
|
||||
std::ofstream medit_file_ter("output_implicit_shape_two_steps.mesh");
|
||||
CGAL::IO::output_periodic_mesh_to_medit(medit_file_ter, c3t3_bis, number_of_copies_in_output);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3<Tr> C3t3;
|
|||
typedef CGAL::Mesh_criteria_3<Tr> Periodic_mesh_criteria;
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
// Function
|
||||
FT schwarz_p(const Point& p)
|
||||
|
|
@ -67,11 +67,11 @@ int main(int argc, char** argv)
|
|||
size.set_size(0.1, volume_dimension, domain.index_from_subdomain_index(2)); // exterior
|
||||
size.set_size(0.03, volume_dimension, domain.index_from_subdomain_index(1)); // interior
|
||||
|
||||
Periodic_mesh_criteria criteria(facet_angle = 30.,
|
||||
facet_size = 0.05,
|
||||
facet_distance = 0.025,
|
||||
cell_radius_edge_ratio = 2.,
|
||||
cell_size = size);
|
||||
Periodic_mesh_criteria criteria(params::facet_angle(30.).
|
||||
facet_size(0.05).
|
||||
facet_distance(0.025).
|
||||
cell_radius_edge_ratio(2.).
|
||||
cell_size(size));
|
||||
|
||||
// Mesh generation
|
||||
C3t3 c3t3 = CGAL::make_periodic_3_mesh_3<C3t3>(domain, criteria);
|
||||
|
|
|
|||
Loading…
Reference in New Issue