Skip to content

shapeworks::MeshUtils

Module: Mesh Classes

More...

#include <MeshUtils.h>

Public Functions

Name
const vtkSmartPointer< vtkMatrix4x4 > createICPTransform(const Mesh source, const Mesh target, Mesh::AlignmentType align, const unsigned iterations =20, bool meshTransform =false)
computes a rigid transformation from source to target using vtkIterativeClosestPointTransform
Mesh threadSafeReadMesh(std::string filename)
Thread safe reading of a mesh, uses a lock.
void threadSafeWriteMesh(std::string filename, Mesh mesh)
Thread safe writing of a mesh, uses a lock.
PhysicalRegion boundingBox(const std::vector< std::string > & filenames, bool center =false)
calculate bounding box incrementally for meshes
PhysicalRegion boundingBox(const std::vector< std::reference_wrapper< const Mesh >> & meshes, bool center =false)
calculate bounding box incrementally for meshes
size_t findReferenceMesh(std::vector< Mesh > & meshes)
determine the reference mesh
Mesh boundaryLoopExtractor(Mesh mesh)
boundary loop extractor for a given mesh
std::array< Mesh, 3 > sharedBoundaryExtractor(const Mesh & mesh_l, const Mesh & mesh_r, double tol)
shared boundary extractor for the left and right mesh
void generateNormals(const std::vector< std::reference_wrapper< Mesh >> & meshes, bool forceRegen =false)
generates and adds normals for points and faces for each mesh in given set of meshes
Field computeMeanNormals(const std::vector< std::string > & filenames, bool autoGenerateNormals =true)
computes average normals for each point in given set of meshes
Field computeMeanNormals(const std::vector< std::reference_wrapper< const Mesh >> & meshes)
computes average normals for each point in given set of meshes
void visualizeVectorFieldForFFCs(std::shared_ptr< Mesh > mesh)
This function visualizes vector and scalar fields for FFCs.
vtkSmartPointer< vtkActor > getArrow(Eigen::Vector3d start, Eigen::Vector3d end)
Used as an auxiliary function for vector field visualizations.

Detailed Description

class shapeworks::MeshUtils;

This class provides helper functions for meshes

Public Functions Documentation

function createICPTransform

static const vtkSmartPointer< vtkMatrix4x4 > createICPTransform(
    const Mesh source,
    const Mesh target,
    Mesh::AlignmentType align,
    const unsigned iterations =20,
    bool meshTransform =false
)

computes a rigid transformation from source to target using vtkIterativeClosestPointTransform

function threadSafeReadMesh

static Mesh threadSafeReadMesh(
    std::string filename
)

Thread safe reading of a mesh, uses a lock.

function threadSafeWriteMesh

static void threadSafeWriteMesh(
    std::string filename,
    Mesh mesh
)

Thread safe writing of a mesh, uses a lock.

function boundingBox

static PhysicalRegion boundingBox(
    const std::vector< std::string > & filenames,
    bool center =false
)

calculate bounding box incrementally for meshes

function boundingBox

static PhysicalRegion boundingBox(
    const std::vector< std::reference_wrapper< const Mesh >> & meshes,
    bool center =false
)

calculate bounding box incrementally for meshes

function findReferenceMesh

static size_t findReferenceMesh(
    std::vector< Mesh > & meshes
)

determine the reference mesh

function boundaryLoopExtractor

static Mesh boundaryLoopExtractor(
    Mesh mesh
)

boundary loop extractor for a given mesh

function sharedBoundaryExtractor

static std::array< Mesh, 3 > sharedBoundaryExtractor(
    const Mesh & mesh_l,
    const Mesh & mesh_r,
    double tol
)

shared boundary extractor for the left and right mesh

function generateNormals

static void generateNormals(
    const std::vector< std::reference_wrapper< Mesh >> & meshes,
    bool forceRegen =false
)

generates and adds normals for points and faces for each mesh in given set of meshes

function computeMeanNormals

static Field computeMeanNormals(
    const std::vector< std::string > & filenames,
    bool autoGenerateNormals =true
)

computes average normals for each point in given set of meshes

function computeMeanNormals

static Field computeMeanNormals(
    const std::vector< std::reference_wrapper< const Mesh >> & meshes
)

computes average normals for each point in given set of meshes

function visualizeVectorFieldForFFCs

void visualizeVectorFieldForFFCs(
    std::shared_ptr< Mesh > mesh
)

This function visualizes vector and scalar fields for FFCs.

function getArrow

vtkSmartPointer< vtkActor > getArrow(
    Eigen::Vector3d start,
    Eigen::Vector3d end
)

Used as an auxiliary function for vector field visualizations.


Updated on 2022-07-23 at 16:40:07 -0600