diff --git a/euclid.cpp b/euclid.cpp index 1de96c61..ab2266ce 100644 --- a/euclid.cpp +++ b/euclid.cpp @@ -497,13 +497,13 @@ namespace euclid3 { heptagon *build(heptagon *parent, int d, coord at) { auto h = get_at(at); - h->c.connect(d^1, parent, d, false); + h->c.connect((d+3)%6, parent, d, false); return h; } heptagon *createStep(heptagon *parent, int d) { int at = ispacemap[parent]; - coord shifttable[6] = { +1, -1, +1000, -1000, +1000000, -1000000 }; + coord shifttable[6] = { +1, +1000, +1000000, -1, -1000, -1000000 }; return build(parent, d, at + shifttable[d]); } }; @@ -556,7 +556,7 @@ namespace euclid3 { drawcell(c, V, 0, false); for(int i=0; i<6; i++) - dq::enqueue(h->move(i), V * cpush(i>>1, (i&1) ? -1 : 1)); + dq::enqueue(h->move(i), V * cpush(i%3, (i>=3) ? -1 : 1)); } } diff --git a/game.cpp b/game.cpp index 08a8b6dd..5eda1b6a 100644 --- a/game.cpp +++ b/game.cpp @@ -4163,6 +4163,16 @@ cell *determinePush(cellwalker who, cell *c2, int subdir, const T& valid, int& p } cellwalker push = who; push += wstep; + if(DIM == 3 && binarytiling) { + for(int a=0; a<4; a++) { + if(push.spin < 4) push.spin = 8; + else if(push.spin >= 8) push.spin = a; + else push.spin ^= 1; + push += wstep; + if(valid(push.at)) return push.at; + } + return c2; + } int pd = push.at->type/2; push += pd * -subdir; push += wstep; diff --git a/hyper.h b/hyper.h index 461a8fbf..6624e26f 100644 --- a/hyper.h +++ b/hyper.h @@ -506,6 +506,11 @@ template struct walker { } walker& operator += (rev_t) { int d = at->degree(); + if(DIM == 3 && binarytiling) { + if(spin < 4) spin = 8; + else if(spin >= 8) spin = 0; + else spin ^= 1; + } return (*this) += d/2 + ((d&1)?hrand(2):0); } walker& operator += (revstep_t) { diff --git a/polygons.cpp b/polygons.cpp index 07d4fdf5..af088b27 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -2516,10 +2516,10 @@ void buildpolys() { bshape(shBinaryWall[w], PPR::WALL); for(int a=0; a<=4; a++) { int t[3]; - t[0] = (w&1) ? -1 : 1; + t[0] = (w>=3) ? -1 : 1; t[1] = among(a, 0, 3, 4) ? -1 : 1; t[2] = among(a, 2, 3) ? -1 : 1; - int x = w/2; + int x = w%3; int y = (x+2)%3; int z = (y+2)%3; hpcpush(hpxy3(t[x]/2., t[y]/2., t[z]/2.)); diff --git a/sphere.cpp b/sphere.cpp index 4143770b..debc0ea4 100644 --- a/sphere.cpp +++ b/sphere.cpp @@ -277,6 +277,10 @@ void gen600() { adj0.clear(); for(int i=0; i<120; i++) if(inedge[root][i]) adj0.push_back(i); + + using namespace hyperpoint_vec; + for(int i=0; i<6; i++) for(int j=i+1; j<12; j++) if(zero_d(vertices120[adj0[i]] + vertices120[adj0[j]], 3)) + swap(adj0[j], adj0[i+6]); for(int i=0; i<120; i++) for(int j=0; j<120; j++) if(hdist(vertices120[i], vertices120[j]) > 3)