Libs/Mesh/MeshWarper.h
Mesh warping capability. More...
Namespaces
| Name |
|---|
| shapeworks User usage reporting (telemetry) |
Classes
| Name | |
|---|---|
| class | shapeworks::MeshWarper |
Detailed Description
Mesh warping capability.
The MeshWarper provides an object to warp meshes for surface reconstruction
Source code
```cpp
pragma once
include
include
include
include
namespace shapeworks {
enum class WarpMethod { Laplacian, Biharmonic };
class MeshWarper {
public:
void set_reference_mesh(vtkSmartPointer
bool generate_warp();
bool get_warp_available();
bool is_contour() const { return is_contour_; }
vtkSmartPointer
Eigen::MatrixXd extract_landmarks(vtkSmartPointer
bool is_contour() { return this->is_contour_; }
std::map
std::vector
const Eigen::MatrixXd& get_warp_matrix() const { return this->warp_; }
bool has_bad_particles() const { return this->bad_particle_count() > 0; }
vtkSmartPointer
const Eigen::MatrixXd& get_reference_particles() const { return this->reference_particles_; }
void set_warp_method(WarpMethod method) { warp_method_ = method; }
WarpMethod get_warp_method() const { return warp_method_; }
int get_num_warp_vertices() const;
protected: virtual void update_progress(float p) {}
private: bool check_warp_ready();
void add_particle_vertices(Eigen::MatrixXd& vertices);
Eigen::MatrixXd remove_bad_particles(const Eigen::MatrixXd& particles);
void split_cell_on_edge(int cell_id, int new_vertex, int v0, int v1,
std::vector
void find_good_particles();
bool find_landmarks_vertices_on_ref_mesh();
bool generate_warp_matrix(Eigen::MatrixXd target_vertices, Eigen::MatrixXi target_faces, const Eigen::MatrixXd& references_vertices, Eigen::MatrixXd& warp);
vtkSmartPointer
size_t bad_particle_count() const { return size_t(reference_particles_.rows()) - good_particles_.size(); }
void diagnose_biharmonic_failure(const Eigen::MatrixXd& TV, const Eigen::MatrixXi& TF,
const std::vector
bool generate_laplacian_warp(const Eigen::MatrixXd& V, const Eigen::MatrixXi& F, const Eigen::MatrixXd& control_points);
vtkSmartPointer
// Members Eigen::MatrixXi faces_; Eigen::MatrixXd vertices_; Eigen::MatrixXd warp_; Eigen::MatrixXd landmarks_points_;
std::vector
bool needs_warp_ = true;
bool warp_available_ = false;
std::map
WarpMethod warp_method_ = WarpMethod::Biharmonic;
igl::min_quad_with_fixed_data
Eigen::MatrixXd laplacian_vertices_;
Eigen::VectorXi laplacian_handles_;
Eigen::SparseMatrix
Eigen::MatrixXd handle_default_;
bool laplacian_ready_ = false;
};
} // namespace shapeworks
```
Updated on 2026-03-31 at 16:02:11 +0000