Skip to content

Commit

Permalink
upgrade to 5.6 and changed fillBoundaryHole
Browse files Browse the repository at this point in the history
  • Loading branch information
stla committed Oct 9, 2023
1 parent bc1f0f4 commit 5f22581
Show file tree
Hide file tree
Showing 3 changed files with 610 additions and 23 deletions.
587 changes: 587 additions & 0 deletions inst/essais/Enneper-checkerboard2/Enneper-checkerboard2.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/MODULE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "MODULE.h"

RCPP_MODULE(class_CGALmesh) {
using namespace Rcpp;
using namespace Rcpp;
class_<CGALmesh>("CGALmesh")
.constructor<
const NumericMatrix, const List, bool,
Expand Down
44 changes: 22 additions & 22 deletions src/MODULE.h
Original file line number Diff line number Diff line change
Expand Up @@ -1069,13 +1069,31 @@ class CGALmesh {
halfedge_descriptor h = border_cycles[border];
std::vector<face_descriptor> patch_faces;
std::vector<vertex_descriptor> patch_vertices;
if(fairhole) {
const bool success = std::get<0>(
PMP::triangulate_refine_and_fair_hole(
mesh, h,
CGAL::parameters::face_output_iterator(
std::back_inserter(patch_faces))
.vertex_output_iterator(std::back_inserter(patch_vertices))
)
);
if(!success) {
Message("Fairing failed.");
}
} else {
PMP::triangulate_and_refine_hole(
mesh, h,
CGAL::parameters::face_output_iterator(
std::back_inserter(patch_faces))
.vertex_output_iterator(std::back_inserter(patch_vertices))
);
}
// if(fairhole) {
// const bool success = std::get<0>(
// PMP::triangulate_refine_and_fair_hole(
// mesh, h,
// CGAL::parameters::face_output_iterator(
// std::back_inserter(patch_faces))
// .vertex_output_iterator(std::back_inserter(patch_vertices))
// std::back_inserter(patch_faces), std::back_inserter(patch_vertices)
// )
// );
// if(!success) {
Expand All @@ -1084,27 +1102,9 @@ class CGALmesh {
// } else {
// PMP::triangulate_and_refine_hole(
// mesh, h,
// CGAL::parameters::face_output_iterator(
// std::back_inserter(patch_faces))
// .vertex_output_iterator(std::back_inserter(patch_vertices))
// std::back_inserter(patch_faces), std::back_inserter(patch_vertices)
// );
// }
if(fairhole) {
const bool success = std::get<0>(
PMP::triangulate_refine_and_fair_hole(
mesh, h,
std::back_inserter(patch_faces), std::back_inserter(patch_vertices)
)
);
if(!success) {
Message("Fairing failed.");
}
} else {
PMP::triangulate_and_refine_hole(
mesh, h,
std::back_inserter(patch_faces), std::back_inserter(patch_vertices)
);
}
//
Face_index_map fimap = mesh.add_property_map<face_descriptor, std::size_t>(
"f:i", 0
Expand Down

0 comments on commit 5f22581

Please sign in to comment.