forked from libigl/libigl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
direct delta mush review fix and unit test
- Loading branch information
Showing
4 changed files
with
47 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include <test_common.h> | ||
#include <igl/direct_delta_mush.cpp> | ||
#include <igl/adjacency_list.h> | ||
#include <iostream> | ||
|
||
TEST_CASE("direct_delta_mush: cube", "[igl]") | ||
{ | ||
Eigen::MatrixXd V, W, U, Omega; | ||
Eigen::MatrixXi F; | ||
|
||
// Test that direct delta mush with identity transform reproduces the rest state of the mesh. | ||
// For simplicity, testing on a cube of dimensions 1.0 x 1.0 x 1.0, | ||
// with all vertices bound strictly to one and only one imaginary bone (weight is a column of 1s) | ||
igl::read_triangle_mesh(test_common::data_path("cube.off"), V, F); | ||
Eigen::SparseMatrix<double> W_sparse = Eigen::MatrixXd::Ones(V.rows(), 1).sparseView(); | ||
|
||
// Parameters such as p, lambda, kappa, alpha do not matter given identity transform | ||
igl::direct_delta_mush_precomputation(V, F, W_sparse, 1, 1., 0.5, 0.5, Omega); | ||
|
||
std::vector<Eigen::Affine3d, Eigen::aligned_allocator<Eigen::Affine3d>> T_list; | ||
T_list.push_back(Eigen::Affine3d::Identity()); | ||
igl::direct_delta_mush(V, F, T_list, Omega, U); | ||
|
||
test_common::assert_near(U, V, 1e-4); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters