From bf80ef7451cf318be428db0b6ad6ad088d5f062f Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 27 Dec 2019 22:59:59 +0100 Subject: [PATCH] arb:: unittile command --- arbitrile.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/arbitrile.cpp b/arbitrile.cpp index fe6fb569..088a98f3 100644 --- a/arbitrile.cpp +++ b/arbitrile.cpp @@ -139,6 +139,24 @@ void load(const string& fname) { ep.force_eat("="); ep.extra_params[tok] =ep.parsepar(); } + else if(ep.eat("unittile(")) { + c.shapes.emplace_back(); + auto& cc = c.shapes.back(); + cc.id = isize(c.shapes) - 1; + cc.flags = 0; + while(ep.next() != ')') { + ld angle = ep.rparse(0); + cc.edges.push_back(distunit); + cc.angles.push_back(angle * angleunit + angleofs); + if(ep.eat(",")) continue; + else if(ep.eat(")")) break; + else throw hr_parse_exception("expecting , or )"); + } + cc.build_from_angles_edges(); + cc.connections.resize(cc.size()); + for(int i=0; i