diff options
author | jaseg <git@jaseg.de> | 2022-02-01 22:08:54 +0100 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2022-02-01 22:08:54 +0100 |
commit | 7473e471dc69d09a35bb0762549cc4f3ab8b04b3 (patch) | |
tree | dcd162f56a5dbeac6ee669fc85d582813fd48eea /gerbonara/rs274x.py | |
parent | c3ca4f95bd59f69d45e582a4149327f57a360760 (diff) | |
download | gerbonara-7473e471dc69d09a35bb0762549cc4f3ab8b04b3.tar.gz gerbonara-7473e471dc69d09a35bb0762549cc4f3ab8b04b3.tar.bz2 gerbonara-7473e471dc69d09a35bb0762549cc4f3ab8b04b3.zip |
Add some documentation
Diffstat (limited to 'gerbonara/rs274x.py')
-rw-r--r-- | gerbonara/rs274x.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gerbonara/rs274x.py b/gerbonara/rs274x.py index 8bd622b..837440f 100644 --- a/gerbonara/rs274x.py +++ b/gerbonara/rs274x.py @@ -79,6 +79,9 @@ class GerberFile(CamFile): return ExcellonFile(objects=new_objs, comments=self.comments) + def to_gerber(self): + return + def merge(self, other): """ Merge other GerberFile into this one """ if other is None: @@ -222,9 +225,9 @@ class GerberFile(CamFile): def save(self, filename, settings=None, drop_comments=True): with open(filename, 'w', encoding='utf-8') as f: # Encoding is specified as UTF-8 by spec. - f.write(self.to_gerber(settings, drop_comments=drop_comments)) + f.write(self.generate_gerber(settings, drop_comments=drop_comments)) - def to_gerber(self, settings=None, drop_comments=True): + def generate_gerber(self, settings=None, drop_comments=True): # Use given settings, or use same settings as original file if not given, or use defaults if not imported from a # file if settings is None: @@ -245,8 +248,8 @@ class GerberFile(CamFile): def offset(self, dx=0, dy=0, unit=MM): # TODO round offset to file resolution - - self.objects = [ obj.with_offset(dx, dy, unit) for obj in self.objects ] + for obj in self.objects: + obj.with_offset(dx, dy, unit) def rotate(self, angle:'radian', center=(0,0), unit=MM): """ Rotate file contents around given point. |