Template Class MeshIntegrator

Class Documentation

template <typename VoxelType>
class MeshIntegrator

Integrates a TSDF layer to incrementally update a mesh layer using marching cubes.

Public Functions

void initFromSdfLayer(const Layer<VoxelType> &sdf_layer)
MeshIntegrator(const MeshIntegratorConfig &config, Layer<VoxelType> *sdf_layer, MeshLayer *mesh_layer)

Use this constructor in case you would like to modify the layer during mesh extraction, i.e.

modify the updated flag.

MeshIntegrator(const MeshIntegratorConfig &config, const Layer<VoxelType> &sdf_layer, MeshLayer *mesh_layer)

This constructor will not allow you to modify the layer, i.e.

clear the updated flag.

void generateMesh(bool only_mesh_updated_blocks, bool clear_updated_flag)

Generates mesh from the tsdf layer.

void generateMeshBlocksFunction(const BlockIndexList &all_tsdf_blocks, bool clear_updated_flag, ThreadSafeIndex *index_getter)
void extractBlockMesh(typename Block<VoxelType>::ConstPtr block, Mesh::Ptr mesh)
virtual void updateMeshForBlock(const BlockIndex &block_index)
void extractMeshInsideBlock(const Block<VoxelType> &block, const VoxelIndex &index, const Point &coords, VertexIndex *next_mesh_index, Mesh *mesh)
void extractMeshOnBorder(const Block<VoxelType> &block, const VoxelIndex &index, const Point &coords, VertexIndex *next_mesh_index, Mesh *mesh)
void updateMeshColor(const Block<VoxelType> &block, Mesh *mesh)

Protected Attributes

MeshIntegratorConfig config_
Layer<VoxelType> *sdf_layer_mutable_

Having both a const and a mutable pointer to the layer allows this integrator to work both with a const layer (in case you don’t want to clear the updated flag) and mutable layer (in case you do want to clear the updated flag).

const Layer<VoxelType> *sdf_layer_const_
MeshLayer *mesh_layer_
FloatingPoint voxel_size_
size_t voxels_per_side_
FloatingPoint block_size_
FloatingPoint voxel_size_inv_
FloatingPoint voxels_per_side_inv_
FloatingPoint block_size_inv_
Eigen::Matrix<int, 3, 8> cube_index_offsets_