use weights and features in example

This commit is contained in:
Jane Tournois 2022-09-23 17:21:14 +02:00
parent 1976710f9c
commit 372b7617b0
1 changed files with 11 additions and 5 deletions

View File

@ -7,6 +7,7 @@
#include <CGAL/Mesh_complex_3_in_triangulation_3.h>
#include <CGAL/Mesh_criteria_3.h>
#include <CGAL/Mesh_domain_with_polyline_features_3.h>
#include <CGAL/Labeled_mesh_domain_3.h>
#include <CGAL/Mesh_3/generate_label_weights.h>
#include <CGAL/make_mesh_3.h>
@ -16,7 +17,9 @@
// Domain
using K = CGAL::Exact_predicates_inexact_constructions_kernel;
using Mesh_domain = CGAL::Labeled_mesh_domain_3<K>;
using Image_domain = CGAL::Labeled_mesh_domain_3<K>;
using Mesh_domain = CGAL::Mesh_domain_with_polyline_features_3<Image_domain>;
// Triangulation
using Tr = CGAL::Mesh_triangulation_3<Mesh_domain,
@ -49,17 +52,20 @@ int main(int argc, char* argv[])
CGAL::Mesh_3::postprocess_weights_for_feature_protection(image, img_weights);
Mesh_domain domain
= Mesh_domain::create_labeled_image_mesh_domain(image,
= Mesh_domain::create_labeled_image_mesh_domain_with_features(image,
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(facet_angle=30, facet_size=6, facet_distance=0.5,
// cell_radius_edge_ratio=3, cell_size=8);
Mesh_criteria criteria(facet_size=0.02,
facet_distance=0.0005,
cell_size=0.02);
/// [Meshing]
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria);
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_exude(), no_perturb());
/// [Meshing]
// Output