diff --git a/arbitrile.cpp b/arbitrile.cpp index 290df577..97abba90 100644 --- a/arbitrile.cpp +++ b/arbitrile.cpp @@ -45,6 +45,8 @@ constexpr ld INFINITE_BOTH = -3; struct shape { /** index in the arbi_tiling::shapes */ int id; + /** index in the original file */ + int orig_id; /** flags such as sfLINE and sfPH */ int flags; /** list of vertices in the usual convention */ @@ -79,6 +81,8 @@ struct shape { vector> vertex_angles; /** football types */ int football_type; + /** is it a mirrored version of an original tile */ + bool is_mirrored; }; struct slider { @@ -135,6 +139,8 @@ struct arbi_tiling { int min_valence, max_valence; bool is_football_colorable; + bool was_unmirrored; + bool was_split_for_football; geometryinfo1& get_geometry(); eGeometryClass get_class() { return get_geometry().kind; } @@ -342,6 +348,8 @@ EX void load_tile(exp_parser& ep, arbi_tiling& c, bool unit) { c.shapes.emplace_back(); auto& cc = c.shapes.back(); cc.id = isize(c.shapes) - 1; + cc.orig_id = cc.id; + cc.is_mirrored = false; cc.flags = 0; cc.repeat_value = 1; while(ep.next() != ')') { @@ -442,8 +450,10 @@ EX void unmirror(arbi_tiling& c) { int s = isize(sh); for(int i=0; i= s) sh[i].is_mirrored = true; + } for(int i=s; i colortables = { 0xF08040, 0xF04080, 0x40F080, 0x4080F0, 0x8040F0, 0x80F040, 0xFFD500 }}, + {'M', { // mirrored versions of 'A' + 0xF04060, 0x40F060, 0x4040D0, + 0xD0D040, 0xD000F0, 0x00D040, + 0xC0C0E0, 0x404060, 0x8080A0, + 0xF08060, 0xF040A0, 0x40F0A0, + 0x4080D0, 0x8040D0, 0x80F060, + 0xFFD540 }}, {'B', { // trying to get colors as in Wikipedia [ https://en.wikipedia.org/wiki/Euclidean_tilings_by_convex_regular_polygons#k-uniform_tilings ] 0, 0, 0xFFFFFF, 0xFFFF00, @@ -1784,9 +1791,18 @@ EX namespace patterns { #endif case 'A': #if CAP_ARCM - if(arcm::in()) return colortables['A'][arcm::current.tilegroup[arcm::id_of(c->master)]]; + if(arcm::in()) { + int id = arcm::current.tilegroup[arcm::id_of(c->master)]; + return colortables[(id&1) ? 'M' : 'A'][id/2]; + } #endif - if(arb::in()) return colortables['A'][shvid(c) + c->master->emeraldval * isize(arb::current.shapes)]; + if(arb::in()) { + int id = shvid(c); + auto& sh = arb::current.shapes[id]; + int oid = sh.orig_id; + bool mirrored = c->master->emeraldval || sh.is_mirrored; + return colortables[mirrored ? 'M' : 'A'][oid]; + } return colortables['A'][shvid(c)]; case 'B': if(arb::is_apeirogonal(c)) return apeirogonal_color;