diff --git a/archimedean.cpp b/archimedean.cpp index 34803a46..f04feb4f 100644 --- a/archimedean.cpp +++ b/archimedean.cpp @@ -438,7 +438,7 @@ struct hrmap_archimedean : hrmap { parent_index_of(origin) = DUAL ? 1 : 0; id_of(origin) = id; - origin->c7 = newCell(DUAL ? N0/2 : N0, origin); + origin->c7 = newCell(N0/DUALMUL, origin); heptagon *alt = NULL; @@ -517,7 +517,7 @@ heptagon *build_child(heptspin p, pair adj) { id_of(h) = adj.first; parent_index_of(h) = adj.second; int nei = neighbors_of(h); - h->c7 = newCell(DUAL ? nei/2 : nei, h); + h->c7 = newCell(nei/DUALMUL, h); h->distance = p.at->distance + 1; if(adj.first < 2*current.N && !DUAL) { int s = 0; diff --git a/cell.cpp b/cell.cpp index b1ff475a..7a04ecd5 100644 --- a/cell.cpp +++ b/cell.cpp @@ -1259,7 +1259,7 @@ cdata *getHeptagonCdata(heptagon *h) { cdata mydata = *getHeptagonCdata(h->move(0)); for(int di=3; di<5; di++) { - heptspin hs; hs.at = h; hs.spin = di; + heptspin hs(h, di, false); int signum = +1; while(true) { heptspin hstab[15]; diff --git a/complex.cpp b/complex.cpp index 5445cea6..10a7e9a3 100644 --- a/complex.cpp +++ b/complex.cpp @@ -1155,7 +1155,7 @@ namespace mirror { heptspin hs1 = hs + i; if(lev == 0) { if(hs1.at != hs0.at && equal(hs1, hs0, 3)) { - createMirror(cellwalker(hs1.at->c7, hs1.spin, hs1.mirrored), cpid); + createMirror(hs1 + cth, cpid); result++; } } @@ -1165,7 +1165,7 @@ namespace mirror { } void create_archimedean(cellwalker cw, int cpid, bool mirrored) { - heptspin hs(cw.at->master, cw.spin, cw.mirrored); + heptspin hs = cw + cth; heptspin hsx = hs; if(mirrored) hsx += wmirror; if(create_archimedean_rec(hsx, cpid, hs, 2)) return; @@ -1185,9 +1185,7 @@ namespace mirror { if(GOLDBERG) { for(int i=0; itype; i++) { - heptspin hs(cw.at->master, cw.spin, cw.mirrored); - hs = hs + i + wstep + i - (gp::param.first == gp::param.second ? 1 : 0); - createMirror(cellwalker(hs.at->c7, hs.spin, hs.mirrored), cpid); + createMirror(cw + cth + i + wstep + i - (gp::param.first == gp::param.second ? 1 : 0) + cth, cpid); } return; } @@ -1206,17 +1204,13 @@ namespace mirror { } if(GOLDBERG && !(S7 & 1)) { for(int i=0; itype; i++) { - heptspin hs(cw.at->master, cw.spin, cw.mirrored); - hs = hs + i + wstep + 1 + wstep + 1 + (S7/2) - i + 1; - createMirror(cellwalker(hs.at->c7, hs.spin, hs.mirrored), cpid); + createMirror(cw + cth + i + wstep + 1 + wstep + 1 + (S7/2) - i + 1 + cth, cpid); } return; } if(GOLDBERG && (S7 & 1)) { for(int i=0; itype; i++) { - heptspin hs(cw.at->master, cw.spin, cw.mirrored); - hs = hs + i + wstep + (S7/2) + wstep - 2 + wstep + (S7/2) - i; - createMirror(cellwalker(hs.at->c7, hs.spin, hs.mirrored), cpid); + createMirror(cw + cth + i + wstep + (S7/2) + wstep - 2 + wstep + (S7/2) - i + cth, cpid); } return; } @@ -3201,9 +3195,7 @@ namespace windmap { auto &v = neighbors.back(); if(NONSTDVAR && !sphere && !archimedean) for(int l=0; lmaster, cw.spin); - hs = hs + l + wstep; - v.push_back(getId(cellwalker(hs.at->c7, hs.spin))); + v.push_back(getId(cw + cth + l + wstep + cth)); } else for(int l=0; ltype; l++) v.push_back(getId(cw+l+wstep)); diff --git a/geometry2.cpp b/geometry2.cpp index aa63d6b8..1a92585a 100644 --- a/geometry2.cpp +++ b/geometry2.cpp @@ -515,7 +515,7 @@ hyperpoint farcorner(cell *c, int i, int which) { return spin(-t.first - M_PI / c->type) * xpush(ac.inradius[id/2] + ac.inradius[id1/2]) * xspinpush0(M_PI + M_PI/n1*(which?3:-3), ac.circumradius[id1/2]); } if(BITRUNCATED || DUAL) { - int mul = DUAL ? 2 : 1; + int mul = DUALMUL; auto &ac = arcm::current; auto adj = ac.get_adj(c->master, i * mul); heptagon h; cell cx; cx.master = &h; diff --git a/hyper.h b/hyper.h index 96f16443..5244d315 100644 --- a/hyper.h +++ b/hyper.h @@ -538,6 +538,10 @@ int heptagon::degree() { if(archimedean) return arcm::degree(this); else return typedef walker heptspin; typedef walker cellwalker; +static const struct cth_t { cth_t() {}} cth; +heptspin operator+ (cellwalker cw, cth_t) { return heptspin(cw.at->master, cw.spin * DUALMUL, cw.mirrored); } +cellwalker operator+ (heptspin hs, cth_t) { return cellwalker(hs.at->c7, hs.spin / DUALMUL, hs.mirrored); } + #define BUGCOLORS 3 // land completion for shared unlocking diff --git a/hypgraph.cpp b/hypgraph.cpp index 40707764..ff5c2de8 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -807,7 +807,7 @@ void optimizeview() { if(binarytiling || archimedean) { turn = -1, best = View[2][2]; for(int i=0; ic7->type; i++) { - int i1 = i * (DUAL ? 2 : 1); + int i1 = i * DUALMUL; heptagon *h2 = createStep(viewctr.at, i1); transmatrix T = (binarytiling) ? binary::relative_matrix(h2, viewctr.at) : arcm::relative_matrix(h2, viewctr.at); hyperpoint H = View * tC0(T);