From b4eee2bc3d2b6db9e1a1354479aeee6cacfbbbf4 Mon Sep 17 00:00:00 2001 From: Alec Jacobson Date: Tue, 9 Sep 2014 01:43:45 -0400 Subject: [PATCH] more robust weight computation in skeleton poser example Former-commit-id: 8309c73bd9e2fd6139df98f6238091f7fa0060ec --- examples/skeleton-posing/example.cpp | 30 +++++++++++++++++------ include/igl/tetgen/mesh_with_skeleton.cpp | 2 +- include/igl/volume.cpp | 9 ++++--- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/examples/skeleton-posing/example.cpp b/examples/skeleton-posing/example.cpp index 1445e5215..427e39920 100644 --- a/examples/skeleton-posing/example.cpp +++ b/examples/skeleton-posing/example.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -710,7 +711,6 @@ bool clean( MatrixXd oldCV = CV; MatrixXi oldCF = CF; remove_unreferenced(oldCV,oldCF,CV,CF,IM); - writeOBJ("remesh.obj",CV,CF); } MatrixXd TV; MatrixXi TT; @@ -727,7 +727,6 @@ bool clean( cout<thresh).cast().sum(); @@ -753,7 +750,6 @@ bool clean( } assert(c==count); boundary_facets(CT,CF); - writeOBJ("boundary_facets.obj",CV,CF); } return true; } @@ -783,14 +779,32 @@ bool robust_weights( #ifdef VERBOSE cout<<"mesh_with_skeleton"<thresh).cast().sum(); + TT.resize(count,oldTT.cols()); + int c = 0; + for(int t = 0;tthresh) + { + TT.row(c++) = oldTT.row(t); + } + } + } + // compute weights VectorXi b; MatrixXd bc; diff --git a/include/igl/tetgen/mesh_with_skeleton.cpp b/include/igl/tetgen/mesh_with_skeleton.cpp index 7fc831936..b6038b18d 100644 --- a/include/igl/tetgen/mesh_with_skeleton.cpp +++ b/include/igl/tetgen/mesh_with_skeleton.cpp @@ -50,7 +50,7 @@ IGL_INLINE bool igl::mesh_with_skeleton( // * has consistent orientation // * has no self-intersections // * has no 0-volume pieces - writeOBJ("mesh_with_skeleton.obj",VS,F); + //writeOBJ("mesh_with_skeleton.obj",VS,F); cerr<<"tetgen begin()"<, Eigen::Matrix< template Eigen::Matrix::Scalar igl::volume_single, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&); template Eigen::Matrix::Scalar igl::volume_single, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::Matrix const&); template void igl::volume, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); +template void igl::volume, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); #endif