Wildmeshing Toolkit
Loading...
Searching...
No Matches
make_free_sv_mesh.cpp
Go to the documentation of this file.
2#include <numeric>
3
4
5namespace wmtk {
6
7std::tuple<MatrixXl, VectorXl> make_free_sv_mesh(Eigen::Ref<const MatrixXl> S)
8{
9 MatrixXl F(S.rows(), S.cols());
10
11 std::iota(F.data(), F.data() + F.size(), 0);
12
13 VectorXl R(F.size());
14
15 for (int j = 0; j < F.rows(); ++j) {
16 for (int k = 0; k < F.cols(); ++k) {
17 R(S(j, k)) = F(j, k);
18 }
19 }
20
21 return {F, R};
22}
23// reindices the vertices
24std::tuple<MatrixXl, Eigen::MatrixXd> make_free_sv_mesh_with_positions(
25 Eigen::Ref<const MatrixXl> S,
26 Eigen::Ref<const Eigen::MatrixXd> V)
27{
28 auto [F, R] = make_free_sv_mesh(S);
29
30 return {F, V(R, Eigen::all)};
31}
32
33} // namespace wmtk
std::tuple< MatrixXl, Eigen::MatrixXd > make_free_sv_mesh_with_positions(Eigen::Ref< const MatrixXl > S, Eigen::Ref< const Eigen::MatrixXd > V)
std::tuple< MatrixXl, VectorXl > make_free_sv_mesh(Eigen::Ref< const MatrixXl > S)
VectorX< int64_t > VectorXl
Definition Types.hpp:33
MatrixX< int64_t > MatrixXl
Definition Types.hpp:56