-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathisolines.cpp
More file actions
33 lines (27 loc) · 937 Bytes
/
isolines.cpp
File metadata and controls
33 lines (27 loc) · 937 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
#include "isolines.hpp"
std::tuple<compas::RowMatrixXd,
compas::RowMatrixXi,
Eigen::VectorXi> trimesh_isolines(
Eigen::Ref<const compas::RowMatrixXd> V,
Eigen::Ref<const compas::RowMatrixXi> F,
Eigen::Ref<const Eigen::VectorXd> isovalues,
Eigen::Ref<const Eigen::VectorXd> vals)
{
compas::RowMatrixXd iV; // iV by dim list of isoline vertex positions
compas::RowMatrixXi iE; // iE by 2 list of edge indices into iV
Eigen::VectorXi I; // ieE by 1 list of indices into vals indicating which value
igl::isolines(V, F, isovalues, vals, iV, iE, I);
return std::make_tuple(iV, iE, I);
}
NB_MODULE(_isolines, m) {
m.doc() = "Isoline computation functions using libigl";
m.def(
"trimesh_isolines",
&trimesh_isolines,
"Compute the isolines of a triangle mesh.",
"V"_a,
"F"_a,
"isovalues"_a,
"vals"_a
);
}