diff --git a/archimedean.cpp b/archimedean.cpp index 60e4d4f8..9e2afb36 100644 --- a/archimedean.cpp +++ b/archimedean.cpp @@ -636,8 +636,12 @@ struct hrmap_archimedean : hrmap { } } } + + transmatrix adj(cell *c, int dir) override { + return calc_relative_matrix(c->cmove(dir), c, C0); + } - transmatrix relative_matrix(heptagon *h2, heptagon *h1) { + transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { if(gmatrix0.count(h2->c7) && gmatrix0.count(h1->c7)) return inverse(gmatrix0[h1->c7]) * gmatrix0[h2->c7]; transmatrix gm = Id, where = Id; diff --git a/cell.cpp b/cell.cpp index 025dfba2..5b30a4e8 100644 --- a/cell.cpp +++ b/cell.cpp @@ -860,7 +860,7 @@ EX cdata *arcmCdata(cell *c) { } EX int getCdata(cell *c, int j) { - if(euclid) return getEuclidCdata(euc2_coordinates(c))->val[j]; + if(euclid && !archimedean && !penrose) return getEuclidCdata(euc2_coordinates(c))->val[j]; else if(archimedean && euclid) return getEuclidCdata(pseudocoords(c))->val[j]; else if(archimedean && hyperbolic) @@ -877,7 +877,7 @@ EX int getCdata(cell *c, int j) { } EX int getBits(cell *c) { - if(euclid) return getEuclidCdata(euc2_coordinates(c))->bits; + if(euclid && !archimedean && !penrose) return getEuclidCdata(euc2_coordinates(c))->bits; else if(archimedean && euclid) return getEuclidCdata(pseudocoords(c))->bits; else if(archimedean && (hyperbolic || sl2)) @@ -1012,7 +1012,7 @@ EX int celldistance(cell *c1, cell *c2) { if(cryst) return crystal::precise_distance(c1, c2); #endif - if(euclid && WDIM == 2) { + if(euclid && WDIM == 2 && !penrose && !archimedean) { return cyldist(euc2_coordinates(c1), euc2_coordinates(c2)); } diff --git a/floorshapes.cpp b/floorshapes.cpp index 6e8f019a..b74e196d 100644 --- a/floorshapes.cpp +++ b/floorshapes.cpp @@ -655,7 +655,9 @@ void geometry_information::generate_floorshapes() { dynamicval ncor(approx_nearcorner, true); for(int i=0; i<2; i++) { modelh.s = hstate(i); /* kite/dart shape */ + kite::no_adj = true; generate_floorshapes_for(i, &model, 0, 0); + kite::no_adj = false; } } #endif diff --git a/pattern2.cpp b/pattern2.cpp index 2aeb7a40..5aa52fbf 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -381,7 +381,7 @@ EX int fieldval_uniq(cell *c) { if(ctof(c)) return c->master->fieldval; else return createMov(c, 0)->master->fieldval + 256 * createMov(c,2)->master->fieldval + (1<<16) * createMov(c,4)->master->fieldval; } - else if(euclid) { + else if(euclid && !penrose && !archimedean) { auto p = euc2_coordinates(c); if(bounded) return p.first + (p.second << 16); return gmod(p.first - 22 * p.second, 3*127); @@ -829,8 +829,8 @@ EX namespace patterns { else if(a46) val46(c, si, sub, pat); else if(a38) val38(c, si, sub, pat); else if(sphere && S3 == 3) valSibling(c, si, sub, pat); - else if(euclid4) valEuclid4(c, si, sub); - else if(euclid) valEuclid6(c, si, sub); + else if(euclid4 && !penrose && !archimedean) valEuclid4(c, si, sub); + else if(euclid6 && !penrose && !archimedean) valEuclid6(c, si, sub); else if(a4) val457(c, si, sub); else si.symmetries = ctof(c) ? 1 : 2; } @@ -911,7 +911,7 @@ EX namespace patterns { val_warped(c, si); else { si.id = pseudohept(c) ? 1 : 0; - if(euclid) { + if(euclid && !penrose && !archimedean) { si.dir = ishex1(c) ? 0 : 3; if(ctof(c)) si.symmetries = 3; if(subpattern_flags & SPF_EXTRASYM) diff --git a/penrose.cpp b/penrose.cpp index 92cae5de..d8f009b1 100644 --- a/penrose.cpp +++ b/penrose.cpp @@ -135,6 +135,8 @@ EX pair>, vector>> make_walls() { inline void print(hstream& hs, pshape sh) { print(hs, sh == pKite ? "pKite" : "pDart"); } +EX bool no_adj; + struct hrmap_kite : hrmap { transmatrix pKite1, pKite2, pKite3, pDart1, pDart2, ipKite1, ipKite2, ipKite3, ipDart1, ipDart2; @@ -294,7 +296,8 @@ struct hrmap_kite : hrmap { graphrule(pKite, 11, pDart, 5, ipKite1 * ipDart1 * pDart2 * pDart2 * pDart2); } - const transmatrix& tmatrix(cell *c, int dir) { + transmatrix adj(cell *c, int dir) override { + if(no_adj) return Id; auto c1 = c->cmove(dir); auto code = encode(getshape(c->master), dir, getshape(c1->master), c->c.spin(dir)); if(!graphrules.count(code)) { @@ -355,7 +358,7 @@ struct hrmap_kite : hrmap { drawcell(c, V); for(int i=0; itype; i++) - dq::enqueue(c->cmove(i)->master, V * tmatrix(c, i)); + dq::enqueue(c->cmove(i)->master, V * adj(c, i)); /* ld err = hdist(where[h->c7->cmove(i)->master] * C0, where[h] * M * C0); if(err > -.01)