summaryrefslogtreecommitdiff
path: root/gerber/render_svg.py
diff options
context:
space:
mode:
authorHamilton Kibbe <hamilton.kibbe@gmail.com>2014-09-28 13:04:32 -0400
committerHamilton Kibbe <hamilton.kibbe@gmail.com>2014-09-28 13:04:32 -0400
commit43b599106f746dd42423eda1f91a592813ecc224 (patch)
tree0a8d7673ac30655205f6e369a6fecdaf24ae4986 /gerber/render_svg.py
parent858fc5f6d82c58f4af966c27299e51dd6ba1c097 (diff)
downloadgerbonara-43b599106f746dd42423eda1f91a592813ecc224.tar.gz
gerbonara-43b599106f746dd42423eda1f91a592813ecc224.tar.bz2
gerbonara-43b599106f746dd42423eda1f91a592813ecc224.zip
Add Excellon support
Diffstat (limited to 'gerber/render_svg.py')
-rw-r--r--gerber/render_svg.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/gerber/render_svg.py b/gerber/render_svg.py
index bfe6859..cb42371 100644
--- a/gerber/render_svg.py
+++ b/gerber/render_svg.py
@@ -44,6 +44,9 @@ class Rect(Shape):
stroke_width=2, stroke_linecap="butt")
def flash(self, ctx, x, y):
+ # Center the rectange on x,y
+ x -= (self.size[0] / 2.0)
+ y -= (self.size[0] / 2.0)
return ctx.dwg.rect(insert=(300*x, 300*y), size=(300*float(self.size[0]), 300*float(self.size[1])),
fill="rgb(184, 115, 51)")
@@ -102,5 +105,10 @@ class GerberSvgContext(GerberContext):
self.move(x, y, resolve=False)
- def dump(self):
- self.dwg.saveas("teste.svg")
+ def drill(self, x, y, diameter):
+ hit = self.dwg.circle(center=(x*300, y*300), r=300*(diameter/2.0), fill="gray")
+ self.dwg.add(hit)
+
+
+ def dump(self,filename='teste.svg'):
+ self.dwg.saveas(filename)