Wildmeshing Toolkit
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
wmtk::components::image_simulation::EmbedSurface Class Reference

#include <EmbedSurface.hpp>

Public Member Functions

 EmbedSurface (const std::vector< std::string > &img_filenames, const std::vector< Matrix4d > &img_transform={}, const double tol_rel=-1, const double tol_abs=-1)
 Input from meshes.
 
void simplify_surface (const double eps, const int num_threads=0)
 Simplify the input surface while staying within the eps envelope.
 
void remove_duplicates (const double eps)
 Merge vertices that are closer than eps.
 
bool embed_surface (const bool flood_fill=false)
 
void consolidate ()
 Remove unreferenced vertices.
 
const MatrixXd & V_emb () const
 
const MatrixXr & V_emb_r () const
 
const MatrixXd & V_surface () const
 
const MatrixXi & T_emb () const
 
const MatrixSi & T_tags () const
 
const MatrixXi & F_on_surface () const
 
const MatrixXi & F_surface () const
 
void write_surf_off (const std::string &filename) const
 Write surface as read from image.
 
void write_emb_surf_off (const std::string &filename) const
 Write embedded surface.
 
void write_emb_msh (const std::string &filename) const
 
void write_emb_vtu (const std::string &filename) const
 
std::pair< Vector3d, Vector3d > bbox_minmax () const
 
std::pair< Vector3d, Vector3d > bbox_surf_minmax () const
 
std::vector< Eigen::Vector3d > V_surf_to_vector () const
 
std::vector< std::array< size_t, 3 > > F_surf_to_vector () const
 

Public Attributes

bool m_smooth_surface = false
 

Private Member Functions

void V_surf_from_vector (const std::vector< Eigen::Vector3d > &verts)
 
void F_surf_from_vector (const std::vector< std::array< size_t, 3 > > &tris)
 
void tag_from_winding_number ()
 

Private Attributes

std::vector< std::string > m_img_filenames
 
std::vector< ImageData > m_img_datas
 
MatrixXd m_V_surface
 
MatrixXi m_F_surface
 
std::vector< std::vector< std::pair< size_t, size_t > > > m_F_tags_surface
 
std::vector< size_t > modified_nonmanifold_v
 
MatrixXd m_V_emb
 
MatrixXr m_V_emb_r
 
MatrixXi m_T_emb
 
MatrixXi m_F_on_surface
 
MatrixSi m_T_tags
 
std::vector< std::set< int64_t > > m_tags
 
std::vector< MatrixXd > Vs
 
std::vector< MatrixXi > Fs
 

Detailed Description

A class for reading an image and converting it into a tet mesh.

Member Function Documentation

◆ embed_surface()

bool wmtk::components::image_simulation::EmbedSurface::embed_surface ( const bool  flood_fill = false)

Cluster tags by flood-filling regions that are bounded by the surface. All tags within one region are unified by taking the tag with most occurances.

This is for several reasons not the best way to do this.

  1. The tags should be volume-weighted so that the tag that represents the most volume should be picked.
  2. We should not rely on geometric look-up at all, but use the information stored in m_F_tags_surface. This is more work so I took a shortcut here.

◆ simplify_surface()

void wmtk::components::image_simulation::EmbedSurface::simplify_surface ( const double  eps,
const int  num_threads = 0 
)

Simplify the input surface while staying within the eps envelope.

Parameters
epsThe absolute envelope thickness.

◆ write_emb_surf_off()

void wmtk::components::image_simulation::EmbedSurface::write_emb_surf_off ( const std::string &  filename) const

Write embedded surface.

This writes all the vertices that exist in the volume and all triangles that are representing the embedded surface.

◆ write_surf_off()

void wmtk::components::image_simulation::EmbedSurface::write_surf_off ( const std::string &  filename) const

Write surface as read from image.

The surface is all the contours in the image, i.e., the surface in between voxels with different value.


The documentation for this class was generated from the following files: