supereight
Enumerations | Functions | Variables
se::meshing Namespace Reference

Enumerations

enum  status : uint8_t { OUTSIDE = 0x0, UNKNOWN = 0xFE, INSIDE = 0xFF }
 

Functions

template<typename OctreeT >
Eigen::Vector3f compute_intersection (const OctreeT &octree, const Eigen::Vector3i &source_coord, const Eigen::Vector3i &dest_coord)
 Single-res marching cube implementation. More...
 
template<typename OctreeT >
Eigen::Vector3f interp_vertexes (const OctreeT &octree, const unsigned x, const unsigned y, const unsigned z, const int edge)
 
template<typename BlockT >
void gather_data (const BlockT *block, typename BlockT::DataType data[8], const int x, const int y, const int z)
 
template<typename OctreeT >
void gather_data (const OctreeT &octree, typename OctreeT::DataType data[8], const int x, const int y, const int z)
 
template<typename OctreeT >
uint8_t compute_index (const OctreeT &octree, const typename OctreeT::BlockType *block_ptr, const unsigned x, const unsigned y, const unsigned z)
 
Eigen::Vector3f compute_dual_intersection (const float value_0, const float value_1, const Eigen::Vector3f &dual_corner_coord_0, const Eigen::Vector3f &dual_corner_coord_1, const float voxel_dim, const int)
 Multires-res marching cube implementation. More...
 
template<typename DataT , typename ValueSelector >
Eigen::Vector3f interp_dual_vertexes (const int edge, const DataT data[8], const std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f >> &dual_corner_coords_f, const float voxel_dim, ValueSelector select_value)
 
template<typename BlockT , typename DataT >
void gather_dual_data (const BlockT *block, const int scale, const Eigen::Vector3f &primal_corner_coord_f, DataT data[8], std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f >> &dual_corner_coords_f)
 
void norm_dual_corner_idxs (const Eigen::Vector3i &primal_corner_coord_rel, const int block_size, std::vector< int > &lower_priority_neighbours, std::vector< int > &higher_priority_neighbours, std::vector< std::vector< int >> &neighbours)
 The following strategy is derived from I. More...
 
template<typename OctreeT , typename DataT >
void gather_dual_data (const OctreeT &octree, const typename OctreeT::BlockType *block, const int scale, const Eigen::Vector3i &primal_corner_coord, DataT data[8], std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f >> &dual_corner_coords_f)
 
template<typename OctreeT , typename DataT >
void compute_dual_index (const OctreeT &octree, const typename OctreeT::BlockType *block_ptr, const int scale, const Eigen::Vector3i &primal_corner_coord, uint8_t &edge_pattern_idx, DataT data[8], std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f >> &dual_corner_coords_f)
 
bool checkVertex (const Eigen::Vector3f &vertex_M, const float dim)
 

Variables

static const Eigen::Vector3f norm_dual_offset_f [8]
 
static const Eigen::Vector3i logical_dual_offset [8]
 

Enumeration Type Documentation

◆ status

enum se::meshing::status : uint8_t
Enumerator
OUTSIDE 
UNKNOWN 
INSIDE 

Function Documentation

◆ compute_intersection()

template<typename OctreeT >
Eigen::Vector3f se::meshing::compute_intersection ( const OctreeT &  octree,
const Eigen::Vector3i &  source_coord,
const Eigen::Vector3i &  dest_coord 
)
inline

Single-res marching cube implementation.

◆ interp_vertexes()

template<typename OctreeT >
Eigen::Vector3f se::meshing::interp_vertexes ( const OctreeT &  octree,
const unsigned  x,
const unsigned  y,
const unsigned  z,
const int  edge 
)
inline

◆ gather_data() [1/2]

template<typename BlockT >
void se::meshing::gather_data ( const BlockT *  block,
typename BlockT::DataType  data[8],
const int  x,
const int  y,
const int  z 
)
inline

◆ gather_data() [2/2]

template<typename OctreeT >
void se::meshing::gather_data ( const OctreeT &  octree,
typename OctreeT::DataType  data[8],
const int  x,
const int  y,
const int  z 
)
inline

◆ compute_index()

template<typename OctreeT >
uint8_t se::meshing::compute_index ( const OctreeT &  octree,
const typename OctreeT::BlockType *  block_ptr,
const unsigned  x,
const unsigned  y,
const unsigned  z 
)

◆ compute_dual_intersection()

