summaryrefslogtreecommitdiff
path: root/gerber/render_svg.py
diff options
context:
space:
mode:
authorPaulo Henrique Silva <ph.silva@gmail.com>2014-09-28 20:02:30 -0300
committerPaulo Henrique Silva <ph.silva@gmail.com>2014-09-28 20:02:30 -0300
commit14e71e2c0c078eaba016c0bca73b6268ee103c6c (patch)
tree0a8d7673ac30655205f6e369a6fecdaf24ae4986 /gerber/render_svg.py
parentbd38028b01fdb6701195f023adfc72820a6f5ce5 (diff)
parent43b599106f746dd42423eda1f91a592813ecc224 (diff)
downloadgerbonara-14e71e2c0c078eaba016c0bca73b6268ee103c6c.tar.gz
gerbonara-14e71e2c0c078eaba016c0bca73b6268ee103c6c.tar.bz2
gerbonara-14e71e2c0c078eaba016c0bca73b6268ee103c6c.zip
Merge pull request #3 from hamiltonkibbe/excellon_support
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)