summaryrefslogtreecommitdiff
path: root/gerbonara/rs274x.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-02-25 17:31:16 +0100
committerjaseg <git@jaseg.de>2023-02-25 17:31:16 +0100
commit8b40d15dab376c92b37b0939515e7bdee7b83301 (patch)
tree1a9b1d513300cf17109d19d16e95fbb0e0a7e99f /gerbonara/rs274x.py
parentd43eff8b49022719b2933e8429a05e3a35b8762f (diff)
downloadgerbonara-8b40d15dab376c92b37b0939515e7bdee7b83301.tar.gz
gerbonara-8b40d15dab376c92b37b0939515e7bdee7b83301.tar.bz2
gerbonara-8b40d15dab376c92b37b0939515e7bdee7b83301.zip
Moar doc
Diffstat (limited to 'gerbonara/rs274x.py')
-rw-r--r--gerbonara/rs274x.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/gerbonara/rs274x.py b/gerbonara/rs274x.py
index 062f246..7bfd524 100644
--- a/gerbonara/rs274x.py
+++ b/gerbonara/rs274x.py
@@ -60,10 +60,14 @@ class GerberFile(CamFile):
self.file_attrs = file_attrs or {}
def to_excellon(self, plated=None):
+ """ Convert this excellon file into a :py:class:`~.excellon.ExcellonFile`. This will convert interpolated lines
+ into slots, and circular aperture flashes into holes. Other features such as ``G36`` polygons or flashes with
+ non-circular apertures will result in a :py:obj:`ValueError`. You can, of course, programmatically remove such
+ features from a :py:class:`GerberFile` before conversion. """
new_objs = []
new_tools = {}
for obj in self.objects:
- if (not isinstance(obj, go.Line) and isinstance(obj, go.Arc) and isinstance(obj, go.Flash)) or \
+ if not (isinstance(obj, go.Line) or isinstance(obj, go.Arc) or isinstance(obj, go.Flash)) or \
not isinstance(obj.aperture, apertures.CircleAperture):
raise ValueError(f'Cannot convert {obj} to excellon!')
@@ -75,6 +79,7 @@ class GerberFile(CamFile):
return ExcellonFile(objects=new_objs, comments=self.comments)
def to_gerber(self):
+ """ Counterpart to :py:meth:`~.excellon.ExcellonFile.to_gerber`. Does nothing and returns :py:obj:`self`. """
return
def merge(self, other, mode='above', keep_settings=False):