diff options
author | Paulo Henrique Silva <ph.silva@gmail.com> | 2015-02-21 02:48:55 -0200 |
---|---|---|
committer | Paulo Henrique Silva <ph.silva@gmail.com> | 2015-02-21 02:48:55 -0200 |
commit | b8dcc86cb4560d033761db0ad41924f6d9669333 (patch) | |
tree | 0fbda714542e90c96f3ba9da4e9d0a70ebb37f5a /gerber/cam.py | |
parent | dbe93f77e5d9630c035f204a932284372ecf124d (diff) | |
parent | b3e0ceb5c3ec755b09d2f005b8e3dcbed22d45a1 (diff) | |
download | gerbonara-b8dcc86cb4560d033761db0ad41924f6d9669333.tar.gz gerbonara-b8dcc86cb4560d033761db0ad41924f6d9669333.tar.bz2 gerbonara-b8dcc86cb4560d033761db0ad41924f6d9669333.zip |
Merge pull request #20 from curtacircuitos/ipc-d-356
Add IPC-D-356 Netlist Parsing
Diffstat (limited to 'gerber/cam.py')
-rw-r--r-- | gerber/cam.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/gerber/cam.py b/gerber/cam.py index 243070d..31b6d2f 100644 --- a/gerber/cam.py +++ b/gerber/cam.py @@ -53,7 +53,8 @@ class FileSettings(object): and vice versa """ def __init__(self, notation='absolute', units='inch', - zero_suppression=None, format=(2, 5), zeros=None): + zero_suppression=None, format=(2, 5), zeros=None, + angle_units='degrees'): if notation not in ['absolute', 'incremental']: raise ValueError('Notation must be either absolute or incremental') self.notation = notation @@ -84,6 +85,10 @@ class FileSettings(object): raise ValueError('Format must be a tuple(n=2) of integers') self.format = format + if angle_units not in ('degrees', 'radians'): + raise ValueError('Angle units may be degrees or radians') + self.angle_units = angle_units + @property def zero_suppression(self): return self._zero_suppression @@ -114,6 +119,8 @@ class FileSettings(object): return self.zeros elif key == 'format': return self.format + elif key == 'angle_units': + return self.angle_units else: raise KeyError() @@ -144,6 +151,11 @@ class FileSettings(object): raise ValueError('Format must be a tuple(n=2) of integers') self.format = value + elif key == 'angle_units': + if value not in ('degrees', 'radians'): + raise ValueError('Angle units may be degrees or radians') + self.angle_units = value + else: raise KeyError('%s is not a valid key' % key) @@ -151,7 +163,8 @@ class FileSettings(object): return (self.notation == other.notation and self.units == other.units and self.zero_suppression == other.zero_suppression and - self.format == other.format) + self.format == other.format and + self.angle_units == other.angle_units) class CamFile(object): |