Eigen::Vector3f se::meshing::compute_dual_intersection ( const float  value_0,
const float  value_1,
const Eigen::Vector3f &  dual_corner_coord_0,
const Eigen::Vector3f &  dual_corner_coord_1,
const float  voxel_dim,
const int   
)
inline

Multires-res marching cube implementation.

◆ interp_dual_vertexes()

template<typename DataT , typename ValueSelector >
Eigen::Vector3f se::meshing::interp_dual_vertexes ( const int  edge,
const DataT  data[8],
const std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f >> &  dual_corner_coords_f,
const float  voxel_dim,
ValueSelector  select_value 
)
inline

◆ gather_dual_data() [1/2]

template<typename BlockT , typename DataT >
void se::meshing::gather_dual_data ( const BlockT *  block,
const int  scale,
const Eigen::Vector3f &  primal_corner_coord_f,
DataT  data[8],
std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f >> &  dual_corner_coords_f 
)
inline

◆ norm_dual_corner_idxs()

void se::meshing::norm_dual_corner_idxs ( const Eigen::Vector3i &  primal_corner_coord_rel,
const int  block_size,
std::vector< int > &  lower_priority_neighbours,
std::vector< int > &  higher_priority_neighbours,
std::vector< std::vector< int >> &  neighbours 
)
inline

The following strategy is derived from I.

Wald, A Simple, General, and GPU Friendly Method for Computing Dual Mesh and Iso-Surfaces of Adaptive Mesh Refinement (AMR) Data, 2020

We validate the scale of all neighbouring blocks need to access the 8 dual corners for each primal corner For each we compute the dual coordinates for primal coordinates with a relative block offset x,y,z in [0, block_size] Due to the fact that block_size is still contained in the offset (rather than [0, block_size - 1], each primal corner is contained in 1 (inside block), 2 (face), 4 (edge) or 8 (corner) neighbouring blocks. We prioritse the block neighbours based on their value (heigher value = higher priority), where the value is calculated via v = 4 << (x is +1) + 2 << (y is +1) + 1 << (z is +1). The minium value is computed for all neighbours for dual corners (c0-8). This means if multiple dual corners fall inside the same neighbouring block we take the minimum value of all the dual corners inside the block. The threshold for populate the lower or higher priority list is the lowest dual corner cost of the corners falling inside the block the relative primal coordinate belongs to.

Parameters
[in]primal_corner_coord_relrelative voxel offset of the primal corner from the block coordinates
[in]block_sizesize of a voxel block in voxel units
[in]lower_priority_neighboursblocks with lower priority, i.e. will be neglected if scale >= scale neighbour
[in]higher_priority_neighboursblocks with higher priority, i.e. will only be neglected if scale > scale neighbour
[in]neighboursvector containing a vector with all corner offsets for a neighbouring block. First index is the main block.

◆ gather_dual_data() [2/2]

template<typename OctreeT , typename DataT >
void se::meshing::gather_dual_data ( const OctreeT &  octree,
const typename OctreeT::BlockType *  block,
const int  scale,
const Eigen::Vector3i &  primal_corner_coord,
DataT  data[8],
std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f >> &  dual_corner_coords_f 
)
inline

◆ compute_dual_index()

template<typename OctreeT , typename DataT >
void se::meshing::compute_dual_index ( const OctreeT &  octree,
const typename OctreeT::BlockType *  block_ptr,
const int  scale,
const Eigen::Vector3i &  primal_corner_coord,
uint8_t &  edge_pattern_idx,
DataT  data[8],
std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f >> &  dual_corner_coords_f 
)

◆ checkVertex()

bool se::meshing::checkVertex ( const Eigen::Vector3f &  vertex_M,
const float  dim 
)
inline

Variable Documentation

◆ norm_dual_offset_f

const Eigen::Vector3f se::meshing::norm_dual_offset_f[8]
static
Initial value:
= {{-1, -1, -1},
{+1, -1, -1},
{+1, -1, +1},
{-1, -1, +1},
{-1, +1, -1},
{+1, +1, -1},
{+1, +1, +1},
{-1, +1, +1}}

◆ logical_dual_offset

const Eigen::Vector3i se::meshing::logical_dual_offset[8]
static
Initial value:
= {{-1, -1, -1},
{+0, -1, -1},
{+0, -1, +0},
{-1, -1, +0},
{-1, +0, -1},
{+0, +0, -1},
{+0, +0, +0},
{-1, +0, +0}}