Misc minor changes

This commit is contained in:
Mael Rouxel-Labbé 2025-03-20 16:28:42 +01:00
parent e1fb8735b4
commit 1f91e3df40
8 changed files with 13 additions and 10 deletions

View File

@ -29,6 +29,8 @@ using Gradients = CGAL::Isosurfacing::Gradient_function_3<Octree>;
using MC_Domain = CGAL::Isosurfacing::Marching_cubes_domain_3<Octree, Values>;
using Domain = CGAL::Isosurfacing::Dual_contouring_domain_3<Octree, Values, Gradients>;
namespace IS = CGAL::Isosurfacing;
// Refine one of the octant
struct Refine_one_eighth
{
@ -114,7 +116,9 @@ int main(int argc, char** argv)
Polygon_range triangles;
// run Dual Contouring
CGAL::Isosurfacing::dual_contouring<CGAL::Parallel_if_available_tag>(domain, isovalue, points, triangles, CGAL::parameters::do_not_triangulate_faces(true));
IS::dual_contouring<CGAL::Parallel_if_available_tag>(domain, isovalue, points, triangles,
CGAL::parameters::do_not_triangulate_faces(true)
.constrain_to_cell(false));
// run Marching Cubes
// ToDo: Does not yet work with topologically correct marching cubes

View File

@ -130,7 +130,7 @@ CGAL::Image_3 convert_grid_to_image(const Grid& grid,
// error handling
if(im == nullptr || im->data == nullptr)
throw std::bad_alloc(); // @todo idk?
throw std::bad_alloc();
// set min coordinates
const Point_3& min_p = vertex(grid.span(), 0);

View File

@ -180,7 +180,6 @@ bool cell_position_QEM(const typename Domain::cell_descriptor& c,
Eigen_vector_x v_svd;
v_svd = x_hat + svd.solve(rhs - A * x_hat);
if(constrain_to_cell)
{
// @todo clamping back doesn't necessarily yield the optimal position within the cell

View File

@ -116,6 +116,8 @@ std::size_t get_cell_corners(const Domain& domain,
// collect function values and build index
std::size_t v_id = 0;
std::bitset<Domain::VERTICES_PER_CELL> index = 0;
static_assert(Domain::VERTICES_PER_CELL == 8);
for(const vertex_descriptor& v : vertices)
{
auto val = domain.value(v);
@ -199,7 +201,6 @@ void MC_construct_triangles(const std::size_t i_case,
if(Cube_table::triangle_cases[t_index] == -1)
break;
// @todo move more of this stuff into the table
const int eg0 = Cube_table::triangle_cases[t_index + 0];
const int eg1 = Cube_table::triangle_cases[t_index + 1];
const int eg2 = Cube_table::triangle_cases[t_index + 2];
@ -298,7 +299,7 @@ public:
CGAL_precondition(m_domain.cell_vertices(cell).size() == 8);
CGAL_precondition(m_domain.cell_edges(cell).size() == 12);
// @todo for SDFs, we could query at the center of the voxel an early exit
// @speed for SDFs, we could query at the center of the voxel an early exit
constexpr std::size_t vpc = Domain::VERTICES_PER_CELL;

View File

@ -394,7 +394,7 @@ public:
Sequential_tag)
{
for(const edge_descriptor& e : get_leaf_edges(o))
f(e);
f(e);
}
template <typename Functor>

View File

@ -184,7 +184,6 @@ public:
if(Cube_table::triangle_cases[t_index] == -1)
break;
// @todo move more of this stuff into the table
const int eg0 = Cube_table::triangle_cases[t_index + 0];
const int eg1 = Cube_table::triangle_cases[t_index + 1];
const int eg2 = Cube_table::triangle_cases[t_index + 2];

View File

@ -1,7 +1,7 @@
Algebraic_foundations
BGL
Cartesian_kernel
CGAL_ImageIO
Cartesian_kernel
Circulator
Distance_2
Distance_3

View File

@ -522,11 +522,11 @@ public:
compute_cartesian_coordinate(std::uint32_t gc, std::size_t depth, int ci) const
{
CGAL_assertion(depth <= m_side_per_depth.size());
// an odd coordinate will be first compute at the current depth,
// an odd coordinate will be first computed at the current depth,
// while an even coordinate has already been computed at a previous depth.
// So while the coordinate is even, we decrease the depth to end up of the first
// non-even coordinate to compute it (with particular case for bbox limits).
// Note that is depth becomes too large, we might end up with incorrect coordinates
// Note that if the depth becomes too large, we might end up with incorrect coordinates
// due to rounding errors.
if (gc == (1u << depth)) return (m_bbox.max)()[ci]; // gc == 2^node_depth
if (gc == 0) return (m_bbox.min)()[ci];