From 18113f157f912986472a8c3cc0b667ed1a0aed4e Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 14 Sep 2022 22:53:39 +0200 Subject: [PATCH] rulegen vs extended football --- arbitrile.cpp | 10 ++++++++-- geometry.cpp | 2 ++ rulegen.cpp | 22 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/arbitrile.cpp b/arbitrile.cpp index 184fe6b5..ab6a0068 100644 --- a/arbitrile.cpp +++ b/arbitrile.cpp @@ -583,7 +583,7 @@ EX void compute_vertex_valence(arb::arbi_tiling& ac) { } } -bool extended_football = true; +EX bool extended_football = true; EX void check_football_colorability(arbi_tiling& c) { if(cgflags & qAFFINE) return; @@ -635,7 +635,7 @@ EX void check_football_colorability(arbi_tiling& c) { } } - if(extended_football) { + if(extended_football && !c.have_tree) { for(auto&sh: c.shapes) sh.football_type = 0; @@ -1452,6 +1452,7 @@ EX void run(string fname) { try { load(fname); ginf[gArbitrary].tiling_name = current.name; + tes = fname; } catch(hr_polygon_error& poly) { set_geometry(g); @@ -1789,6 +1790,8 @@ EX void convert() { sh.connections.clear(); sh.cycle_length = id.modval; sh.repeat_value = t / id.modval; + sh.flags = hr::pseudohept(s) ? arcm::sfPH : 0; + if(arcm::in() && arcm::linespattern(s)) { sh.flags |= arcm::sfLINE; ac.have_line = true; } for(int j=0; jget_corner(s, j); sh.vertices.push_back(co); @@ -1829,6 +1832,9 @@ EX void convert() { } arb::compute_vertex_valence(ac); + + ac.have_ph = geosupport_football() ? 1 : 0; + arb::check_football_colorability(ac); } EX bool in() { diff --git a/geometry.cpp b/geometry.cpp index c3f2af0f..97bb15d0 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -1178,6 +1178,8 @@ EX string cgi_string() { if(arb::in()) V("AP", its(arb::apeirogon_simplified_display)); + if(arb::in()) V("F", its(arb::extended_football)); + if(cryst) V("CRYSTAL", its(ginf[gCrystal].sides) + its(ginf[gCrystal].vertex)); if(bt::in() || GDIM == 3) V("WQ", its(vid.texture_step)); diff --git a/rulegen.cpp b/rulegen.cpp index 7b6adcd9..0f8d1364 100644 --- a/rulegen.cpp +++ b/rulegen.cpp @@ -2584,6 +2584,28 @@ EX void show() { } }); + dialog::addBoolItem(XLAT("extended football colorability"), arb::extended_football, 'f'); + dialog::add_action([] { + arb::extended_football = !arb::extended_football; + rules_known_for = "unknown"; + rule_status = "manually disabled"; + if(arb::convert::in()) { + stop_game(); + arb::convert::convert(); + arb::convert::activate(); + start_game(); + } + else if(arb::in()) { + stop_game(); + try { + arb::load(arb::tes); + } + catch(hr_parse_exception& ex) { + println(hlog, "failed: ", ex.s); + } + start_game(); + } + }); add_edit(arb::convert::minimize_on_convert); dialog::addBoolItem(XLAT("strict tree based"), currentmap->strict_tree_rules(), 's'); dialog::add_action([] {