diff --git a/cell.cpp b/cell.cpp index ee4197c0..d88272b6 100644 --- a/cell.cpp +++ b/cell.cpp @@ -434,7 +434,7 @@ EX int celldist(cell *c) { } if(fulltorus && WDIM == 2) return get_torus_dist(decodeId(c->master)); - if(nil) return DISTANCE_UNKNOWN; + if(nil && !quotient) return DISTANCE_UNKNOWN; if(euwrap && WDIM == 2) return torusconfig::cyldist(decodeId(c->master), 0); if(masterless) diff --git a/nonisotropic.cpp b/nonisotropic.cpp index 56f10946..b8e0ea38 100644 --- a/nonisotropic.cpp +++ b/nonisotropic.cpp @@ -778,7 +778,7 @@ EX namespace nilv { EX int zgmod(int a, int b) { return b ? gmod(a, b) : a; } - array nilperiod, nilperiod_edit; + EX array nilperiod, nilperiod_edit; struct hrmap_nil : hrmap { unordered_map at; @@ -854,6 +854,13 @@ EX namespace nilv { } }; + void set_flags() { + int coords = 0; + for(int a=0; a<3; a++) if(nilperiod[a]) coords++; + set_flag(ginf[gNil].flags, qANYQ, coords); + set_flag(ginf[gNil].flags, qBOUNDED, coords == 3); + } + EX hyperpoint on_geodesic(hyperpoint s0, hyperpoint s1, ld x) { hyperpoint local = inverse(nisot::translate(s0)) * s1; hyperpoint h = get_inverse_exp(local, 100); @@ -907,6 +914,7 @@ EX void show_niltorus3() { dialog::add_action([] { stop_game(); nilperiod = nilperiod_edit; + set_flags(); geometry = gNil; start_game(); }); @@ -1844,6 +1852,13 @@ EX namespace nisot { shift_arg_formula(rots::underlying_scale); return 0; } + else if(argis("-nilperiod")) { + PHASEFROM(2); + if(nil) stop_game(); + for(int a=0; a<3; a++) { shift(); nilv::nilperiod[a] = argi(); } + nilv::set_flags(); + return 0; + } return 1; });