diff --git a/archimedean.cpp b/archimedean.cpp index 655e186f..df717b65 100644 --- a/archimedean.cpp +++ b/archimedean.cpp @@ -8,6 +8,7 @@ static const int sfPH = 1; static const int sfLINE = 2; static const int sfCHESS = 4; static const int sfTHREE = 8; +static const int sfSEMILINE = 16; struct archimedean_tiling { @@ -22,6 +23,7 @@ struct archimedean_tiling { bool have_ph, have_line, have_symmetry; int real_faces; + int real_face_type; int repetition = 1; int N; @@ -61,6 +63,7 @@ struct archimedean_tiling { int support_threecolor(); int support_football(); bool support_chessboard(); + void regroup(); ld scale(); }; @@ -154,6 +157,7 @@ void archimedean_tiling::prepare() { if(inv) at = (at+1) % N; else at = (at+N-1) % N; } + if(!inv) make_match(2*i, 0, inv ? (2*at+2*N-1) % 2*N : 2*at, 0); SDEBUG(printf("-> [%d %d]\n", at, inv);) } } @@ -187,6 +191,14 @@ void archimedean_tiling::prepare() { } printf("\n"); } ) + + for(int i=0; ic.connect(hi.spin, hs); auto p = current.get_adj(hi); - if(current.tilegroup[p.first] != current.tilegroup[id_of(hs.at)]) + if(current.tilegroup[p.first] != current.tilegroup[id_of(hs.at)]) { printf("should merge %d %d\n", p.first, id_of(hs.at)); + current.make_match(p.first, p.second, id_of(hs.at), hs.spin + parent_index_of(hs.at)); + current.regroup(); + } // heptagon *hnew = build_child(h, d, get_adj(h, d).first, get_adj(h, d).second); } @@ -669,8 +694,10 @@ void archimedean_tiling::parse() { have_ph = false; while(true) { if(peek() == ')' || peek() == '^' || (peek() == '(' && isize(faces)) || peek() == 0) break; - else if((peek() == 'L' || peek() == 'l') && faces.size()) + else if((peek() == 'L') && faces.size()) nflags.back() |= sfLINE, have_line = true, at++; + else if((peek() == 'l') && faces.size()) + nflags.back() |= sfSEMILINE, have_line = true, at++; else if((peek() == 'H' || peek() == 'h') && faces.size()) nflags.back() |= sfPH, have_ph = true, at++; else if(isnumber()) faces.push_back(read_number()), nflags.push_back(0); @@ -830,29 +857,33 @@ vector > samples = { /* hyperbolic ones */ {"(4,4,4,4,4)", cHyperRegular}, + {"(4,4,4,4,4,4)", cHyperRegular}, {"(5,5,5,5)", cHyperRegular}, {"(7,7,7)", cHyperRegular}, {"(8,8,8)", cHyperRegular}, {"(7,6,6)", cHyperSemi}, {"(3,3,3,3,7)(1,2)(0,4)(3)", cHyperSemi}, {"(3HL,6,6,6)(1,0)[2](3)", cHyperSemi}, - {"(3,4,4,4,4)", cHyperSemi}, - {"(3,4,4,4,4) (0 1)[2 3](4)", cHyperSemi}, + {"(3,4,4L,4L,4)", cHyperSemi}, // buggy + {"(3l,4l,4,4,4) (0 1)[2 3](4)", cHyperSemi}, {"(3,4,4,4,4) (0 1)(2)(3)(4)", cHyperSemi}, - {"(6,6,3,3,3) (0 2)(1)(3)(4)", cHyperSemi}, + {"(3,4,4L,4L,4L,4)", cHyperSemi}, + {"(6,6,3L,3L,3L) (0 2)(1)(3)(4)", cHyperSemi}, {"(5,3,5,3,3) (0 1)(2 3)(4)", cHyperSemi}, {"(4,3,3,3,3,3) (0 1)(2 3)(4 5)", cHyperSemi}, - {"(3,5,5,5,5,5) (0 1)[2 3](4)(5)", cHyperSemi}, + {"(3l,5l,5,5,5,5) (0 1)[2 3](4)(5)", cHyperSemi}, {"(3,5,5,5,5,5) (0 1)(2 4)(3 5)", cHyperSemi}, - {"(3,5,5,5,5,5) (0 1)(2 4)[3 5]", cHyperSemi}, - {"(3,5,5,5,5,5) (0 1)[2 4](3)(5)", cHyperSemi}, + {"(3l,5l,5,5,5,5) (0 1)(2 4)[3 5]", cHyperSemi}, + {"(3l,5l,5,5,5,5) (0 1)[2 4](3)(5)", cHyperSemi}, {"(3,5,5,5,5,5) (0 1)(2)(3)(4)(5)", cHyperSemi}, /* with digons */ {"(2,3,3,3,3,3) (2,3) (4,5)", cWeird}, {"(6,6)", cWeird}, {"(2,2)", cWeird}, - {"(2,2,2,2,2,2)", cWeird} + {"(2,2,2,2,2,2)", cWeird}, + {"(6,6,2)", cWeird}, + {"(6,6,2,2)", cWeird}, }; int lastsample = 0; diff --git a/landlock.cpp b/landlock.cpp index 8d95182c..9a05562c 100644 --- a/landlock.cpp +++ b/landlock.cpp @@ -1098,7 +1098,7 @@ land_validity_t& land_validity(eLand l) { } if(archimedean) { - if(among(l, laPower, laZebra, laWineyard) && arcm::current.have_ph) return lv::pattern_defined; + if(among(l, laPower, laZebra, laWineyard) && arcm::current.have_line) return lv::pattern_defined; // horocycles not implemented if(isCyclic(l)) return not_implemented; }