From 5451196183e23d145bc6f078cb354baa9071b7d7 Mon Sep 17 00:00:00 2001 From: allem Date: Sun, 15 Sep 2019 16:19:10 -0400 Subject: [PATCH] easier distinction between orientations --- cosets/src/main.cpp | 6 +++--- cosets/src/util/mesh.hpp | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cosets/src/main.cpp b/cosets/src/main.cpp index 86d02ab..daa64a1 100644 --- a/cosets/src/main.cpp +++ b/cosets/src/main.cpp @@ -40,7 +40,7 @@ public: const int N = 3; const Mults &mults = schlafli({5, 3}); - vert_data = vertices(mults, {5, 1, 1}); + vert_data = vertices(mults, {1, 1, 1}); edge_data = edges(mults); face_data = faces(mults); @@ -112,8 +112,8 @@ public: glEnable(GL_CULL_FACE); glBindVertexArray(vert_vao); - glUniform4f(0, 1, 1, 1, 1); -// glDrawArrays(GL_POINTS, 0, vert_data.size()); + glUniform4f(0, 1, 0, 0, 1); + glDrawArrays(GL_POINTS, 0, vert_data.size()); glBindVertexArray(edge_vao); glUniform4f(0, 1, 0, 0, 1); diff --git a/cosets/src/util/mesh.hpp b/cosets/src/util/mesh.hpp index 07e552e..e5d0d39 100644 --- a/cosets/src/util/mesh.hpp +++ b/cosets/src/util/mesh.hpp @@ -70,11 +70,15 @@ std::vector faces(const Mults &mults) { Table *t_vert = solve({}, mults); + // todo: try the combinations individually and try to find the pattern. + // for each *kind* of face +// std::vector sg_face{0,1}; for (const auto &sg_face : combinations(N, 2)) { Table *cs_face = solve(sg_face, mults); // for each *kind* of edge +// std::vector sg_edge{1}; for (const auto &sg_edge : combinations(sg_face, 1)) { Table *cs_edge = solve(sg_face, sg_edge, mults); @@ -95,17 +99,13 @@ std::vector faces(const Mults &mults) { } res.push_back(t_vert->apply(0, c_face)); - int s = 0; - s += c_edge.size(); - s += c_face.size(); - s += sg_edge[0]; - s += sg_face[0] + sg_face[1]; + int s = c_edge.size() + sg_edge[0]; + int t = c_face.size() + sg_face[0] + sg_face[1]; - if (s % 2 == 0) { + if (s % 2 == 0 xor t % 2 == 0) { std::swap(res[res.size() - 1], res[res.size() - 2]); } } -// break; } } }