35 const std::vector<Vector3>&
vertices,
bool centerLast =
false) {
39 unsigned int offset = centerLast ? 1 : 0;
40 std::vector<size_t> face(vertices.size() -
offset);
41 std::iota(face.begin(), face.end(), 0);
42 faces.push_back(face);
44 unsigned int anker = centerLast ? vertices.size() - 1 : 0;
45 for (
unsigned int it = 2 - offset;
it < vertices.size() -
offset; ++
it) {
46 triangularMesh.push_back({anker,
it - 1, it});
50 triangularMesh.push_back({anker, vertices.size() - 2, 0});
52 return {faces, triangularMesh};
67 const std::vector<Vector3>&
vertices,
bool fullTwoPi =
true) {
70 size_t nqfaces =
static_cast<size_t>(0.5 * vertices.size());
71 size_t reduce = (not fullTwoPi) ? 1 : 0;
72 for (
size_t iface = 0; iface < nqfaces - reduce; ++iface) {
73 size_t p2 = (iface + 1 == nqfaces) ? 0 : iface + 1;
74 std::vector<size_t> face = {iface, p2, p2 + nqfaces, nqfaces + iface};
75 faces.push_back(face);
76 std::vector<size_t> triA = {iface, p2, p2 + nqfaces};
77 triangularMesh.push_back(triA);
78 std::vector<size_t> triB = {p2 + nqfaces, nqfaces + iface, iface};
79 triangularMesh.push_back(triB);
81 return {faces, triangularMesh};