10 std::tuple<RowVectors6l, RowVectors4l, RowVectors4l, VectorXl, VectorXl, VectorXl>
21 std::vector<std::vector<int64_t>> TTT;
30 int64_t vertex_count = T.maxCoeff() + 1;
35 TTT.resize(T.rows() * 4);
36 for (int64_t t = 0; t < T.rows(); ++t) {
37 for (int64_t i = 0; i < 4; ++i) {
42 if (x > y) std::swap(x, y);
43 if (y > z) std::swap(y, z);
44 if (x > y) std::swap(x, y);
46 std::vector<int64_t> r(5);
55 std::sort(TTT.begin(), TTT.end());
67 VT.resize(vertex_count, 1);
68 for (int64_t i = 0; i < T.rows(); ++i) {
69 for (int64_t j = 0; j < T.cols(); ++j) {
75 TF.resize(T.rows(), 4);
76 TT.resize(T.rows(), 4);
77 std::vector<int64_t> FT_temp;
82 for (int64_t i = 0; i < TTT.size(); ++i) {
83 if ((i == TTT.size() - 1) || (TTT[i][0] != TTT[i + 1][0]) ||
84 (TTT[i][1] != TTT[i + 1][1]) || (TTT[i][2] != TTT[i + 1][2])) {
86 FT_temp.push_back(TTT[i][it]);
88 TT(TTT[i][it], TTT[i][ii]) = -1;
89 TF(TTT[i][it], TTT[i][ii]) = FT_temp.size() - 1;
94 FT_temp.push_back(TTT[i][it]);
96 TT(TTT[i][it], TTT[i][ii]) = TTT[i + 1][it];
97 TF(TTT[i][it], TTT[i][ii]) = FT_temp.size() - 1;
99 TT(TTT[i + 1][it], TTT[i + 1][ii]) = TTT[i][it];
100 TF(TTT[i + 1][it], TTT[i + 1][ii]) = FT_temp.size() - 1;
107 FT.resize(FT_temp.size());
108 for (int64_t i = 0; i < FT_temp.size(); ++i) FT(i) = FT_temp[i];
114 TTT.resize(T.rows() * 6);
115 for (int64_t t = 0; t < T.rows(); ++t) {
116 for (int64_t i = 0; i < 6; ++i) {
120 if (x > y) std::swap(x, y);
122 std::vector<int64_t> r(5);
131 std::sort(TTT.begin(), TTT.end());
144 TE.resize(T.rows(), 6);
145 std::vector<int64_t> ET_temp;
150 for (int64_t i = 0; i < TTT.size(); ++i) {
151 if ((i == TTT.size() - 1) || (TTT[i][0] != TTT[i + 1][0]) ||
152 (TTT[i][1] != TTT[i + 1][1])) {
154 ET_temp.push_back(TTT[i][it]);
157 TE(TTT[i][it], TTT[i][ii]) = ET_temp.size() - 1;
160 ET_temp.push_back(TTT[i][it]);
163 TE(TTT[i][it], TTT[i][ii]) = ET_temp.size() - 1;
167 while ((i + j < TTT.size()) && (TTT[i][0] == TTT[i + j][0]) &&
168 (TTT[i][1] == TTT[i + j][1])) {
169 TE(TTT[i + j][it], TTT[i + j][ii]) = ET_temp.size() - 1;
179 ET.resize(ET_temp.size());
180 for (int64_t i = 0; i < ET_temp.size(); ++i) ET(i) = ET_temp[i];
183 return {TE, TF, TT, VT, ET, FT};
const int64_t auto_3d_edges[6][2]
const int64_t auto_3d_faces[4][3]
RowVectors< int64_t, 6 > RowVectors6l
RowVectors< int64_t, 4 > RowVectors4l
VectorX< int64_t > VectorXl
std::tuple< RowVectors6l, RowVectors4l, RowVectors4l, VectorXl, VectorXl, VectorXl > tetmesh_topology_initialization(Eigen::Ref< const RowVectors4l > T)
Given the mesh connectivity in matrix format, finds unique edges and faces and their relations.