supereight
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions | Variables
se::meshing Namespace Reference

Classes

struct  Vertex
 
class  VertexIndexMesh
 

Functions

template<typename OctreeT >
Eigen::Vector3f compute_intersection (const OctreeT &octree, const Eigen::Vector3i &coord_0, const Eigen::Vector3i &coord_1)
 Single-res marching cube implementation.
 
template<typename OctreeT >
Eigen::Vector3f interp_vertexes (const OctreeT &octree, const int x, const int y, const int 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 int x, const int y, const int z)
 
template<typename DataT >
Eigen::Vector3f compute_dual_intersection (const DataT &data_0, const DataT &data_1, const Eigen::Vector3f &dual_point_0_M, const Eigen::Vector3f &dual_point_1_M)
 Multires-res marching cube implementation.
 
template<typename DataT , typename ValueSelector >
Eigen::Vector3f interp_dual_vertexes (const int edge, const DataT data[8], const std::array< Eigen::Vector3f, 8 > &dual_corner_coords_f)
 
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::array< Eigen::Vector3f, 8 > &dual_corner_coords_f, std::array< Eigen::Vector3i, 8 > &dual_corner_coords_i)
 
void norm_dual_corner_idxs (const Eigen::Vector3i &primal_corner_coord_rel, const int block_size, BoundedVector< int, 8 > &lower_priority_neighbours, BoundedVector< int, 8 > &higher_priority_neighbours, BoundedVector< BoundedVector< int, 8 >, 8 > &neighbours)
 The following strategy is derived from I.
 
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::array< Eigen::Vector3f, 8 > &dual_corner_coords_f, std::array< Eigen::Vector3i, 8 > &dual_corner_coords_i)
 
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::array< Eigen::Vector3f, 8 > &dual_corner_coords_f, std::array< Eigen::Vector3i, 8 > &dual_corner_coords_i)
 
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]
 

Function Documentation

◆ compute_intersection()

template<typename OctreeT >
Eigen::Vector3f se::meshing::compute_intersection ( const OctreeT octree,
const Eigen::Vector3i &  coord_0,
const Eigen::Vector3i &  coord_1 
)

Single-res marching cube implementation.

◆ interp_vertexes()

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

◆ 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 
)

◆ 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 
)

◆ compute_index()

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

◆ compute_dual_intersection()

template<typename DataT >
Eigen::Vector3f se::meshing::compute_dual_intersection ( const DataT data_0,
const DataT data_1,
const Eigen::Vector3f &  dual_point_0_M,
const Eigen::Vector3f &  dual_point_1_M 
)

Multires-res marching cube implementation.

◆ interp_dual_vertexes()

Eigen::Vector3f se::meshing::interp_dual_vertexes ( const int  edge,
const DataT  data[8],
const std::array< Eigen::Vector3f, 8 > &  dual_corner_coords_f 
)

◆ 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::array< Eigen::Vector3f, 8 > &  dual_corner_coords_f,
std::array< Eigen::Vector3i, 8 > &  dual_corner_coords_i 
)

◆ norm_dual_corner_idxs()

void se::meshing::norm_dual_corner_idxs ( const Eigen::Vector3i &  primal_corner_coord_rel,
const int  block_size,
BoundedVector< int, 8 > &  lower_priority_neighbours,
BoundedVector< int, 8 > &  higher_priority_neighbours,
BoundedVector< BoundedVector< int, 8 >, 8 > &  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]

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::array< Eigen::Vector3f, 8 > &  dual_corner_coords_f,
std::array< Eigen::Vector3i, 8 > &  dual_corner_coords_i 
)

◆ compute_dual_index()

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::array< Eigen::Vector3f, 8 > &  dual_corner_coords_f,
std::array< Eigen::Vector3i, 8 > &  dual_corner_coords_i 
)

◆ 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}}