diff --git a/Isosurfacing_3/benchmark/Isosurfacing_3/contouring_seq_vs_parallel_image.cpp b/Isosurfacing_3/benchmark/Isosurfacing_3/contouring_seq_vs_parallel_image.cpp index 2855d6ba1d8..30b63288e02 100644 --- a/Isosurfacing_3/benchmark/Isosurfacing_3/contouring_seq_vs_parallel_image.cpp +++ b/Isosurfacing_3/benchmark/Isosurfacing_3/contouring_seq_vs_parallel_image.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include diff --git a/Isosurfacing_3/examples/Isosurfacing_3/CMakeLists.txt b/Isosurfacing_3/examples/Isosurfacing_3/CMakeLists.txt index 6af398fdd99..6d8f00e1c7e 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/CMakeLists.txt +++ b/Isosurfacing_3/examples/Isosurfacing_3/CMakeLists.txt @@ -35,7 +35,6 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(contouring_image PRIVATE CGAL::Eigen3_support) target_link_libraries(contouring_implicit_data PRIVATE CGAL::Eigen3_support) target_link_libraries(contouring_mesh_offset PRIVATE CGAL::Eigen3_support) - target_link_libraries(dual_contouring_strategies PRIVATE CGAL::Eigen3_support) target_link_libraries(dual_contouring_intersection_oracles PRIVATE CGAL::Eigen3_support) @@ -46,7 +45,6 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(contouring_image PRIVATE CGAL::TBB_support) target_link_libraries(contouring_implicit_data PRIVATE CGAL::TBB_support) target_link_libraries(contouring_mesh_offset PRIVATE CGAL::TBB_support) - target_link_libraries(dual_contouring_strategies PRIVATE CGAL::TBB_support) target_link_libraries(dual_contouring_intersection_oracles PRIVATE CGAL::TBB_support) endif() diff --git a/Isosurfacing_3/include/CGAL/Isosurfacing_3/internal/dual_contouring_functors.h b/Isosurfacing_3/include/CGAL/Isosurfacing_3/internal/dual_contouring_functors.h index 9d4a26a4879..1f2fc7e612a 100644 --- a/Isosurfacing_3/include/CGAL/Isosurfacing_3/internal/dual_contouring_functors.h +++ b/Isosurfacing_3/include/CGAL/Isosurfacing_3/internal/dual_contouring_functors.h @@ -130,7 +130,7 @@ bool cell_position_QEM(const typename Domain::Cell_descriptor& c, z += z_coord(ep); } - Point_3 com = point(x / en, y / en, z / en); + Point_3 com = point(x / FT(en), y / FT(en), z / FT(en)); #ifdef CGAL_ISOSURFACING_3_DC_FUNCTORS_DEBUG std::cout << "cell: " << x_min << " " << y_min << " " << z_min << " " << x_max << " " << y_max << " " << z_max << std::endl; @@ -168,7 +168,8 @@ bool cell_position_QEM(const typename Domain::Cell_descriptor& c, Eigen::JacobiSVD svd(A, Eigen::ComputeThinU | Eigen::ComputeThinV); - // set threshold as in Peter Lindstrom's paper, "Out-of-Core Simplification of Large Polygonal Models" + // Ju's paper, "Dual Contouring of Hermite Data": 1e-1 + // Lindstrom's paper, "Out-of-Core Simplification of Large Polygonal Models": 1e-3 svd.setThreshold(1e-3); Eigen_vector_3 x_hat; @@ -512,7 +513,7 @@ public: z += z_coord(p); } - const Point_3 p = point(x / en, y / en, z / en); + const Point_3 p = point(x / FT(en), y / FT(en), z / FT(en)); std::lock_guard lock(m_mutex); cell_to_point_id[c] = points.size(); diff --git a/Isosurfacing_3/include/CGAL/Isosurfacing_3/internal/marching_cubes_functors.h b/Isosurfacing_3/include/CGAL/Isosurfacing_3/internal/marching_cubes_functors.h index 9ac3d395d5a..b55407ffc28 100644 --- a/Isosurfacing_3/include/CGAL/Isosurfacing_3/internal/marching_cubes_functors.h +++ b/Isosurfacing_3/include/CGAL/Isosurfacing_3/internal/marching_cubes_functors.h @@ -133,7 +133,7 @@ template -void MC_construct_vertices(const typename Domain::Cell_descriptor cell, +void MC_construct_vertices(const typename Domain::Cell_descriptor& cell, const std::size_t i_case, const Corners& corners, const Values& values, @@ -173,12 +173,12 @@ void MC_construct_vertices(const typename Domain::Cell_descriptor cell, // connects the vertices of one cell to form triangles template -void mc_construct_triangles(const int i_case, +void MC_construct_triangles(const int i_case, const Vertices& vertices, TriangleList& triangles) { // construct triangles - for(int t = 0; t < 16; t += 3) + for(int t=0; t<16; t+=3) { const int t_index = i_case * 16 + t; @@ -193,10 +193,11 @@ void mc_construct_triangles(const int i_case, // insert new triangle in list #ifdef CGAL_LINKED_WITH_TBB - auto& tris = triangles.local(); + auto& tris = triangles.local(); #else - auto& tris = triangles; + auto& tris = triangles; #endif + tris.push_back({vertices[eg0], vertices[eg1], vertices[eg2]}); } } @@ -295,7 +296,7 @@ public: std::array vertices; MC_construct_vertices(cell, i_case, corners, values, m_isovalue, m_domain, vertices); - mc_construct_triangles(i_case, vertices, m_triangles); + MC_construct_triangles(i_case, vertices, m_triangles); } }; diff --git a/Isosurfacing_3/include/CGAL/Isosurfacing_3/internal/topologically_correct_marching_cubes_functors.h b/Isosurfacing_3/include/CGAL/Isosurfacing_3/internal/topologically_correct_marching_cubes_functors.h index 9eda15ae769..b1e0052c685 100644 --- a/Isosurfacing_3/include/CGAL/Isosurfacing_3/internal/topologically_correct_marching_cubes_functors.h +++ b/Isosurfacing_3/include/CGAL/Isosurfacing_3/internal/topologically_correct_marching_cubes_functors.h @@ -146,7 +146,7 @@ public: std::array corners; const std::size_t i_case = get_cell_corners(m_domain, cell, m_isovalue, corners, values); - // this is the only difference to mc + // this is the only difference to the default Marching Cubes const int tcm = Cube_table::t_ambig[i_case]; if(tcm == 105) { @@ -169,9 +169,10 @@ public: // @todo improve triangle generation // construct triangles - for(int t=0; t<16; t += 3) + for(int t=0; t<16; t+=3) { const int t_index = i_case * 16 + t; + // if(e_tris_list[t_index] == 0x7f) if(Cube_table::triangle_cases[t_index] == -1) break; @@ -181,7 +182,6 @@ public: const int eg1 = Cube_table::triangle_cases[t_index + 1]; const int eg2 = Cube_table::triangle_cases[t_index + 2]; - // insert new triangle into list const Point_index p0 = add_point(vertices[eg0], compute_edge_index(cell, eg0)); const Point_index p1 = add_point(vertices[eg1], compute_edge_index(cell, eg1)); @@ -325,6 +325,7 @@ private: unsigned int v0, v1; get_edge_vertex(eg, v0, v1, l_edges_); + // @todo use the domain's interpolation scheme? FT l = (i0 - values[v0]) / (values[v1] - values[v0]); ecoord[eg] = l;