Misc minor changes

This commit is contained in:
Mael Rouxel-Labbé 2024-02-27 16:00:45 +01:00
parent b9411822a4
commit 6a55f88323
5 changed files with 15 additions and 15 deletions

View File

@ -7,7 +7,6 @@
#include <CGAL/Isosurfacing_3/Marching_cubes_domain_3.h>
#include <CGAL/Isosurfacing_3/Value_function_3.h>
#include <CGAL/Isosurfacing_3/Finite_difference_gradient_3.h>
#include <CGAL/Isosurfacing_3/internal/implicit_shapes_helper.h>
#include <CGAL/Real_timer.h>

View File

@ -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()

View File

@ -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<typename Eigen_matrix_x::EigenType> 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<std::mutex> lock(m_mutex);
cell_to_point_id[c] = points.size();

View File

@ -133,7 +133,7 @@ template <typename Corners,
typename Values,
typename Domain,
typename Vertices>
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 <typename Vertices,
typename TriangleList>
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<Point_3, 12> 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);
}
};

View File

@ -146,7 +146,7 @@ public:
std::array<Point_3, 8> 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;