arb:: unittile command

This commit is contained in:
Zeno Rogue 2019-12-27 22:59:59 +01:00
parent e4b2453313
commit bf80ef7451
1 changed files with 18 additions and 0 deletions

View File

@ -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<isize(cc.connections); i++)
cc.connections[i] = make_tuple(cc.id, i, false);
}
else if(ep.eat("tile(")) {
c.shapes.emplace_back();
auto& cc = c.shapes.back();