summaryrefslogtreecommitdiff
path: root/gerber/primitives.py
diff options
context:
space:
mode:
authorHamilton Kibbe <hamilton.kibbe@gmail.com>2014-10-26 22:43:49 -0400
committerHamilton Kibbe <hamilton.kibbe@gmail.com>2014-10-26 22:43:49 -0400
commit318a81382e074a5897489299a58e029815d23492 (patch)
tree3eeaecb22895522e168514696a8f0d76c6ab47b5 /gerber/primitives.py
parent171876bca01d5c92afd3fa29f2c62c5d50f65511 (diff)
parentc08cdf84bceb43ef452e48396bfbe508f0bdd338 (diff)
downloadgerbonara-318a81382e074a5897489299a58e029815d23492.tar.gz
gerbonara-318a81382e074a5897489299a58e029815d23492.tar.bz2
gerbonara-318a81382e074a5897489299a58e029815d23492.zip
Merge pull request #5 from hamiltonkibbe/cairo_support
Added basic pycairo rendering
Diffstat (limited to 'gerber/primitives.py')
-rw-r--r--gerber/primitives.py17
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):
"""