projects
/
tabakrolletjie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5077595
)
Helper for rendering a spiral.
author
Simon Cross
<hodgestar@gmail.com>
Sun, 11 Sep 2016 00:00:12 +0000
(
02:00
+0200)
committer
Simon Cross
<hodgestar@gmail.com>
Sun, 11 Sep 2016 00:00:12 +0000
(
02:00
+0200)
misc/spiral.py
[new file with mode: 0644]
patch
|
blob
diff --git a/misc/spiral.py
b/misc/spiral.py
new file mode 100644
(file)
index 0000000..
6280ddc
--- /dev/null
+++ b/
misc/spiral.py
@@ -0,0
+1,20
@@
+import math
+import json
+
+import pymunk
+
+
+def make_shrub(centre, radial, degrees):
+ radial = radial * (degrees / 80.)
+ c = centre + radial.rotated_degrees(degrees)
+ return [int(round(c.x)), int(round(c.y)), 40]
+
+
+radial = pymunk.Vec2d(40, 0)
+centre = pymunk.Vec2d(512, 400)
+
+obstacles = []
+for d in range(10, 810, 45):
+ obstacles.append(make_shrub(centre, radial, d))
+
+print json.dumps(obstacles)