mirror of https://github.com/CGAL/cgal
Remove old files
This commit is contained in:
parent
a28a1db0b1
commit
02efdb6b6e
|
|
@ -1,48 +0,0 @@
|
|||
#ifndef CGAL_CARTESIAN_GRID_DOMAIN_OLD_H
|
||||
#define CGAL_CARTESIAN_GRID_DOMAIN_OLD_H
|
||||
|
||||
#include <CGAL/Cartesian_grid_3.h>
|
||||
|
||||
namespace CGAL {
|
||||
namespace Isosurfacing {
|
||||
|
||||
template <class GeomTraits>
|
||||
class Cartesian_grid_domain_old {
|
||||
public:
|
||||
typedef GeomTraits Geom_traits;
|
||||
typedef typename Geom_traits::FT FT;
|
||||
typedef typename Geom_traits::Point_3 Point_3;
|
||||
|
||||
public:
|
||||
Cartesian_grid_domain_old(const Cartesian_grid_3<Geom_traits>& grid) : grid(&grid) {}
|
||||
|
||||
std::size_t size_x() const {
|
||||
return grid->xdim();
|
||||
}
|
||||
std::size_t size_y() const {
|
||||
return grid->ydim();
|
||||
}
|
||||
std::size_t size_z() const {
|
||||
return grid->zdim();
|
||||
}
|
||||
|
||||
Point_3 position(const std::size_t x, const std::size_t y, const std::size_t z) const {
|
||||
const FT vx = grid->voxel_x();
|
||||
const FT vy = grid->voxel_y();
|
||||
const FT vz = grid->voxel_z();
|
||||
|
||||
return Point_3(x * vx + grid->offset_x(), y * vy + grid->offset_y(), z * vz + grid->offset_z());
|
||||
}
|
||||
|
||||
FT value(const std::size_t x, const std::size_t y, const std::size_t z) const {
|
||||
return grid->value(x, y, z);
|
||||
}
|
||||
|
||||
private:
|
||||
const Cartesian_grid_3<Geom_traits>* grid;
|
||||
};
|
||||
|
||||
} // namespace Isosurfacing
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // CGAL_CARTESIAN_GRID_DOMAIN_OLD_H
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
#ifndef CGAL_IMPLICIT_DOMAIN_OLD_H
|
||||
#define CGAL_IMPLICIT_DOMAIN_OLD_H
|
||||
|
||||
#include <CGAL/Bbox_3.h>
|
||||
|
||||
namespace CGAL {
|
||||
namespace Isosurfacing {
|
||||
|
||||
template <class GeomTraits, typename Function>
|
||||
class Implicit_domain_old {
|
||||
public:
|
||||
typedef GeomTraits Geom_traits;
|
||||
typedef typename Geom_traits::FT FT;
|
||||
typedef typename Geom_traits::Point_3 Point_3;
|
||||
typedef typename Geom_traits::Vector_3 Vector_3;
|
||||
|
||||
public:
|
||||
Implicit_domain_old(const Function& func, const CGAL::Bbox_3& domain, const Vector_3& resolution)
|
||||
: func(func), bbox(domain), resolution(resolution) {
|
||||
|
||||
sizes[0] = domain.x_span() / resolution.x();
|
||||
sizes[1] = domain.y_span() / resolution.y();
|
||||
sizes[2] = domain.z_span() / resolution.z();
|
||||
}
|
||||
|
||||
std::size_t size_x() const {
|
||||
return sizes[0];
|
||||
}
|
||||
std::size_t size_y() const {
|
||||
return sizes[1];
|
||||
}
|
||||
std::size_t size_z() const {
|
||||
return sizes[2];
|
||||
}
|
||||
|
||||
Point_3 position(const std::size_t x, const std::size_t y, const std::size_t z) const {
|
||||
return Point_3(x * resolution.x() + bbox.xmin(), y * resolution.y() + bbox.ymin(),
|
||||
z * resolution.z() + bbox.zmin());
|
||||
}
|
||||
|
||||
FT value(const std::size_t x, const std::size_t y, const std::size_t z) const {
|
||||
return func(position(x, y, z));
|
||||
}
|
||||
|
||||
private:
|
||||
Function func;
|
||||
|
||||
CGAL::Bbox_3 bbox;
|
||||
Vector_3 resolution;
|
||||
|
||||
std::array<std::size_t, 3> sizes;
|
||||
};
|
||||
|
||||
|
||||
template <typename Function, class GeomTraits = typename Function::Geom_traits>
|
||||
Implicit_domain_old<GeomTraits, Function> create_implicit_domain_old(const Function& func, const CGAL::Bbox_3& domain,
|
||||
const typename GeomTraits::Vector_3& resolution) {
|
||||
return Implicit_domain_old<GeomTraits, Function>(func, domain, resolution);
|
||||
}
|
||||
|
||||
} // namespace Isosurfacing
|
||||
} // end namespace CGAL
|
||||
|
||||
#endif // CGAL_IMPLICIT_DOMAIN_OLD_H
|
||||
|
|
@ -1,306 +0,0 @@
|
|||
#pragma once
|
||||
/////////////////////////////////////////////////////
|
||||
// tables
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
// TODO: find better version with licence
|
||||
// compare to mc paper
|
||||
// maybe take from pierre / roberto
|
||||
|
||||
// Polygonising a scalar field
|
||||
// Also known as: "3D Contouring", "Marching Cubes", "Surface Reconstruction"
|
||||
// Written by Paul Bourke
|
||||
// May 1994
|
||||
// http://paulbourke.net/geometry/polygonise/
|
||||
|
||||
const static int edgeTable[256] = {
|
||||
0x0 , 0x109, 0x203, 0x30a, 0x406, 0x50f, 0x605, 0x70c,
|
||||
0x80c, 0x905, 0xa0f, 0xb06, 0xc0a, 0xd03, 0xe09, 0xf00,
|
||||
0x190, 0x99 , 0x393, 0x29a, 0x596, 0x49f, 0x795, 0x69c,
|
||||
0x99c, 0x895, 0xb9f, 0xa96, 0xd9a, 0xc93, 0xf99, 0xe90,
|
||||
0x230, 0x339, 0x33 , 0x13a, 0x636, 0x73f, 0x435, 0x53c,
|
||||
0xa3c, 0xb35, 0x83f, 0x936, 0xe3a, 0xf33, 0xc39, 0xd30,
|
||||
0x3a0, 0x2a9, 0x1a3, 0xaa , 0x7a6, 0x6af, 0x5a5, 0x4ac,
|
||||
0xbac, 0xaa5, 0x9af, 0x8a6, 0xfaa, 0xea3, 0xda9, 0xca0,
|
||||
0x460, 0x569, 0x663, 0x76a, 0x66 , 0x16f, 0x265, 0x36c,
|
||||
0xc6c, 0xd65, 0xe6f, 0xf66, 0x86a, 0x963, 0xa69, 0xb60,
|
||||
0x5f0, 0x4f9, 0x7f3, 0x6fa, 0x1f6, 0xff , 0x3f5, 0x2fc,
|
||||
0xdfc, 0xcf5, 0xfff, 0xef6, 0x9fa, 0x8f3, 0xbf9, 0xaf0,
|
||||
0x650, 0x759, 0x453, 0x55a, 0x256, 0x35f, 0x55 , 0x15c,
|
||||
0xe5c, 0xf55, 0xc5f, 0xd56, 0xa5a, 0xb53, 0x859, 0x950,
|
||||
0x7c0, 0x6c9, 0x5c3, 0x4ca, 0x3c6, 0x2cf, 0x1c5, 0xcc ,
|
||||
0xfcc, 0xec5, 0xdcf, 0xcc6, 0xbca, 0xac3, 0x9c9, 0x8c0,
|
||||
0x8c0, 0x9c9, 0xac3, 0xbca, 0xcc6, 0xdcf, 0xec5, 0xfcc,
|
||||
0xcc , 0x1c5, 0x2cf, 0x3c6, 0x4ca, 0x5c3, 0x6c9, 0x7c0,
|
||||
0x950, 0x859, 0xb53, 0xa5a, 0xd56, 0xc5f, 0xf55, 0xe5c,
|
||||
0x15c, 0x55 , 0x35f, 0x256, 0x55a, 0x453, 0x759, 0x650,
|
||||
0xaf0, 0xbf9, 0x8f3, 0x9fa, 0xef6, 0xfff, 0xcf5, 0xdfc,
|
||||
0x2fc, 0x3f5, 0xff , 0x1f6, 0x6fa, 0x7f3, 0x4f9, 0x5f0,
|
||||
0xb60, 0xa69, 0x963, 0x86a, 0xf66, 0xe6f, 0xd65, 0xc6c,
|
||||
0x36c, 0x265, 0x16f, 0x66 , 0x76a, 0x663, 0x569, 0x460,
|
||||
0xca0, 0xda9, 0xea3, 0xfaa, 0x8a6, 0x9af, 0xaa5, 0xbac,
|
||||
0x4ac, 0x5a5, 0x6af, 0x7a6, 0xaa , 0x1a3, 0x2a9, 0x3a0,
|
||||
0xd30, 0xc39, 0xf33, 0xe3a, 0x936, 0x83f, 0xb35, 0xa3c,
|
||||
0x53c, 0x435, 0x73f, 0x636, 0x13a, 0x33 , 0x339, 0x230,
|
||||
0xe90, 0xf99, 0xc93, 0xd9a, 0xa96, 0xb9f, 0x895, 0x99c,
|
||||
0x69c, 0x795, 0x49f, 0x596, 0x29a, 0x393, 0x99 , 0x190,
|
||||
0xf00, 0xe09, 0xd03, 0xc0a, 0xb06, 0xa0f, 0x905, 0x80c,
|
||||
0x70c, 0x605, 0x50f, 0x406, 0x30a, 0x203, 0x109, 0x0 };
|
||||
|
||||
const static int triTable[256][16] =
|
||||
{ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 9, 2, 10, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 2, 8, 3, 2, 10, 8, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 11, 2, 8, 11, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 11, 2, 1, 9, 11, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 3, 10, 1, 11, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 10, 1, 0, 8, 10, 8, 11, 10, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 3, 9, 0, 3, 11, 9, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 9, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 3, 4, 7, 3, 0, 4, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 9, 2, 10, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1, -1 },
|
||||
{ 8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 11, 4, 7, 11, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, -1, -1, -1, -1 },
|
||||
{ 3, 10, 1, 3, 11, 10, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, -1, -1, -1, -1 },
|
||||
{ 4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, -1, -1, -1, -1 },
|
||||
{ 4, 7, 11, 4, 11, 9, 9, 11, 10, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 5, 2, 10, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1 },
|
||||
{ 9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 11, 2, 0, 8, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 5, 4, 0, 1, 5, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5, -1, -1, -1, -1 },
|
||||
{ 10, 3, 11, 10, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, -1, -1, -1, -1 },
|
||||
{ 5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3, -1, -1, -1, -1 },
|
||||
{ 5, 4, 8, 5, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 9, 7, 8, 9, 5, 7, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1, -1 },
|
||||
{ 8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, -1, -1, -1, -1 },
|
||||
{ 2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 7, 9, 5, 7, 8, 9, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, -1, -1, -1, -1 },
|
||||
{ 2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1, -1 },
|
||||
{ 11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, -1, -1, -1, -1 },
|
||||
{ 5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0, -1 },
|
||||
{ 11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, -1 },
|
||||
{ 11, 10, 5, 7, 11, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 8, 3, 1, 9, 8, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1, -1 },
|
||||
{ 2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 11, 0, 8, 11, 2, 0, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, -1, -1, -1, -1 },
|
||||
{ 6, 3, 11, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, -1, -1, -1, -1 },
|
||||
{ 3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1 },
|
||||
{ 6, 5, 9, 6, 9, 11, 11, 9, 8, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 4, 3, 0, 4, 7, 3, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1, -1 },
|
||||
{ 6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1, -1 },
|
||||
{ 8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1, -1 },
|
||||
{ 7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, -1 },
|
||||
{ 3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, -1, -1, -1, -1 },
|
||||
{ 0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1 },
|
||||
{ 9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6, -1 },
|
||||
{ 8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, -1, -1, -1, -1 },
|
||||
{ 5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, -1 },
|
||||
{ 0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7, -1 },
|
||||
{ 6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, -1, -1, -1, -1 },
|
||||
{ 10, 4, 9, 6, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 4, 10, 6, 4, 9, 10, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 10, 0, 1, 10, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, -1, -1, -1, -1 },
|
||||
{ 1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1, -1 },
|
||||
{ 0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 10, 4, 9, 10, 6, 4, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, -1, -1, -1, -1 },
|
||||
{ 3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10, -1, -1, -1, -1 },
|
||||
{ 6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, -1 },
|
||||
{ 9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, -1, -1, -1, -1 },
|
||||
{ 8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1, -1 },
|
||||
{ 3, 11, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 6, 4, 8, 11, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 7, 10, 6, 7, 8, 10, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10, -1, -1, -1, -1 },
|
||||
{ 10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1, -1 },
|
||||
{ 10, 6, 7, 10, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1, -1 },
|
||||
{ 2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, -1 },
|
||||
{ 7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, -1, -1, -1, -1 },
|
||||
{ 2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7, -1 },
|
||||
{ 1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, -1 },
|
||||
{ 11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, -1, -1, -1, -1 },
|
||||
{ 8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6, -1 },
|
||||
{ 0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, -1, -1, -1, -1 },
|
||||
{ 7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 8, 1, 9, 8, 3, 1, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 2, 9, 0, 2, 10, 9, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, -1, -1, -1, -1 },
|
||||
{ 7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1, -1 },
|
||||
{ 10, 7, 6, 10, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1 },
|
||||
{ 0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7, -1, -1, -1, -1 },
|
||||
{ 7, 6, 10, 7, 10, 8, 8, 10, 9, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 6, 8, 4, 11, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 3, 6, 11, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 8, 6, 11, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, -1, -1, -1, -1 },
|
||||
{ 6, 8, 4, 6, 11, 8, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, -1, -1, -1, -1 },
|
||||
{ 4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, -1, -1, -1, -1 },
|
||||
{ 10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3, -1 },
|
||||
{ 8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1, -1 },
|
||||
{ 1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, -1, -1, -1, -1 },
|
||||
{ 10, 1, 0, 10, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, -1 },
|
||||
{ 10, 9, 4, 6, 10, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 5, 0, 1, 5, 4, 0, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1, -1 },
|
||||
{ 9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, -1, -1, -1, -1 },
|
||||
{ 7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2, -1, -1, -1, -1 },
|
||||
{ 3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, -1 },
|
||||
{ 7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1, -1 },
|
||||
{ 3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1, -1 },
|
||||
{ 6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, -1 },
|
||||
{ 9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1, -1 },
|
||||
{ 1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, -1 },
|
||||
{ 4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, -1 },
|
||||
{ 7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10, -1, -1, -1, -1 },
|
||||
{ 6, 9, 5, 6, 11, 9, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1 },
|
||||
{ 0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11, -1, -1, -1, -1 },
|
||||
{ 6, 11, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, -1, -1, -1, -1 },
|
||||
{ 0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10, -1 },
|
||||
{ 11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, -1 },
|
||||
{ 6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, -1, -1, -1, -1 },
|
||||
{ 5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1, -1 },
|
||||
{ 9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, -1 },
|
||||
{ 1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, -1 },
|
||||
{ 10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1, -1 },
|
||||
{ 0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 11, 5, 10, 7, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 11, 5, 10, 11, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 5, 11, 7, 5, 10, 11, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1, -1 },
|
||||
{ 11, 1, 2, 11, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, -1, -1, -1, -1 },
|
||||
{ 9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, -1, -1, -1, -1 },
|
||||
{ 7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2, -1 },
|
||||
{ 2, 5, 10, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, -1, -1, -1, -1 },
|
||||
{ 9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2, -1, -1, -1, -1 },
|
||||
{ 9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, -1 },
|
||||
{ 1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 5, 8, 4, 5, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, -1, -1, -1, -1 },
|
||||
{ 0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, -1, -1, -1, -1 },
|
||||
{ 10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4, -1 },
|
||||
{ 2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, -1, -1, -1, -1 },
|
||||
{ 0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, -1 },
|
||||
{ 0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5, -1 },
|
||||
{ 9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1 },
|
||||
{ 5, 10, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, -1 },
|
||||
{ 5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1, -1 },
|
||||
{ 8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1, -1 },
|
||||
{ 9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 4, 11, 7, 4, 9, 11, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, -1, -1, -1, -1 },
|
||||
{ 1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11, -1, -1, -1, -1 },
|
||||
{ 3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, -1 },
|
||||
{ 4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1 },
|
||||
{ 9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3, -1 },
|
||||
{ 11, 7, 4, 11, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1, -1 },
|
||||
{ 2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1, -1 },
|
||||
{ 9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, -1 },
|
||||
{ 3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, -1 },
|
||||
{ 1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1, -1 },
|
||||
{ 4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 9, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 3, 0, 9, 3, 9, 11, 11, 9, 10, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 1, 10, 0, 10, 8, 8, 10, 11, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 3, 1, 10, 11, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 2, 11, 1, 11, 9, 9, 11, 8, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, -1, -1, -1, -1 },
|
||||
{ 0, 2, 11, 8, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 2, 3, 8, 2, 8, 10, 10, 8, 9, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 9, 10, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8, -1, -1, -1, -1 },
|
||||
{ 1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ 0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
|
||||
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } };
|
||||
|
|
@ -1,275 +0,0 @@
|
|||
#ifndef CGAL_MARCHING_CUBES_3_OLD_H
|
||||
#define CGAL_MARCHING_CUBES_3_OLD_H
|
||||
|
||||
#include <CGAL/Isosurfacing_3/internal/Marching_cubes_3_internal.h>
|
||||
#include <CGAL/Isosurfacing_3/internal/Tables_old.h>
|
||||
|
||||
#include <mutex>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace CGAL {
|
||||
namespace Isosurfacing {
|
||||
|
||||
template <class Domain_, class PointRange, class PolygonRange>
|
||||
void marching_cubes_cell_old(const std::size_t x, const std::size_t y, const std::size_t z, const Domain_& domain,
|
||||
const typename Domain_::FT iso_value, PointRange& points, PolygonRange& polygons,
|
||||
std::mutex& mutex) {
|
||||
|
||||
typedef std::array<std::size_t, 3> Idx_3;
|
||||
typedef typename Domain_::FT FT;
|
||||
typedef typename Domain_::Point_3 Point_3;
|
||||
|
||||
const Idx_3 idx0 = {x + 0, y + 1, z + 0};
|
||||
const Idx_3 idx1 = {x + 1, y + 1, z + 0};
|
||||
const Idx_3 idx2 = {x + 1, y + 0, z + 0};
|
||||
const Idx_3 idx3 = {x + 0, y + 0, z + 0};
|
||||
const Idx_3 idx4 = {x + 0, y + 1, z + 1};
|
||||
const Idx_3 idx5 = {x + 1, y + 1, z + 1};
|
||||
const Idx_3 idx6 = {x + 1, y + 0, z + 1};
|
||||
const Idx_3 idx7 = {x + 0, y + 0, z + 1};
|
||||
|
||||
const Point_3 pos0 = domain.position(idx0[0], idx0[1], idx0[2]);
|
||||
const Point_3 pos1 = domain.position(idx1[0], idx1[1], idx1[2]);
|
||||
const Point_3 pos2 = domain.position(idx2[0], idx2[1], idx2[2]);
|
||||
const Point_3 pos3 = domain.position(idx3[0], idx3[1], idx3[2]);
|
||||
const Point_3 pos4 = domain.position(idx4[0], idx4[1], idx4[2]);
|
||||
const Point_3 pos5 = domain.position(idx5[0], idx5[1], idx5[2]);
|
||||
const Point_3 pos6 = domain.position(idx6[0], idx6[1], idx6[2]);
|
||||
const Point_3 pos7 = domain.position(idx7[0], idx7[1], idx7[2]);
|
||||
|
||||
const FT dist0 = domain.value(idx0[0], idx0[1], idx0[2]);
|
||||
const FT dist1 = domain.value(idx1[0], idx1[1], idx1[2]);
|
||||
const FT dist2 = domain.value(idx2[0], idx2[1], idx2[2]);
|
||||
const FT dist3 = domain.value(idx3[0], idx3[1], idx3[2]);
|
||||
const FT dist4 = domain.value(idx4[0], idx4[1], idx4[2]);
|
||||
const FT dist5 = domain.value(idx5[0], idx5[1], idx5[2]);
|
||||
const FT dist6 = domain.value(idx6[0], idx6[1], idx6[2]);
|
||||
const FT dist7 = domain.value(idx7[0], idx7[1], idx7[2]);
|
||||
|
||||
unsigned int cubeindex = 0;
|
||||
// set bit if corresponding corner is below iso
|
||||
cubeindex |= (dist0 < iso_value) << 0;
|
||||
cubeindex |= (dist1 < iso_value) << 1;
|
||||
cubeindex |= (dist2 < iso_value) << 2;
|
||||
cubeindex |= (dist3 < iso_value) << 3;
|
||||
cubeindex |= (dist4 < iso_value) << 4;
|
||||
cubeindex |= (dist5 < iso_value) << 5;
|
||||
cubeindex |= (dist6 < iso_value) << 6;
|
||||
cubeindex |= (dist7 < iso_value) << 7;
|
||||
|
||||
Point_3 vertlist[12];
|
||||
// bitmap of edges that intersect the iso-plane(s)
|
||||
const int edges = edgeTable[cubeindex];
|
||||
|
||||
if (edges == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// interpolation of vertices incident to the edge, according to diagram
|
||||
if (edges & (1 << 0)) {
|
||||
vertlist[0] = vertex_interpolation(pos0, pos1, dist0, dist1, iso_value);
|
||||
}
|
||||
if (edges & (1 << 1)) {
|
||||
vertlist[1] = vertex_interpolation(pos1, pos2, dist1, dist2, iso_value);
|
||||
}
|
||||
if (edges & (1 << 2)) {
|
||||
vertlist[2] = vertex_interpolation(pos2, pos3, dist2, dist3, iso_value);
|
||||
}
|
||||
if (edges & (1 << 3)) {
|
||||
vertlist[3] = vertex_interpolation(pos3, pos0, dist3, dist0, iso_value);
|
||||
}
|
||||
if (edges & (1 << 4)) {
|
||||
vertlist[4] = vertex_interpolation(pos4, pos5, dist4, dist5, iso_value);
|
||||
}
|
||||
if (edges & (1 << 5)) {
|
||||
vertlist[5] = vertex_interpolation(pos5, pos6, dist5, dist6, iso_value);
|
||||
}
|
||||
if (edges & (1 << 6)) {
|
||||
vertlist[6] = vertex_interpolation(pos6, pos7, dist6, dist7, iso_value);
|
||||
}
|
||||
if (edges & (1 << 7)) {
|
||||
vertlist[7] = vertex_interpolation(pos7, pos4, dist7, dist4, iso_value);
|
||||
}
|
||||
if (edges & (1 << 8)) {
|
||||
vertlist[8] = vertex_interpolation(pos0, pos4, dist0, dist4, iso_value);
|
||||
}
|
||||
if (edges & (1 << 9)) {
|
||||
vertlist[9] = vertex_interpolation(pos1, pos5, dist1, dist5, iso_value);
|
||||
}
|
||||
if (edges & (1 << 10)) {
|
||||
vertlist[10] = vertex_interpolation(pos2, pos6, dist2, dist6, iso_value);
|
||||
}
|
||||
if (edges & (1 << 11)) {
|
||||
vertlist[11] = vertex_interpolation(pos3, pos7, dist3, dist7, iso_value);
|
||||
}
|
||||
|
||||
// std::lock_guard<std::mutex> lock(mutex);
|
||||
|
||||
for (int i = 0; triTable[cubeindex][i] != -1; i += 3) {
|
||||
|
||||
const Point_3& p0 = vertlist[triTable[cubeindex][i + 0]];
|
||||
const Point_3& p1 = vertlist[triTable[cubeindex][i + 1]];
|
||||
const Point_3& p2 = vertlist[triTable[cubeindex][i + 2]];
|
||||
|
||||
const std::size_t p0_idx = points.size(); // TODO: not allowed
|
||||
|
||||
points.push_back(p0);
|
||||
points.push_back(p1);
|
||||
points.push_back(p2);
|
||||
|
||||
polygons.push_back({});
|
||||
auto& triangle = polygons.back();
|
||||
|
||||
triangle.push_back(p0_idx + 0);
|
||||
triangle.push_back(p0_idx + 1);
|
||||
triangle.push_back(p0_idx + 2);
|
||||
}
|
||||
}
|
||||
|
||||
template <class Domain_, class PointRange, class PolygonRange>
|
||||
void marching_cubes_cell_RG(const std::size_t x, const std::size_t y, const std::size_t z, const Domain_& domain,
|
||||
const typename Domain_::FT iso_value, PointRange& points, PolygonRange& polygons,
|
||||
std::mutex& mutex, std::unordered_map<std::size_t, std::size_t>& vertex_map) {
|
||||
|
||||
typedef typename Domain_::FT FT;
|
||||
typedef typename Domain_::Point_3 Point;
|
||||
|
||||
/// The structure _Vertex_ represents a vertex by giving its unique global index and the unique index of the edge.
|
||||
struct Vertex {
|
||||
std::size_t g_idx; //<! Index indicating the position in vertex array, used final shared vertex list.
|
||||
std::size_t g_edg; //<! Unique global index used a key to find unique vertex list in the map.
|
||||
};
|
||||
|
||||
// we need to compute up to 3 vertices at the interior of a cell, therefore
|
||||
// the cell shift factor is set to 3+3 = 6, i.e. 3 edges assigned to a cell for global numberig
|
||||
// and 3 vertices in the interior of the cell
|
||||
const int cell_shift_factor = 3;
|
||||
|
||||
// there can be at most 12 intersections
|
||||
std::array<Vertex, 12> vertices;
|
||||
|
||||
// slice hex
|
||||
// collect function values and build index
|
||||
FT values[8];
|
||||
Point corners[8];
|
||||
|
||||
int vi = 0;
|
||||
std::bitset<8> index = 0;
|
||||
for (int kl = 0; kl <= 1; kl++) {
|
||||
for (int jl = 0; jl <= 1; jl++) {
|
||||
for (int il = 0; il <= 1; il++) {
|
||||
// collect scalar values and computex index
|
||||
corners[vi] = domain.position(x + il, y + jl, z + kl);
|
||||
values[vi] = domain.value(x + il, y + jl, z + kl);
|
||||
|
||||
if (values[vi] >= iso_value) {
|
||||
// index.set(VertexMapping[vi]);
|
||||
index.set(vi);
|
||||
}
|
||||
// next cell vertex
|
||||
vi++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// collect edges from table and
|
||||
// interpolate triangle vertex positon
|
||||
const int i_case = int(index.to_ullong());
|
||||
// compute for this case the vertices
|
||||
ushort flag = 1;
|
||||
for (int edge = 0; edge < 12; edge++) {
|
||||
if (flag & Cube_table::intersected_edges[i_case]) {
|
||||
// the edge global index is given by the vertex global index + the edge offset
|
||||
const std::size_t ix = x + Cube_table::global_edge_id[edge][0];
|
||||
const std::size_t iy = y + Cube_table::global_edge_id[edge][1];
|
||||
const std::size_t iz = z + Cube_table::global_edge_id[edge][2];
|
||||
const std::size_t global_index = (iz * domain.size_y() * domain.size_x() + iy * domain.size_x() + ix);
|
||||
vertices[edge].g_edg = cell_shift_factor * global_index + Cube_table::global_edge_id[edge][3];
|
||||
// generate vertex here, do not care at this point if vertex already exist
|
||||
// interpolation weight
|
||||
const int v0 = Cube_table::edge_to_vertex[edge][0];
|
||||
const int v1 = Cube_table::edge_to_vertex[edge][1];
|
||||
const FT l = (iso_value - values[v0]) / (values[v1] - values[v0]);
|
||||
// interpolate vertex
|
||||
const FT px = (1 - l) * corners[v0][0] + l * corners[v1][0];
|
||||
const FT py = (1 - l) * corners[v0][1] + l * corners[v1][1];
|
||||
const FT pz = (1 - l) * corners[v0][2] + l * corners[v1][2];
|
||||
const Point position(px, py, pz);
|
||||
|
||||
// std::lock_guard<std::mutex> lock(mutex);
|
||||
// set vertex index
|
||||
// const auto s_index = vertex_map.find(vertices[edge].g_edg);
|
||||
// if (s_index == vertex_map.end()) {
|
||||
// index not found! Add index to hash map
|
||||
const std::size_t g_idx = points.size();
|
||||
// vertex_map[vertices[edge].g_edg] = g_idx;
|
||||
vertices[edge].g_idx = g_idx;
|
||||
points.push_back(position);
|
||||
//} else {
|
||||
// vertices[edge].g_idx = s_index->second; // this is vertex global index g_idx
|
||||
//}
|
||||
}
|
||||
flag <<= 1;
|
||||
}
|
||||
|
||||
// std::lock_guard<std::mutex> lock(mutex);
|
||||
// construct triangles
|
||||
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;
|
||||
|
||||
const int eg0 = Cube_table::triangle_cases[t_index];
|
||||
const int eg1 = Cube_table::triangle_cases[t_index + 1];
|
||||
const int eg2 = Cube_table::triangle_cases[t_index + 2];
|
||||
|
||||
// insert new triangle in list
|
||||
polygons.push_back({});
|
||||
auto& triangle = polygons.back();
|
||||
|
||||
triangle.push_back(vertices[eg0].g_idx);
|
||||
triangle.push_back(vertices[eg1].g_idx);
|
||||
triangle.push_back(vertices[eg2].g_idx);
|
||||
}
|
||||
}
|
||||
|
||||
template <class Domain_, class PointRange, class PolygonRange>
|
||||
void make_triangle_mesh_using_marching_cubes_old(const Domain_& domain, const typename Domain_::FT iso_value,
|
||||
PointRange& points, PolygonRange& polygons) {
|
||||
|
||||
std::mutex mutex;
|
||||
|
||||
const std::size_t size_k = domain.size_z();
|
||||
const std::size_t size_j = domain.size_y();
|
||||
const std::size_t size_i = domain.size_x();
|
||||
|
||||
const std::size_t blocking_size = 100;
|
||||
|
||||
// TODO: look at polygon mesh processing for tbb (also linking)
|
||||
|
||||
// compute a unique global index for vertices
|
||||
// use as key the unique edge number
|
||||
std::unordered_map<std::size_t, std::size_t> v_map;
|
||||
|
||||
|
||||
for (std::size_t bj = 0; bj < size_j - 1; bj += blocking_size) {
|
||||
//#pragma omp parallel for
|
||||
for (std::size_t k = 0; k < size_k - 1; k++) {
|
||||
|
||||
const std::size_t j_start = bj;
|
||||
const std::size_t j_end = std::min(size_j - 1, bj + blocking_size);
|
||||
|
||||
for (std::size_t j = j_start; j < j_end; j++) {
|
||||
for (std::size_t i = 0; i < size_i - 1; i++) {
|
||||
// internal::marching_cubes_cell_old(i, j, k, domain, iso_value, points, polygons, mutex);
|
||||
internal::marching_cubes_cell_RG(i, j, k, domain, iso_value, points, polygons, mutex, v_map);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Isosurfacing
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // CGAL_MARCHING_CUBES_3_OLD_H
|
||||
Loading…
Reference in New Issue