diff --git a/cell.cpp b/cell.cpp index d314f5ed..e19d41e6 100644 --- a/cell.cpp +++ b/cell.cpp @@ -111,7 +111,22 @@ struct hrmap_spherical : hrmap { siblings = {1, 0, 10, 4, 3, 8, 9, 11, 5, 6, 2, 7}; else siblings = {1, 0, 3, 2, 5, 4}; - for(int i=0; imove[0] = dodecahedron[i1]; + dodecahedron[i]->setspin(0, 1); + dodecahedron[i]->move[1] = dodecahedron[i2]; + dodecahedron[i]->setspin(1, 0); + dodecahedron[i]->move[2] = dodecahedron[i1]; + dodecahedron[i]->setspin(2, 3+8); + dodecahedron[i]->move[3] = dodecahedron[i2]; + dodecahedron[i]->setspin(3, 2+8); + } + } + else for(int i=0; imove[i] = dodecahedron[i+1]; dodecahedron[0]->setspin(i, 0); dodecahedron[i+1]->move[0] = dodecahedron[0]; @@ -169,11 +184,9 @@ struct hrmap_spherical : hrmap { void verify() { for(int i=0; imaster->c7) { cell *n = newCell(S6, c->master); - - merge(c,d,n,0,false); - heptspin hs; hs.h = c->master; hs.spin = d; hs.mirrored = false; + heptspin hs(c->master, d, false); int alt3 = c->type/2; int alt4 = alt3+1; - /* - heptspin hs2 = hsstep(hsspin(hs, a3), -alt4); - merge(hs2.h->c7, hs2.spin, n, 2, hs2.mirrored); - - heptspin hs3 = hsstep(hsspin(hs, a4), -alt3); - merge(hs3.h->c7, hs3.spin, n, S6-2, hs3.mirrored); - */ - - for(int u=2; uc7, hs.spin, n, u, hs.mirrored); + if(hs.mirrored && geometry == gSmallElliptic) hs+=-1; + hs = hs + alt3 + wstep - alt4; } - extern void verifycell(cell *c); verifycell(n); } else { - bool mirr = c->mirror(d-1); - int di = fixrot(c->spn(d-1)-(mirr?-1:1)); - cell *c2 = createMov(c->mov[d-1], di); - bool nmirr = mirr ^ c->mov[d-1]->mirror(di); - merge(c, d, c2, fix6(c->mov[d-1]->spn(di) - (nmirr?-1:1)), nmirr); + cellwalker cw(c, d, false); + cellwalker cw2 = cw - 1 + wstep - 1 + wstep - 1; + merge(c, d, cw2.c, cw2.spin, cw2.mirrored); } return c->mov[d]; } diff --git a/classes.cpp b/classes.cpp index 53b9bd4c..7a944cc4 100644 --- a/classes.cpp +++ b/classes.cpp @@ -1668,6 +1668,7 @@ geometryinfo ginf[gGUARD] = { {"four heptagons", "4x7", 7, 4, 0, gcHyperbolic, 0x08600, {{4, 3}}}, {"cube", "3x4", 4, 3, 0, gcSphere, 0x10000, {{SEE_ALL, SEE_ALL}}}, {"tetrahedron (buggy)", "3x3", 3, 3, 0, gcSphere, 0x10200, {{SEE_ALL, SEE_ALL}}}, - {"square grid", "4x4", 4, 4, 0, gcEuclid, 0x10400, {{7, 7}}} + {"square grid", "4x4", 4, 4, 0, gcEuclid, 0x10400, {{7, 7}}}, + {"cube/elliptic", "e3x4", 4, 3, qELLIP, gcSphere, 0x10600, {{SEE_ALL, SEE_ALL}}}, }; diff --git a/classes.h b/classes.h index 8b3f79b2..e081290a 100644 --- a/classes.h +++ b/classes.h @@ -194,7 +194,7 @@ enum eLand { laNone, laBarrier, laCrossroads, laDesert, laIce, laCaves, laJungle laSwitch, laMemory }; -enum eGeometry {gNormal, gEuclid, gSphere, gElliptic, gQuotient, gQuotient2, gTorus, gOctagon, g45, g46, g47, gSmallSphere, gTinySphere, gEuclidSquare, gGUARD}; +enum eGeometry {gNormal, gEuclid, gSphere, gElliptic, gQuotient, gQuotient2, gTorus, gOctagon, g45, g46, g47, gSmallSphere, gTinySphere, gEuclidSquare, gSmallElliptic, gGUARD}; enum eGeometryClass { gcHyperbolic, gcEuclid, gcSphere }; diff --git a/geometry.cpp b/geometry.cpp index 4a060ae7..96311d7a 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -107,6 +107,7 @@ void precalc() { if(sphere ? v1 < v2 : v1 > v2) fmin = f; else fmax = f; } tessf = fmin; + if(elliptic && S7 == 4) tessf = M_PI/2; if(vertexdegree == 3) { fmin = 0, fmax = sphere ? M_PI / 2 : 2; diff --git a/hyper.h b/hyper.h index a6a32018..105a2c61 100644 --- a/hyper.h +++ b/hyper.h @@ -241,6 +241,7 @@ struct heptspin { int spin; bool mirrored; heptspin() { mirrored = false; } + heptspin(heptagon *h, int s = 0, bool m = false) : h(h), spin(s), mirrored(m) { } }; struct cell : gcell { diff --git a/polygons.cpp b/polygons.cpp index 34f57376..233cd2c6 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -1387,7 +1387,7 @@ void buildpolys() { if(euclid) fac80 = fac94 = .9; - if(geometry == g47 || geometry == gSmallSphere || geometry == gTinySphere) + if(geometry == g47 || geometry == gSmallSphere || geometry == gTinySphere || geometry == gSmallElliptic) fac80 *= 1.2, fac94 *= .94; if(geometry == gTinySphere)