diff --git a/svg.py b/svg.py
index fb162848..040e9a2a 100755
--- a/svg.py
+++ b/svg.py
@@ -1,4 +1,3 @@
-## {{{ http://code.activestate.com/recipes/325823/ (r1)
#!/usr/bin/env python
"""\
SVG.py - Construct/display SVG scenes.
@@ -23,8 +22,12 @@ def add(self,item): self.items.append(item)
def strarray(self):
var = ["\n",
'\n"]
return var
@@ -43,6 +46,34 @@ def display(self):
os.system("%s" % (self.svgname))
return
+class Grid:
+ def __init__(self,width,height,spacing=20):
+ self.width = width
+ self.height = height
+ return
+ def strarray(self):
+ w = self.width
+ h = self.height
+ return [' \n' %
+ (0,0,w,h),
+ ' \n' %
+ (0,h,w,0),
+ ' \n' %
+ (0,h*0.3333,w*0.3333,0),
+ ' \n' %
+ (0,h*0.6667,w*0.6667,0),
+ ' \n' %
+ (0,h*0.3333,w*0.6667,h),
+ ' \n' %
+ (0,h*0.6667,w*0.3333,h),
+ ' \n' %
+ (w*0.3333,h,w,h*0.3333),
+ ' \n' %
+ (w*0.3333,0,w,h*0.6667),
+ ' \n' %
+ (w*0.6667,0,w,h*0.3333),
+ ' \n' %
+ (w*0.6667,h,w,h*0.6667)]
class Line:
def __init__(self,start,end):
@@ -108,5 +139,5 @@ def test():
scene.display()
return
-if __name__ == '__main__': test()
-## end of http://code.activestate.com/recipes/325823/ }}}
+if __name__ == '__main__':
+ test()