diff options
author | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2014-10-26 22:35:56 -0400 |
---|---|---|
committer | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2014-10-26 22:36:47 -0400 |
commit | 0437e4198a0ff5d909d4321768341a173930904c (patch) | |
tree | 6f0959a0e5ccc9b101009f4f94f5d826d4500c10 /gerber/primitives.py | |
parent | c285e6b014f38716b257b6cc77245c37ac62b4f1 (diff) | |
download | gerbonara-0437e4198a0ff5d909d4321768341a173930904c.tar.gz gerbonara-0437e4198a0ff5d909d4321768341a173930904c.tar.bz2 gerbonara-0437e4198a0ff5d909d4321768341a173930904c.zip |
cairo working
Diffstat (limited to 'gerber/primitives.py')
-rw-r--r-- | gerber/primitives.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gerber/primitives.py b/gerber/primitives.py index 670b758..b3869e1 100644 --- a/gerber/primitives.py +++ b/gerber/primitives.py @@ -171,6 +171,23 @@ class Obround(Primitive): max_y = self.upper_right[1]
return ((min_x, max_x), (min_y, max_y))
+ @property
+ def subshapes(self):
+ if self.orientation == 'vertical':
+ circle1 = Circle((self.position[0], self.position[1] +
+ (self.height-self.width) / 2.), self.width)
+ circle2 = Circle((self.position[0], self.position[1] -
+ (self.height-self.width) / 2.), self.width)
+ rect = Rectangle(self.position, self.width,
+ (self.height - self.width))
+ else:
+ circle1 = Circle((self.position[0] - (self.height - self.width) / 2.,
+ self.position[1]), self.height)
+ circle2 = Circle((self.position[0] - (self.height - self.width) / 2.,
+ self.position[1]), self.height)
+ rect = Rectangle(self.position, (self.width - self.height),
+ self.height)
+ return {'circle1': circle1, 'circle2': circle2, 'rectangle': rect}
class Polygon(Primitive):
"""
|