diff options
author | Paulo Henrique Silva <ph.silva@gmail.com> | 2015-04-24 13:34:26 -0300 |
---|---|---|
committer | Paulo Henrique Silva <ph.silva@gmail.com> | 2015-04-24 13:34:26 -0300 |
commit | 80cdaf075e97da688e95dc2c5d5f2c3d702fdf5a (patch) | |
tree | c07ae5b56ccb13bce694ce1b51b4eab19ace0622 /gerber/rs274x.py | |
parent | a3cce62be741cb2bc1e65165ba4f0b45c8838b60 (diff) | |
parent | 390838fc8b70c9b105fdc1d3e35a4533b27faa83 (diff) | |
download | gerbonara-80cdaf075e97da688e95dc2c5d5f2c3d702fdf5a.tar.gz gerbonara-80cdaf075e97da688e95dc2c5d5f2c3d702fdf5a.tar.bz2 gerbonara-80cdaf075e97da688e95dc2c5d5f2c3d702fdf5a.zip |
Merge pull request #26 from curtacircuitos/unit_conversion_fix
Fix for #25. Check units at the primitive level
Diffstat (limited to 'gerber/rs274x.py')
-rw-r--r-- | gerber/rs274x.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gerber/rs274x.py b/gerber/rs274x.py index 606d27f..3dcddb4 100644 --- a/gerber/rs274x.py +++ b/gerber/rs274x.py @@ -469,12 +469,12 @@ class GerberParser(object): end = (x, y) if self.interpolation == 'linear': - self.primitives.append(Line(start, end, self.apertures[self.aperture], level_polarity=self.level_polarity)) + self.primitives.append(Line(start, end, self.apertures[self.aperture], level_polarity=self.level_polarity, units=self.settings.units)) else: i = 0 if stmt.i is None else stmt.i j = 0 if stmt.j is None else stmt.j center = (start[0] + i, start[1] + j) - self.primitives.append(Arc(start, end, center, self.direction, self.apertures[self.aperture], level_polarity=self.level_polarity)) + self.primitives.append(Arc(start, end, center, self.direction, self.apertures[self.aperture], level_polarity=self.level_polarity, units=self.settings.units)) elif self.op == "D02": pass @@ -489,6 +489,7 @@ class GerberParser(object): else: primitive.position = (x, y) primitive.level_polarity = self.level_polarity + primitive.units = self.settings.units self.primitives.append(primitive) self.x, self.y = x, y |