diff --git a/bigstuff.cpp b/bigstuff.cpp index 262d2038..bb7dfc79 100644 --- a/bigstuff.cpp +++ b/bigstuff.cpp @@ -1487,7 +1487,7 @@ EX bool good_for_wall(cell *c) { EX bool walls_not_implemented() { // if(WDIM == 3 && !PURE) return true; - if(sphere || quotient || nonisotropic || (kite::in() && !bt::in()) || experimental) return true; + if(sphere || quotient || nonisotropic || aperiodic || experimental) return true; return WDIM == 3 && (cgflags & qIDEAL); } diff --git a/cell.cpp b/cell.cpp index fdcd217f..41585eca 100644 --- a/cell.cpp +++ b/cell.cpp @@ -598,7 +598,7 @@ EX int celldist(cell *c) { return hybrid::celldistance(c, currentmap->gamestart()); if(nil && !quotient) return DISTANCE_UNKNOWN; if(euc::in()) return celldistance(currentmap->gamestart(), c); - if(sphere || bt::in() || WDIM == 3 || cryst || sn::in() || kite::in() || closed_manifold) return celldistance(currentmap->gamestart(), c); + if(sphere || bt::in() || WDIM == 3 || cryst || sn::in() || aperiodic || closed_manifold) return celldistance(currentmap->gamestart(), c); #if CAP_IRR if(IRREGULAR) return irr::celldist(c, false); #endif @@ -1298,7 +1298,7 @@ EX int celldistance(cell *c1, cell *c2) { return euc::cyldist(euc2_coordinates(c1), euc2_coordinates(c2)); } - if(arcm::in() || quotient || sn::in() || (kite::in() && euclid) || experimental || sl2 || nil || arb::in()) + if(arcm::in() || quotient || sn::in() || (aperiodic && euclid) || experimental || sl2 || nil || arb::in()) return clueless_celldistance(c1, c2); if(S3 >= OINF) return inforder::celldistance(c1, c2); @@ -1547,7 +1547,7 @@ EX vector reverse_directions(heptagon *c, int dir) { } EX bool standard_tiling() { - return !arcm::in() && !kite::in() && !bt::in() && !arb::in() && (WDIM == 2 || !nonisotropic) && !mhybrid; + return !arcm::in() && !aperiodic && !bt::in() && !arb::in() && (WDIM == 2 || !nonisotropic) && !mhybrid; } EX int valence() { diff --git a/celldrawer.cpp b/celldrawer.cpp index 4dcb8017..d5a9feb2 100644 --- a/celldrawer.cpp +++ b/celldrawer.cpp @@ -1776,7 +1776,7 @@ void celldrawer::draw_features_and_walls_3d() { /* always render */ if(wrl::in && wrl::print) ; else #endif - if(pmodel == mdPerspective && !sphere && !quotient && !kite::in() && !nonisotropic && !mhybrid && !experimental && !nih) { + if(pmodel == mdPerspective && !sphere && !quotient && !aperiodic && !nonisotropic && !mhybrid && !experimental && !nih) { if(a < 4 && among(geometry, gHoroTris, gBinary3) && celldistAlt(c) >= celldistAlt(centerover)) continue; else if(a < 2 && among(geometry, gHoroRec) && celldistAlt(c) >= celldistAlt(centerover)) continue; // this optimization is not correct, need to fix diff --git a/classes.cpp b/classes.cpp index 79458e1c..05f7bb80 100644 --- a/classes.cpp +++ b/classes.cpp @@ -826,6 +826,8 @@ static const flagtype qSTRETCHABLE = Flag(27); static const flagtype qCAT = Flag(28); +static const flagtype qAPERIODIC = Flag(29); + // note: dnext assumes that x&7 equals 7 static const int SEE_ALL = 50; // note: check_football_colorability in arbitrile.cpp assumes OINF is divisible by 3 @@ -925,7 +927,7 @@ EX vector ginf = { {"{5,3,4}","field", "{5,3,4} field quotient space", "f435", 12, 4, qsSMALLBF | qDEPRECATED, giHyperb3, {{SEE_ALL, SEE_ALL}}, eVariation::pure}, {"binary4","none", "standard binary tiling", "binary4", 5, 3, qBINARY, giHyperb2, {{7, 5}}, eVariation::pure}, {"sol", "none", "Solv geometry", "sol", 8, 3, qBINARY|qSOL, giSol, {{7, 5}}, eVariation::pure}, - {"kd2", "none", "kite-and-dart", "kd2", 4, 3, qKITE, giEuclid2, {{7, 7}}, eVariation::pure}, + {"kd2", "none", "kite-and-dart", "kd2", 4, 3, qKITE | qAPERIODIC, giEuclid2, {{7, 7}}, eVariation::pure}, {"kd3", "none", "kite-and-dart on horospheres", "kd3", 12, 3, qsBP, giHyperb3, {{7, 3}}, eVariation::pure}, {"nil", "none", "Nil geometry", "nil", 6, 3, qOPTQ, giNil, {{7, 5}}, eVariation::pure}, {"product","none", "product space", "product", 7, 3, qHYBRID, giProduct, {{7, 3}}, eVariation::pure}, diff --git a/complex.cpp b/complex.cpp index eca27d8b..a877bee4 100644 --- a/complex.cpp +++ b/complex.cpp @@ -1179,7 +1179,7 @@ EX namespace mirror { #endif EX bool build(cell *c) { - if(kite::in() || sol) return false; + if(aperiodic || sol) return false; #if CAP_GP if(GOLDBERG) { if(c == c->master->c7) { @@ -1311,7 +1311,7 @@ EX namespace mirror { EX void createMirrors(cellwalker cw, int cpid) { - if(kite::in() || sol) return; + if(aperiodic || sol) return; #if CAP_ARCM if(arcm::in()) { diff --git a/expansion.cpp b/expansion.cpp index 84d98b36..8adaa6a6 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -398,7 +398,7 @@ EX bool sizes_known() { if(bt::in()) return false; // not implemented if(arcm::in()) return false; - if(kite::in()) return false; + if(aperiodic) return false; if(currentmap->strict_tree_rules()) return true; if(arb::in()) return false; return true; diff --git a/floorshapes.cpp b/floorshapes.cpp index 76434e61..09af34dd 100644 --- a/floorshapes.cpp +++ b/floorshapes.cpp @@ -1113,7 +1113,7 @@ EX struct dqi_poly *draw_shapevec(cell *c, const shiftmatrix& V, const vectorspacedist(c, d); } EX transmatrix ddspin_side(cell *c, int d, ld bonus IS(0)) { if(cgi.emb->is_in_noniso()) return spin(bonus); - if(kite::in()) { + if(aperiodic) { if(embedded_plane) return spin(bonus); hyperpoint h1 = get_corner_position(c, gmod(d, c->type), 3); hyperpoint h2 = get_corner_position(c, gmod(d+1, c->type) , 3); @@ -492,7 +492,7 @@ EX transmatrix ddspin_side(cell *c, int d, ld bonus IS(0)) { EX transmatrix iddspin_side(cell *c, int d, ld bonus IS(0)) { if(cgi.emb->is_in_noniso()) return spin(bonus); - if(kite::in()) { + if(aperiodic) { if(embedded_plane) return spin(bonus); hyperpoint h1 = get_corner_position(c, gmod(d, c->type), 3); hyperpoint h2 = get_corner_position(c, gmod(d+1, c->type) , 3); @@ -561,7 +561,7 @@ transmatrix hrmap_standard::adj(cell *c, int i) { EX double randd() { return (rand() + .5) / (RAND_MAX + 1.); } EX hyperpoint randomPointIn(int t) { - if(NONSTDVAR || arcm::in() || kite::in()) { + if(NONSTDVAR || arcm::in() || aperiodic) { // Let these geometries be less confusing. // Also easier to implement ;) return xspinpush0(TAU * randd(), asinh(randd() / 20)); @@ -674,7 +674,7 @@ EX hyperpoint nearcorner(cell *c, int i) { neis[5] = bt::get_horopoint(0, -1); return neis[i]; } - if(kite::in()) { + if(aperiodic) { if(approx_nearcorner) return currentmap->get_corner(c, i, 3) + currentmap->get_corner(c, i+1, 3) - C0; else @@ -741,7 +741,7 @@ EX hyperpoint farcorner(cell *c, int i, int which) { } #endif #if CAP_BT - if(bt::in() || kite::in()) + if(bt::in() || aperiodic) return nearcorner(c, (i+which) % c->type); // lazy #endif #if CAP_ARCM @@ -870,7 +870,7 @@ int brm_hook = addHook(hooks_clearmemory, 0, []() { }); EX bool exhaustive_distance_appropriate() { - if(euclid && (kite::in() || arcm::in() || arb::in() || quotient)) return true; + if(euclid && (aperiodic || arcm::in() || arb::in() || quotient)) return true; #if MAXMDIM >= 4 if(nil && quotient) return true; #endif diff --git a/hyper.h b/hyper.h index 4018e505..efe00772 100644 --- a/hyper.h +++ b/hyper.h @@ -200,6 +200,7 @@ void addMessage(string s, char spamtype = 0); #define INVERSE among(variation, eVariation::unrectified, eVariation::warped, eVariation::untruncated ) +#define aperiodic (cgflags & qAPERIODIC) #define UNRECTIFIED (variation == eVariation::unrectified) #define WARPED (variation == eVariation::warped) #define UNTRUNCATED (variation == eVariation::untruncated) diff --git a/landlock.cpp b/landlock.cpp index 0b5cd576..3394fa0c 100644 --- a/landlock.cpp +++ b/landlock.cpp @@ -891,7 +891,7 @@ EX land_validity_t& land_validity(eLand l) { return dont_work; // mirrors do not work in kite and sol - if(among(l, laMirror, laMirrorOld) && (kite::in() || sol)) + if(among(l, laMirror, laMirrorOld) && (aperiodic || sol)) return dont_work; if(isCrossroads(l) && geometry == gBinary4) @@ -1033,7 +1033,7 @@ EX land_validity_t& land_validity(eLand l) { return special_chaos; return not_in_chaos; } - if(arcm::in() || kite::in()) return not_implemented; + if(arcm::in() || aperiodic) return not_implemented; if(closed_or_bounded) return unbounded_only; if(INVERSE) return not_implemented; } @@ -1193,7 +1193,7 @@ EX land_validity_t& land_validity(eLand l) { return great_walls_missing; // highlight Crossroads on Euclidean - if(euclid && !quotient && (l == laCrossroads || l == laCrossroads4) && !kite::in()) + if(euclid && !quotient && (l == laCrossroads || l == laCrossroads4) && !aperiodic) return full_game; if(sol && among(l, laCrossroads, laCrossroads4)) diff --git a/nonisotropic.cpp b/nonisotropic.cpp index b327ec27..3af86511 100644 --- a/nonisotropic.cpp +++ b/nonisotropic.cpp @@ -1752,7 +1752,7 @@ EX namespace product { EX bool validate_spin() { if(mproduct) return hybrid::in_underlying_geometry(validate_spin); - if(kite::in()) return false; + if(aperiodic) return false; if(!quotient && !arcm::in()) return true; map cws; manual_celllister cl; diff --git a/pattern2.cpp b/pattern2.cpp index a4c36155..b1938dbd 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -900,7 +900,7 @@ EX namespace patterns { if(IRREGULAR || arcm::in() || bt::in() || arb::in() || WDIM == 3 || currentmap->strict_tree_rules()) si.symmetries = c->type; else if(a46) val46(c, si, sub, pat); else if(a38) val38(c, si, sub, pat); - else if(S7 < 6 && S3 == 3 && !INVERSE && !kite::in()) valSibling(c, si, sub, pat); + else if(S7 < 6 && S3 == 3 && !INVERSE && !aperiodic) valSibling(c, si, sub, pat); else if(euc::in(2,4)) valEuclid4(c, si, sub); else if(euc::in(2,6)) valEuclid6(c, si, sub); else if(a4) val457(c, si, sub); @@ -1287,14 +1287,14 @@ EX bool geosupport_chessboard() { #endif WARPED ? true : INVERSE ? false : - (bt::in() || kite::in()) ? 0 : + (bt::in() || aperiodic) ? 0 : (S3 >= OINF) ? true : (valence() % 2 == 0); } EX int geosupport_threecolor() { if(IRREGULAR) return 0; - if(kite::in() || bt::in()) return 0; + if(aperiodic || bt::in()) return 0; #if CAP_ARCM if(arcm::in() && PURE) return arcm::current.support_threecolor(); if(arcm::in() && BITRUNCATED) return arcm::current.support_threecolor_bitruncated(); @@ -1317,7 +1317,7 @@ EX int geosupport_football() { // always works in bitrunc geometries if(BITRUNCATED) return 2; if(INVERSE) return 0; - if(bt::in() || kite::in()) return 0; + if(bt::in() || aperiodic) return 0; #if CAP_ARCM if(arcm::in() && DUAL) return false; diff --git a/raycaster.cpp b/raycaster.cpp index f9866b86..88e94c28 100644 --- a/raycaster.cpp +++ b/raycaster.cpp @@ -122,7 +122,7 @@ EX bool available() { if(noGUI) return false; if(!vid.usingGL) return false; if(GDIM == 2) return false; - if(WDIM == 2 && (kite::in() || bt::in())) return false; + if(WDIM == 2 && (aperiodic || bt::in())) return false; #ifdef GLES_ONLY if(need_many_cell_types()) return false; if(!euclid && !gproduct && !nil) return false; diff --git a/rulegen.cpp b/rulegen.cpp index 43fefd6f..9bbe30b4 100644 --- a/rulegen.cpp +++ b/rulegen.cpp @@ -2553,7 +2553,7 @@ EX void show() { "tessellations (contrary to the basic implementation of Archimedean, tes, and unrectified/warped/untruncated tessellations).\n\nYou can convert mostly any " "non-spherical periodic 2D tessellation to strict tree based.\n\nSwitching the map format erases your map.")); - if(kite::in()) { + if(aperiodic) { dialog::addInfo("not available in aperiodic tessellations"); dialog::addBack(); dialog::display(); diff --git a/system.cpp b/system.cpp index f0c4d744..11426211 100644 --- a/system.cpp +++ b/system.cpp @@ -1410,7 +1410,7 @@ EX void set_geometry(eGeometry target) { if(DUAL && geometry != gArchimedean && !mhybrid) variation = ginf[geometry].default_variation; #if CAP_BT - if(bt::in() || WDIM == 3 || kite::in() || arb::in()) if(!mhybrid) variation = eVariation::pure; + if(bt::in() || WDIM == 3 || aperiodic || arb::in()) if(!mhybrid) variation = eVariation::pure; #endif if(S3 >= OINF) variation = eVariation::pure; if(INVERSE && !mhybrid) variation = gp::variation_for(gp::param); @@ -1444,7 +1444,7 @@ EX void set_variation(eVariation target) { return; } if(target != eVariation::pure) { - if(bt::in() || sol || kite::in() || WDIM == 3) if(!mproduct) geometry = gNormal; + if(bt::in() || sol || aperiodic || WDIM == 3) if(!mproduct) geometry = gNormal; } auto& cd = ginf[gCrystal]; if(target == eVariation::bitruncated && cryst && cd.sides == 8 && cd.vertex == 4) {