diff options
author | jomo <github@jomo.tv> | 2014-05-16 23:04:40 +0200 |
---|---|---|
committer | jomo <github@jomo.tv> | 2014-05-16 23:04:40 +0200 |
commit | 9f1ed1fb668f0a60170eac88909bf2b3e69402f8 (patch) | |
tree | 4a82a8a58a1f623ef29af4bc0fdb2c780d4f773c /plotter.py |
first commit via git
Diffstat (limited to 'plotter.py')
-rwxr-xr-x | plotter.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/plotter.py b/plotter.py new file mode 100755 index 0000000..d825310 --- /dev/null +++ b/plotter.py @@ -0,0 +1,28 @@ +#!/usr/bin/python + +# this was going to be a PlotMe-like plugin "plotter" +# but it seems like PlotMe is still beeing developed, so we don't need our own. + +import sys + +x_plot_size = 3 +z_plot_size = 3 +padding = 1 + +def base_coords(x, z): + pid = plot_id(x, z) + return [pid[0] * (x_plot_size + padding), pid[1] * (z_plot_size + padding)] + +def bounds(x, z): + base = base_coords(x, z) + return [base, [base[0] + x_plot_size, base[1] + z_plot_size]] + +def plot_id(x, z): + return [x // (x_plot_size + padding), z // (z_plot_size + padding)] + + +x = int(sys.argv[1]) +z = int(sys.argv[2]) +print "id: %s" % plot_id(x, z) +print "base: %s" % base_coords(x, z) +print "bounds: %s" % bounds(x, z) |