|
@@ -3,11 +3,9 @@
|
|
#include <igl/readOBJ.h>
|
|
#include <igl/readOBJ.h>
|
|
#include <igl/readOFF.h>
|
|
#include <igl/readOFF.h>
|
|
#include <igl/readMESH.h>
|
|
#include <igl/readMESH.h>
|
|
-#include <igl/sample_edges.h>
|
|
+#include <igl/tetgen/mesh_with_skeleton.h>
|
|
-#include <igl/cat.h>
|
|
|
|
#include <igl/faces_first.h>
|
|
#include <igl/faces_first.h>
|
|
#include <igl/readTGF.h>
|
|
#include <igl/readTGF.h>
|
|
-#include <igl/tetgen/tetrahedralize.h>
|
|
|
|
#include <igl/launch_medit.h>
|
|
#include <igl/launch_medit.h>
|
|
#include <igl/boundary_conditions.h>
|
|
#include <igl/boundary_conditions.h>
|
|
#include <igl/mosek/bbw.h>
|
|
#include <igl/mosek/bbw.h>
|
|
@@ -119,93 +117,6 @@ bool load_skeleton_from_file(
|
|
return success;
|
|
return success;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-bool mesh_with_skeleton(
|
|
|
|
- const Eigen::MatrixXd & V,
|
|
|
|
- const Eigen::MatrixXi & F,
|
|
|
|
- const Eigen::MatrixXd & C,
|
|
|
|
- const Eigen::VectorXi & ,
|
|
|
|
- const Eigen::MatrixXi & BE,
|
|
|
|
- const Eigen::MatrixXi & CE,
|
|
|
|
- Eigen::MatrixXd & VV,
|
|
|
|
- Eigen::MatrixXi & TT,
|
|
|
|
- Eigen::MatrixXi & FF)
|
|
|
|
-{
|
|
|
|
- using namespace Eigen;
|
|
|
|
- using namespace igl;
|
|
|
|
- using namespace std;
|
|
|
|
-
|
|
|
|
- MatrixXi BECE = cat(1,BE,CE);
|
|
|
|
- MatrixXd S;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- sample_edges(C,BECE,10,S);
|
|
|
|
-
|
|
|
|
- MatrixXd VS = cat(1,V,S);
|
|
|
|
-
|
|
|
|
- MatrixXi BF;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- cerr<<"tetgen begin()"<<endl;
|
|
|
|
- int status = tetrahedralize( VS,F,"pq100",VV,TT,FF);
|
|
|
|
- cerr<<"tetgen end()"<<endl;
|
|
|
|
- if(FF.rows() != F.rows())
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
- cerr<<"mesh_with_skeleton: Warning: boundary faces != input faces"<<endl;
|
|
|
|
- }
|
|
|
|
- if(status != 0)
|
|
|
|
- {
|
|
|
|
- cerr<<
|
|
|
|
- "***************************************************************"<<endl<<
|
|
|
|
- "***************************************************************"<<endl<<
|
|
|
|
- "***************************************************************"<<endl<<
|
|
|
|
- "***************************************************************"<<endl<<
|
|
|
|
- "* mesh_with_skeleton: tetgen failed. Just meshing convex hull *"<<endl<<
|
|
|
|
- "***************************************************************"<<endl<<
|
|
|
|
- "***************************************************************"<<endl<<
|
|
|
|
- "***************************************************************"<<endl<<
|
|
|
|
- "***************************************************************"<<endl;
|
|
|
|
-
|
|
|
|
- status = tetrahedralize(VS,F,"q1.414",VV,TT,FF);
|
|
|
|
-
|
|
|
|
- assert(FF.maxCoeff() < VV.rows());
|
|
|
|
- if(status != 0)
|
|
|
|
- {
|
|
|
|
- cerr<<"mesh_with_skeleton: tetgen failed again."<<endl;
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if(WITH_MEDIT)
|
|
|
|
- {
|
|
|
|
- launch_medit(VV,TT,FF,false);
|
|
|
|
- }
|
|
|
|
- return true;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -313,10 +224,16 @@ int main(int argc, char * argv[])
|
|
MatrixXi TT;
|
|
MatrixXi TT;
|
|
|
|
|
|
MatrixXi FF;
|
|
MatrixXi FF;
|
|
- if(!mesh_with_skeleton(V,F,C,P,BE,CE,VV,TT,FF))
|
|
+ if(!mesh_with_skeleton(V,F,C,P,BE,CE,10,VV,TT,FF))
|
|
{
|
|
{
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if(WITH_MEDIT)
|
|
|
|
+ {
|
|
|
|
+ launch_medit(VV,TT,FF,false);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
VectorXi b;
|
|
VectorXi b;
|