Wildmeshing Toolkit
Loading...
Searching...
No Matches
make_free_sv_mesh.cpp
Go to the documentation of this file.
1
#include "
make_free_sv_mesh.hpp
"
2
#include <numeric>
3
4
5
namespace
wmtk
{
6
7
std::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
24
std::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
make_free_sv_mesh.hpp
wmtk
Definition
Accessor.hpp:6
wmtk::make_free_sv_mesh_with_positions
std::tuple< MatrixXl, Eigen::MatrixXd > make_free_sv_mesh_with_positions(Eigen::Ref< const MatrixXl > S, Eigen::Ref< const Eigen::MatrixXd > V)
Definition
make_free_sv_mesh.cpp:24
wmtk::make_free_sv_mesh
std::tuple< MatrixXl, VectorXl > make_free_sv_mesh(Eigen::Ref< const MatrixXl > S)
Definition
make_free_sv_mesh.cpp:7
wmtk::VectorXl
VectorX< int64_t > VectorXl
Definition
Types.hpp:33
wmtk::MatrixXl
MatrixX< int64_t > MatrixXl
Definition
Types.hpp:56
src
wmtk
utils
make_free_sv_mesh.cpp
Generated by
1.9.8