forked from compas-dev/compas_libigl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcotmatrix.cpp
More file actions
39 lines (34 loc) · 881 Bytes
/
cotmatrix.cpp
File metadata and controls
39 lines (34 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "cotmatrix.hpp"
Eigen::SparseMatrix<double>
trimesh_cotmatrix(
Eigen::Ref<const compas::RowMatrixXd> V,
Eigen::Ref<const compas::RowMatrixXi> F
) {
Eigen::SparseMatrix<double> L;
igl::cotmatrix(V, F, L);
return L;
}
compas::RowMatrixXd
trimesh_cotmatrix_entries(
Eigen::Ref<const compas::RowMatrixXd> V,
Eigen::Ref<const compas::RowMatrixXi> F
) {
Eigen::MatrixXd C;
igl::cotmatrix_entries(V, F, C);
compas::RowMatrixXd C_row = C;
return C_row;
}
NB_MODULE(_cotmatrix, m) {
m.def(
"trimesh_cotmatrix",
&trimesh_cotmatrix,
"Compute the cotangent Laplacian matrix for a triangle mesh.",
"V"_a, "F"_a
);
m.def(
"trimesh_cotmatrix_entries",
&trimesh_cotmatrix_entries,
"Compute cotangent values for each edge in each triangle.",
"V"_a, "F"_a
);
}