From 1a50b533c76b3311e382ae0b737c1f9c49668590 Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Mon, 21 Nov 2022 19:37:24 +0100 Subject: [PATCH] massaging Isosurfacing examples rename mesh offset to signed mesh offset --- Isosurfacing_3/examples/Isosurfacing_3/CMakeLists.txt | 4 ++-- .../Isosurfacing_3/dual_contouring_cartesian_grid.cpp | 2 +- ...h_offset.cpp => marching_cubes_signed_mesh_offset.cpp} | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) rename Isosurfacing_3/examples/Isosurfacing_3/{marching_cubes_mesh_offset.cpp => marching_cubes_signed_mesh_offset.cpp} (93%) diff --git a/Isosurfacing_3/examples/Isosurfacing_3/CMakeLists.txt b/Isosurfacing_3/examples/Isosurfacing_3/CMakeLists.txt index f4b1cf4cea6..248588c7d8f 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/CMakeLists.txt +++ b/Isosurfacing_3/examples/Isosurfacing_3/CMakeLists.txt @@ -8,7 +8,7 @@ find_package(CGAL REQUIRED) create_single_source_cgal_program( "marching_cubes_implicit_sphere.cpp" ) create_single_source_cgal_program( "marching_cubes_cartesian_grid_sphere.cpp" ) -create_single_source_cgal_program( "marching_cubes_mesh_offset.cpp" ) +create_single_source_cgal_program( "marching_cubes_signed_mesh_offset.cpp" ) create_single_source_cgal_program( "marching_cubes_inrimage.cpp" ) find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) @@ -37,7 +37,7 @@ include(CGAL_TBB_support) if(TARGET CGAL::TBB_support) target_link_libraries(marching_cubes_implicit_sphere PRIVATE CGAL::TBB_support) target_link_libraries(marching_cubes_cartesian_grid_sphere PRIVATE CGAL::TBB_support) - target_link_libraries(marching_cubes_mesh_offset PRIVATE CGAL::TBB_support) + target_link_libraries(marching_cubes_signed_mesh_offset PRIVATE CGAL::TBB_support) target_link_libraries(marching_cubes_inrimage PRIVATE CGAL::TBB_support) if(TARGET CGAL::Eigen3_support) diff --git a/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_cartesian_grid.cpp b/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_cartesian_grid.cpp index 7432a25c0ee..c835677f302 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_cartesian_grid.cpp +++ b/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_cartesian_grid.cpp @@ -19,7 +19,7 @@ int main() { // create bounding box and grid const CGAL::Bbox_3 bbox(-1.0, -1.0, -1.0, 1.0, 1.0, 1.0); - std::shared_ptr grid = std::make_shar ed(30, 30, 30, bbox); + std::shared_ptr grid = std::make_shared(30, 30, 30, bbox); // compute field values and gradients for (std::size_t x = 0; x < grid->xdim(); x++) { diff --git a/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_mesh_offset.cpp b/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_signed_mesh_offset.cpp similarity index 93% rename from Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_mesh_offset.cpp rename to Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_signed_mesh_offset.cpp index 44906dd347a..3a216fa1600 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_mesh_offset.cpp +++ b/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_signed_mesh_offset.cpp @@ -49,7 +49,7 @@ int main() { // compute loose bounding box of the mesh CGAL::Bbox_3 aabb_grid = CGAL::Polygon_mesh_processing::bbox(mesh_input); - const FT loose_offset = offset_value + 0 .01; + const FT loose_offset = offset_value + 0.01; Vector aabb_increase_vec = Vector(loose_offset, loose_offset, loose_offset); aabb_grid += (Point(aabb_grid.xmax(), aabb_grid.ymax(), aabb_grid.zmax()) + aabb_increase_vec).bbox(); aabb_grid += (Point(aabb_grid.xmin(), aabb_grid.ymin(), aabb_grid.zmin()) - aabb_increase_vec).bbox(); @@ -85,13 +85,13 @@ int main() { // create domain from the grid auto domain = CGAL::Isosurfacing::create_explicit_cartesian_grid_domain(grid); - // prepare collections for output indexed surface mesh + // containers for output indexed triangle soup Point_range points; Polygon_range polygons; // execute marching cubes with an isovalue equating offset CGAL::Isosurfacing::marching_cubes(domain, offset_value, points, polygons); - // save output indexed surface mesh to a file, in the OFF format - CGAL::IO::write_OFF("result.off", points, polygons); + // save output indexed triangle soup to a file, in the OFF format + CGAL::IO::write_OFF("output.off", points, polygons); }