From 6b594b9fc913b404c98e4cef749a45100b957073 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 25 Mar 2021 11:12:58 +0100 Subject: [PATCH] cgi.cellshape is now vector of vectors --- euclid.cpp | 23 +++++++++++++---------- geometry.cpp | 2 +- polygons.cpp | 11 ++--------- reg3.cpp | 30 ++++++++++++++++++------------ 4 files changed, 34 insertions(+), 32 deletions(-) diff --git a/euclid.cpp b/euclid.cpp index 03fb4c7e..4e37cb39 100644 --- a/euclid.cpp +++ b/euclid.cpp @@ -1304,6 +1304,9 @@ EX void generate() { cgi.loop = 4; cgi.schmid = 3; + cs.clear(); + cs.resize(S7); + if(S7 == 6) { cgi.adjcheck = 1; cgi.face = 4; @@ -1316,7 +1319,7 @@ EX void generate() { int x = w%3; int y = (x+2)%3; int z = (y+2)%3; - cs.push_back(hpxy3(t[x]/2., t[y]/2., t[z]/2.)); + cs[w].push_back(hpxy3(t[x]/2., t[y]/2., t[z]/2.)); } } } @@ -1331,10 +1334,10 @@ EX void generate() { int third = 3 - valid[1] - valid[0]; hyperpoint v0 = cpush0(valid[0], co[valid[0]] > 0 ? 1 : -1); hyperpoint v1 = cpush0(valid[1], co[valid[1]] > 0 ? 1 : -1); - cs.push_back(v0); - cs.push_back(v0/2 + v1/2 + cpush0(third, .5) - C0); - cs.push_back(v1); - cs.push_back(v0/2 + v1/2 + cpush0(third, -.5) - C0); + cs[w].push_back(v0); + cs[w].push_back(v0/2 + v1/2 + cpush0(third, .5) - C0); + cs[w].push_back(v1); + cs[w].push_back(v0/2 + v1/2 + cpush0(third, -.5) - C0); } } @@ -1345,10 +1348,10 @@ EX void generate() { for(int w=0; w<14; w++) { if(w%7 < 3) { int z = w>=7?-1:1; - cs.push_back(cpush0(w%7, z) + cpush0((w%7+1)%3, 1/2.) - C0); - cs.push_back(cpush0(w%7, z) + cpush0((w%7+2)%3, 1/2.) - C0); - cs.push_back(cpush0(w%7, z) + cpush0((w%7+1)%3,-1/2.) - C0); - cs.push_back(cpush0(w%7, z) + cpush0((w%7+2)%3,-1/2.) - C0); + cs[w].push_back(cpush0(w%7, z) + cpush0((w%7+1)%3, 1/2.) - C0); + cs[w].push_back(cpush0(w%7, z) + cpush0((w%7+2)%3, 1/2.) - C0); + cs[w].push_back(cpush0(w%7, z) + cpush0((w%7+1)%3,-1/2.) - C0); + cs[w].push_back(cpush0(w%7, z) + cpush0((w%7+2)%3,-1/2.) - C0); } else { auto t = v[w]; @@ -1356,7 +1359,7 @@ EX void generate() { for(hyperpoint h: { hpxy3(x, y/2, 0), hpxy3(x/2, y, 0), hpxy3(0, y, z/2), hpxy3(0, y/2, z), hpxy3(x/2, 0, z), hpxy3(x, 0, z/2) - }) cs.push_back(h); + }) cs[w].push_back(h); } } } diff --git a/geometry.cpp b/geometry.cpp index cb50e47d..d0ecdd79 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -125,7 +125,7 @@ struct geometry_information { int loop, face, schmid; - vector cellshape; + vector> cellshape; vector vertices_only; transmatrix spins[32], adjmoves[32]; diff --git a/polygons.cpp b/polygons.cpp index a9e12a80..8571286d 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -999,15 +999,8 @@ void geometry_information::create_wall3d() { } if(euc::in() || reg3::in()) { - int facesize = isize(cgi.cellshape) / S7; - int next = 0; - for(int w=0; w vertices; - if(S7 == 14) facesize = (w%7 < 3 ? 4 : 6); - for(int a=0; a