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 create_mesh_from_file(std::string filename, double iso_value =0.5)
Mesh from mesh or image file.
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
PhysicalRegion boundingBox(const std::vector< Mesh > & meshes, bool center =false)
calculate bounding box incrementally for meshes
int findReferenceMesh(std::vector< Mesh > & meshes, int random_subset_size =-1)
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 create_mesh_from_file

static Mesh create_mesh_from_file(
    std::string filename,
    double iso_value =0.5
)

Mesh from mesh or image file.

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 boundingBox

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

calculate bounding box incrementally for meshes

function findReferenceMesh

static int findReferenceMesh(
    std::vector< Mesh > & meshes,
    int random_subset_size =-1
)

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 2024-03-17 at 12:58:44 -0600