Add support for polygon apertures

This commit is contained in:
Garret Fick 2016-06-25 16:46:44 +08:00
parent efcb221fc7
commit ccb6eb7a76
6 changed files with 61 additions and 12 deletions

View file

@ -721,14 +721,15 @@ class Obround(Primitive):
class Polygon(Primitive):
"""
Polygon flash defined by a set number of sized.
Polygon flash defined by a set number of sides.
"""
def __init__(self, position, sides, radius, **kwargs):
def __init__(self, position, sides, radius, hole_radius, **kwargs):
super(Polygon, self).__init__(**kwargs)
validate_coordinates(position)
self.position = position
self.sides = sides
self.radius = radius
self.hole_radius = hole_radius
self._to_convert = ['position', 'radius']
@property
@ -753,7 +754,7 @@ class Polygon(Primitive):
@property
def vertices(self):
offset = math.degrees(self.rotation)
offset = self.rotation
da = 360.0 / self.sides
points = []