Wildmeshing Toolkit
wmtk::components::input Namespace Reference

Classes

class  InputOptions
 

Functions

std::shared_ptr< Meshinput (const std::filesystem::path &file, const bool ignore_z_if_zero, const std::vector< std::string > &tetrahedron_attributes)
 
multimesh::NamedMultiMesh input (const InputOptions &options)
 
multimesh::NamedMultiMesh input (const InputOptions &options, const components::utils::PathResolver &resolver)
 
Eigen::Matrix< int64_t, -1, -1 > tags_from_image (const std::filesystem::path &file)
 
std::shared_ptr< wmtk::TriMeshmesh_with_tag_from_image (const std::filesystem::path &file, const std::string &tag_name)
 Build a tagged triangle mesh from a greyscale image. More...
 

Function Documentation

◆ input() [1/3]

multimesh::NamedMultiMesh wmtk::components::input::input ( const InputOptions options)

Definition at line 28 of file input.cpp.

References input().

Here is the call graph for this function:

◆ input() [2/3]

◆ input() [3/3]

◆ mesh_with_tag_from_image()

std::shared_ptr< wmtk::TriMesh > wmtk::components::input::mesh_with_tag_from_image ( const std::filesystem::path &  file,
const std::string &  tag_name 
)

Build a tagged triangle mesh from a greyscale image.

For each pixel, two triangles are generated. The function was only tested on .png but might also support .jpg. Support for .exr and .tif might be added in the future.

Parameters
filepath to the image
tag_nameattribute name for the face tag representing the images greyscale value

Definition at line 35 of file mesh_with_tag_from_image.cpp.

References wmtk::mesh_utils::set_matrix_attribute(), tags_from_image(), wmtk::Triangle, and wmtk::Vertex.

Referenced by TEST_CASE().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tags_from_image()

Eigen::Matrix<int64_t, -1, -1> wmtk::components::input::tags_from_image ( const std::filesystem::path &  file)

Definition at line 11 of file mesh_with_tag_from_image.cpp.

Referenced by mesh_with_tag_from_image().

Here is the caller graph for this function: