summaryrefslogtreecommitdiff
path: root/gerbonara/excellon.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2022-02-01 22:08:54 +0100
committerjaseg <git@jaseg.de>2022-02-01 22:08:54 +0100
commit7473e471dc69d09a35bb0762549cc4f3ab8b04b3 (patch)
treedcd162f56a5dbeac6ee669fc85d582813fd48eea /gerbonara/excellon.py
parentc3ca4f95bd59f69d45e582a4149327f57a360760 (diff)
downloadgerbonara-7473e471dc69d09a35bb0762549cc4f3ab8b04b3.tar.gz
gerbonara-7473e471dc69d09a35bb0762549cc4f3ab8b04b3.tar.bz2
gerbonara-7473e471dc69d09a35bb0762549cc4f3ab8b04b3.zip
Add some documentation
Diffstat (limited to 'gerbonara/excellon.py')
-rwxr-xr-xgerbonara/excellon.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/gerbonara/excellon.py b/gerbonara/excellon.py
index 3382ffe..96a78be 100755
--- a/gerbonara/excellon.py
+++ b/gerbonara/excellon.py
@@ -197,6 +197,9 @@ class ExcellonFile(CamFile):
else:
self.objects.append(obj_or_comment)
+ def to_excellon(self):
+ return self
+
def to_gerber(self):
apertures = {}
out = GerberFile()
@@ -292,7 +295,7 @@ class ExcellonFile(CamFile):
yield 'M30'
- def to_excellon(self, settings=None, drop_comments=True):
+ def generate_excellon(self, settings=None, drop_comments=True):
''' Export to Excellon format. This function always generates XNC, which is a well-defined subset of Excellon.
'''
if settings is None:
@@ -306,10 +309,11 @@ class ExcellonFile(CamFile):
def save(self, filename, settings=None, drop_comments=True):
with open(filename, 'w') as f:
- f.write(self.to_excellon(settings, drop_comments=drop_comments))
+ f.write(self.generate_excellon(settings, drop_comments=drop_comments))
def offset(self, x=0, y=0, unit=MM):
- self.objects = [ obj.with_offset(x, y, unit) for obj in self.objects ]
+ for obj in self.objects:
+ obj.offset(x, y, unit)
def rotate(self, angle, cx=0, cy=0, unit=MM):
if math.isclose(angle % (2*math.pi), 0):