From 46d127401e19bd402f2f7b83ea3d7f174af22621 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 2 Oct 2019 19:22:43 +0200 Subject: [PATCH] nih improvements --- bigstuff.cpp | 4 ++++ cell.cpp | 8 ++++---- classes.cpp | 2 +- devmods/manual-animation.cpp | 6 +++--- graph.cpp | 4 ++-- hyper.h | 2 +- pattern2.cpp | 1 + polygons.cpp | 8 ++++---- 8 files changed, 20 insertions(+), 15 deletions(-) diff --git a/bigstuff.cpp b/bigstuff.cpp index d081153a..39c2eb3b 100644 --- a/bigstuff.cpp +++ b/bigstuff.cpp @@ -1694,6 +1694,10 @@ EX void moreBigStuff(cell *c) { if(c->master->emeraldval % 3 || c->master->zebraval % 3) c->wall = waColumn; } + else if(nih) { + if(c->master->emeraldval % 2) + c->wall = waColumn; + } else if(geometry == gHoroTris || geometry == gHoroRec) { if(c->c.spin(binary::updir()) != 0) c->wall = waColumn; } diff --git a/cell.cpp b/cell.cpp index e23db125..54f0ac6f 100644 --- a/cell.cpp +++ b/cell.cpp @@ -439,7 +439,7 @@ EX int celldist(cell *c) { if(masterless) return eudist(decodeId(c->master)); if(euclid && (penrose || archimedean)) return celldistance(currentmap->gamestart(), c); - if(sphere || binarytiling || WDIM == 3 || cryst || sol || penrose) return celldistance(currentmap->gamestart(), c); + if(sphere || binarytiling || WDIM == 3 || cryst || solnih || penrose) return celldistance(currentmap->gamestart(), c); #if CAP_IRR if(IRREGULAR) return irr::celldist(c, false); #endif @@ -477,7 +477,7 @@ EX int celldistAlt(cell *c) { return euclidAlt(x, y); } #if CAP_BT - if(binarytiling || sol) return c->master->distance + (specialland == laCamelot && !tactic::on? 30 : 0); + if(binarytiling || solnih) return c->master->distance + (specialland == laCamelot && !tactic::on? 30 : 0); #endif if(nil) return c->master->zebraval + abs(c->master->emeraldval) + (specialland == laCamelot && !tactic::on? 30 : 0);; #if CAP_CRYSTAL @@ -914,7 +914,7 @@ EX int heptdistance(heptagon *h1, heptagon *h2) { if(cryst) return crystal::space_distance(h1->c7, h2->c7); #endif #if CAP_SOLV - if(sol) return solv::approx_distance(h1, h2); + if(solnih) return solv::approx_distance(h1, h2); #endif while(true) { if(h1 == h2) return d; @@ -1016,7 +1016,7 @@ EX int celldistance(cell *c1, cell *c2) { if(cryst) return crystal::precise_distance(c1, c2); #endif - if(masterless || archimedean || quotient || sol || (penrose && euclid) || experimental || sl2) { + if(masterless || archimedean || quotient || solnih || (penrose && euclid) || experimental || sl2) { if(saved_distances.count(make_pair(c1,c2))) return saved_distances[make_pair(c1,c2)]; diff --git a/classes.cpp b/classes.cpp index c9bf769a..935871a6 100644 --- a/classes.cpp +++ b/classes.cpp @@ -590,7 +590,7 @@ vector ginf = { {"product","none", "product space", "product", 7, 3, qHYBRID, giProduct, 0x00000, {{7, 3}}, eVariation::pure}, {"twisted","none", "rotation space", "twisted", 7, 3, qHYBRID, giSL2, 0x00000, {{6, 4}}, eVariation::pure}, {"ternary","none", "standard ternary tiling", "ternary", 6, 3, qBINARY, giHyperb2, 0x48400, {{6, 4}}, eVariation::pure}, - {"NIH", "none", "non-isotropic hyperbolic", "NIH", 11, 3, qBINARY | qEXPERIMENTAL, giH23, 0x49000, {{6, 4}}, eVariation::pure}, + {"NIH", "none", "non-isotropic hyperbolic", "NIH", 11, 3, qBINARY, giH23, 0x49000, {{6, 4}}, eVariation::pure}, }; // bits: 9, 10, 15, 16, (reserved for later) 17, 18 diff --git a/devmods/manual-animation.cpp b/devmods/manual-animation.cpp index 983ffd84..e63b4511 100644 --- a/devmods/manual-animation.cpp +++ b/devmods/manual-animation.cpp @@ -57,7 +57,7 @@ bool move_camera(transmatrix T) { return true; } -namespace solv { pair getcoord(heptagon *h); } +namespace solnihv { pair getcoord(heptagon *h); } bignum bdiff(heptagon *h1, heptagon *h2) { if(h1 == h2) return 0; @@ -101,8 +101,8 @@ void get_b4_distance() { if(h1->distance != h2->distance) println(hlog, "Z difference: ", h2->distance - h1->distance); else { - auto c1 = solv::getcoord(h1); - auto c2 = solv::getcoord(h2); + auto c1 = solnihv::getcoord(h1); + auto c2 = solnihv::getcoord(h2); println(hlog, "X difference: ", bdiff(c1.first, c2.first).get_str(10000)); println(hlog, "Y difference: ", bdiff(c1.second, c2.second).get_str(10000)); println(hlog, "X difference> ", bdiff(c2.first, c1.first).get_str(10000)); diff --git a/graph.cpp b/graph.cpp index 97e04d52..a9d26d70 100644 --- a/graph.cpp +++ b/graph.cpp @@ -5119,7 +5119,7 @@ EX void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { } noclipped++; } - if(pmodel == mdGeodesic && sol) { + if(pmodel == mdGeodesic && solnih) { hyperpoint H = tC0(V); if(abs(H[0]) <= 3 && abs(H[1]) <= 3 && abs(H[2]) <= 3 ) ; else { @@ -6057,7 +6057,7 @@ EX void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { for(int a=0; atype; a++) if(c->move(a) && !isWall3(c->move(a), dummy)) { - if(pmodel == mdPerspective && !sphere && !quotient && !penrose && !nonisotropic && !hybri && !experimental) { + if(pmodel == mdPerspective && !sphere && !quotient && !penrose && !nonisotropic && !hybri && !experimental && !nih) { if(a < 4 && among(geometry, gHoroTris, gBinary3) && celldistAlt(c) >= celldistAlt(viewcenter())) continue; else if(a < 2 && among(geometry, gHoroRec) && celldistAlt(c) >= celldistAlt(viewcenter())) continue; else if(c->move(a)->master->distance > c->master->distance && c->master->distance > viewctr.at->distance && !quotient) continue; diff --git a/hyper.h b/hyper.h index 0062b766..50d906e3 100644 --- a/hyper.h +++ b/hyper.h @@ -408,7 +408,7 @@ typedef function cellfunction; // passable flags #define SAGEMELT .1 -#define TEMPLE_EACH (among(geometry, gHoroRec, gHoroHex, gKiteDart3) ? 3 : (sol && binarytiling) ? 6 : (WDIM == 3 && binarytiling) ? 2 : geometry == gSpace435 ? 4 : (WDIM == 3 && hyperbolic) ? 3 : 6) +#define TEMPLE_EACH (among(geometry, gHoroRec, gHoroHex, gKiteDart3) ? 3 : sol ? 6 : (WDIM == 3 && binarytiling) ? 2 : geometry == gSpace435 ? 4 : (WDIM == 3 && hyperbolic) ? 3 : 6) #define PT(x, y) ((tactic::on || quotient == 2 || daily::on) ? (y) : inv::on ? min(2*(y),x) : (x)) #define ROCKSNAKELENGTH 50 #define WORMLENGTH 15 diff --git a/pattern2.cpp b/pattern2.cpp index 393f28c1..f513998e 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -1377,6 +1377,7 @@ EX bool pseudohept(cell *c) { #if CAP_BT if(nil) return c->master->zebraval & c->master->emeraldval & c->master->fieldval & 1; if(sol) return (c->master->emeraldval % 3 == 2) && (c->master->zebraval % 3 == 2) && (c->master->distance % 2); + if(nih) return c->master->zebraval % 3 == 2 && c->master->emeraldval % 2 == 1 && (c->master->distance % 2); if(penrose) return kite::getshape(c->master) == kite::pDart; if(binarytiling) return binary::pseudohept(c); #endif diff --git a/polygons.cpp b/polygons.cpp index f182d800..9cbc429b 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -1000,10 +1000,10 @@ void geometry_information::create_wall3d() { auto pt = [&] (int x, int y, int z) { return xpush(bwh*x) * ypush(bwh*y) * zpush(zstep*z) * C0; }; println(hlog, xpush(1) * ypush(1) * zpush(1) * xpush(-2) * ypush(-3) * zpush(-1) * C0); println(hlog, xpush(1) * ypush(1) * zpush(-1) * xpush(-2) * ypush(-3) * zpush(1) * C0); - make_wall(0, {pt(+3,-3,-1), pt(+3,-3,+1), pt(+3,+3,+1), pt(+3,+3,-1) }); - make_wall(1, {pt(-3,+3,-1), pt(-3,+3,+1), pt(+3,+3,+1), pt(+3,+3,-1)}); - make_wall(2, {pt(-3,-3,-1), pt(-3,-3,+1), pt(-3,+3,+1), pt(-3,+3,-1) }); - make_wall(3, {pt(-3,-3,-1), pt(-3,-3,+1), pt(+3,-3,+1), pt(+3,-3,-1)}); + make_wall(0, {pt(+3,-3,-1), pt(+3,-3,+1), pt(+3,+3,+1), pt(+3,+3,-1), pt(+3,+1,-1), pt(+3,-1,-1) }); + make_wall(1, {pt(-3,+3,-1), pt(-3,+3,+1), pt(+3,+3,+1), pt(+3,+3,-1), pt(+0,+3,-1) }); + make_wall(2, {pt(-3,-3,-1), pt(-3,-3,+1), pt(-3,+3,+1), pt(-3,+3,-1), pt(-3,+1,-1), pt(-3,-1,-1) }); + make_wall(3, {pt(-3,-3,-1), pt(-3,-3,+1), pt(+3,-3,+1), pt(+3,-3,-1), pt(+0,-3,-1)}); make_wall(4, {pt(-3,-3,+1), pt(-3,+3,+1), pt(+3,+3,+1), pt(+3,-3,+1)});