diff options
Diffstat (limited to 'gerber/render_svg.py')
-rw-r--r-- | gerber/render_svg.py | 12 |
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) |