From 568a5c2060cfb846bcdeec46b28e7ffb4b4b4d66 Mon Sep 17 00:00:00 2001 From: Julian Stahl Date: Wed, 31 Aug 2022 17:24:34 +0200 Subject: [PATCH] Add example files --- .../Isosurfacing_3/dual_contouring_mesh_offset.cpp | 14 +++++++------- .../Isosurfacing_3/dual_contouring_octree.cpp | 5 +---- .../Isosurfacing_3/marching_cubes_inrimage.cpp | 2 +- .../Isosurfacing_3/marching_cubes_mesh_offset.cpp | 6 +++--- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_mesh_offset.cpp b/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_mesh_offset.cpp index d0c622bcc38..d8b7ba5c39f 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_mesh_offset.cpp +++ b/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_mesh_offset.cpp @@ -33,9 +33,9 @@ inline Kernel::FT distance_to_mesh(const Tree& tree, const Point& p) { } int main() { - const std::string input_name = "../../../../data/bunny.off"; - const int n_voxels = 50; - const FT offset_value = 0.02; + const std::string input_name = "../data/bunny.off"; + const int n_voxels = 20; + const FT offset_value = 0.01; Mesh mesh_input; if (!CGAL::IO::read_OFF(input_name, mesh_input)) { @@ -69,10 +69,10 @@ int main() { grid.value(x, y, z) = distance_to_mesh(tree, p); - const bool is_inside = (sotm(p) == CGAL::ON_BOUNDED_SIDE); - if (is_inside) { - grid.value(x, y, z) *= -1; - } + // const bool is_inside = (sotm(p) == CGAL::ON_BOUNDED_SIDE); + // if (is_inside) { + // grid.value(x, y, z) *= -1; + //} } } } diff --git a/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_octree.cpp b/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_octree.cpp index 820b494f89c..d36fe5ae6b1 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_octree.cpp +++ b/Isosurfacing_3/examples/Isosurfacing_3/dual_contouring_octree.cpp @@ -69,13 +69,11 @@ struct Refine_one_eighth { int main() { Octree_wrapper_ octree_wrap({-1, -1, -1, 1, 1, 1}); - Refine_one_eighth split_predicate(4, 8); + Refine_one_eighth split_predicate(4, 6); octree_wrap.refine(split_predicate); Octree_domain_ octree_domain(octree_wrap); - std::cout << "Init grid" << std::endl; - auto lam = [&](const Octree_domain_::Vertex_handle& v) { Point_3 p = octree_domain.position(v); const auto val = sphere_function(p); @@ -89,7 +87,6 @@ int main() { Point_range points; Polygon_range polygons; - std::cout << "Run DC" << std::endl; CGAL::Isosurfacing::make_quad_mesh_using_dual_contouring(octree_domain, 0.8, points, polygons); CGAL::IO::write_OFF("result.off", points, polygons); diff --git a/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_inrimage.cpp b/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_inrimage.cpp index e2e8da7334f..99cb474e6c9 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_inrimage.cpp +++ b/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_inrimage.cpp @@ -15,7 +15,7 @@ typedef std::vector> Polygon_range; int main() { - const std::string fname = "../../../../data/skull_2.9.inr"; + const std::string fname = "../data/skull_2.9.inr"; // Load image CGAL::Image_3 image; if (!image.read(fname)) { diff --git a/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_mesh_offset.cpp b/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_mesh_offset.cpp index 66f9cc86336..3b66fbc1e69 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_mesh_offset.cpp +++ b/Isosurfacing_3/examples/Isosurfacing_3/marching_cubes_mesh_offset.cpp @@ -34,9 +34,9 @@ inline Kernel::FT distance_to_mesh(const Tree& tree, const Point& p) { } int main() { - const std::string input_name = "../../../../data/bunny.off"; - const int n_voxels = 50; - const FT offset_value = 0.02; + const std::string input_name = "../data/bunny.off"; + const int n_voxels = 20; + const FT offset_value = 0.01; Mesh mesh_input; if (!CGAL::IO::read_OFF(input_name, mesh_input)) {