summaryrefslogtreecommitdiff
path: root/gerbonara/gerber/aperture_macros/primitive.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2021-12-30 16:40:14 +0100
committerjaseg <git@jaseg.de>2021-12-30 16:40:14 +0100
commitf4b2e74923cc95c683cd7f5c4732d92e4aafd3ba (patch)
treef713a247d3cc2c11463be1af54ff42b0cd9dfb44 /gerbonara/gerber/aperture_macros/primitive.py
parente4941dd5e371e8c9e729a72b8ec30d021bceb0cc (diff)
downloadgerbonara-f4b2e74923cc95c683cd7f5c4732d92e4aafd3ba.tar.gz
gerbonara-f4b2e74923cc95c683cd7f5c4732d92e4aafd3ba.tar.bz2
gerbonara-f4b2e74923cc95c683cd7f5c4732d92e4aafd3ba.zip
Fix rotation bugs, all tests run through
Diffstat (limited to 'gerbonara/gerber/aperture_macros/primitive.py')
-rw-r--r--gerbonara/gerber/aperture_macros/primitive.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/gerbonara/gerber/aperture_macros/primitive.py b/gerbonara/gerber/aperture_macros/primitive.py
index 4d3e597..a587d7e 100644
--- a/gerbonara/gerber/aperture_macros/primitive.py
+++ b/gerbonara/gerber/aperture_macros/primitive.py
@@ -42,7 +42,7 @@ class Primitive:
def to_gerber(self, unit=None):
return f'{self.code},' + ','.join(
- getattr(self, name).to_gerber(unit) for name in type(self).__annotations__) + '*'
+ getattr(self, name).to_gerber(unit) for name in type(self).__annotations__)
def __str__(self):
attrs = ','.join(str(getattr(self, name)).strip('<>') for name in type(self).__annotations__)
@@ -75,7 +75,12 @@ class Circle(Primitive):
# center x/y
x : UnitExpression
y : UnitExpression
- rotation : Expression = ConstantExpression(0.0)
+ rotation : Expression = None
+
+ def __init__(self, unit, args):
+ super().__init__(unit, args)
+ if self.rotation is None:
+ self.rotation = ConstantExpression(0)
def to_graphic_primitives(self, offset, rotation, variable_binding={}, unit=None):
with self.Calculator(variable_binding, unit) as calc: