From d3864a2e2cb88b255d7892db9e0bf072d448832d Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 1 May 2022 11:18:39 +0200 Subject: [PATCH] arb:: simplified display of apeirogons --- arbitrile.cpp | 8 ++++++++ config.cpp | 2 ++ floorshapes.cpp | 13 +++++++++++-- geom-exp.cpp | 1 + geometry.cpp | 4 +++- 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/arbitrile.cpp b/arbitrile.cpp index 3e601a68..43bb0b40 100644 --- a/arbitrile.cpp +++ b/arbitrile.cpp @@ -1037,8 +1037,16 @@ EX bool is_apeirogonal(cell *c) { return current_or_slided().shapes[id_of(c->master)].apeirogonal; } +EX bool is_apeirogonal() { + if(!in()) return false; + for(auto& sh: current_or_slided().shapes) + if(sh.apeirogonal) return true; + return false; + } + EX bool apeirogon_consistent_coloring = true; EX bool apeirogon_hide_grid_edges = true; +EX bool apeirogon_simplified_display = false; EX transmatrix get_adj(arbi_tiling& c, int t, int dl, int t1, int xdl) { diff --git a/config.cpp b/config.cpp index fc06eca4..a5d075b2 100644 --- a/config.cpp +++ b/config.cpp @@ -650,6 +650,8 @@ EX void initConfig() { -> editable("apeirogon_consistent_coloring", 'c'); param_b(arb::apeirogon_hide_grid_edges, "apeirogon_hide_grid_edges", true) -> editable("apeirogon_hide_grid_edges", 'h'); + param_b(arb::apeirogon_simplified_display, "apeirogon_simplified_display", false) + -> editable("simplified display of apeirogons", 'f'); param_b(display_yasc_codes, "yasc", false) -> editable("YASC codes", 'Y') diff --git a/floorshapes.cpp b/floorshapes.cpp index fa179c2f..d1f2d336 100644 --- a/floorshapes.cpp +++ b/floorshapes.cpp @@ -353,8 +353,17 @@ namespace irr { void generate_floorshapes(); } void geometry_information::finish_apeirogon(hyperpoint center) { last->flags |= POLY_APEIROGONAL; last->she = isize(hpc); - hpcpush(center); - hpcpush(starting_point); + if(arb::apeirogon_simplified_display) { + hyperpoint p = towards_inf(last_point, center, ideal_limit); + hyperpoint q = towards_inf(starting_point, center, ideal_limit); + hpc.push_back(p); + hpc_connect_ideal(p, q); + hpc.push_back(q); + } + else { + hpcpush(center); + hpcpush(starting_point); + } } // !siid equals pseudohept(c) diff --git a/geom-exp.cpp b/geom-exp.cpp index 536d1762..1ce5d027 100644 --- a/geom-exp.cpp +++ b/geom-exp.cpp @@ -980,6 +980,7 @@ EX void showEuclideanMenu() { dialog::addItem(XLAT("tessellation sliders"), '4'); dialog::add_action_push(arb::set_sliders); } + if(arb::is_apeirogonal()) add_edit(arb::apeirogon_simplified_display); #if MAXMDIM >= 4 if(cgflags & qULTRA) { diff --git a/geometry.cpp b/geometry.cpp index 0252fdfb..bb5691a8 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -1169,7 +1169,9 @@ EX string cgi_string() { #endif if(arb::in()) V("ARB", its(arb::current.order)); - + + if(arb::in()) V("AP", its(arb::apeirogon_simplified_display)); + if(cryst) V("CRYSTAL", its(ginf[gCrystal].sides) + its(ginf[gCrystal].vertex)); if(bt::in() || GDIM == 3) V("WQ", its(vid.texture_step));