summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarret Fick <garret@ficksworkshop.com>2016-03-05 11:44:20 +0800
committerGarret Fick <garret@ficksworkshop.com>2016-03-05 11:44:20 +0800
commit5cb60d6385f167e814df7a608321a4f33da0e193 (patch)
treede5c3376e6d57756e55b279384dee5eb12be1884
parent97355475686dd4bdad1b0bd9a307843ea3c234f2 (diff)
downloadgerbonara-5cb60d6385f167e814df7a608321a4f33da0e193.tar.gz
gerbonara-5cb60d6385f167e814df7a608321a4f33da0e193.tar.bz2
gerbonara-5cb60d6385f167e814df7a608321a4f33da0e193.zip
AM group hasn't implemented offset
-rw-r--r--gerber/primitives.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/gerber/primitives.py b/gerber/primitives.py
index 08aa634..a5ed491 100644
--- a/gerber/primitives.py
+++ b/gerber/primitives.py
@@ -117,7 +117,7 @@ class Primitive(object):
setattr(self, attr, metric(value))
def offset(self, x_offset=0, y_offset=0):
- pass
+ raise NotImplementedError('The offset member must be implemented')
def __eq__(self, other):
return self.__dict__ == other.__dict__
@@ -814,6 +814,12 @@ class AMGroup(Primitive):
def position(self):
return self._position
+ def offset(self, x_offset=0, y_offset=0):
+ self.position = tuple(map(add, self.position, (x_offset, y_offset)))
+
+ for primitive in self.primitives:
+ primitive.offset(x_offset, y_offset)
+
@position.setter
def position(self, new_pos):
'''
@@ -880,9 +886,6 @@ class Outline(Primitive):
def offset(self, x_offset=0, y_offset=0):
for p in self.primitives:
p.offset(x_offset, y_offset)
-
- if self.primitives[0].start != self.primitives[-1].end:
- raise ValueError('Outline must be closed')
@property
def width(self):