diff options
author | jaseg <git@jaseg.de> | 2021-12-30 00:20:31 +0100 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2021-12-30 00:20:31 +0100 |
commit | 5359e9cb37fa7037ae926751ac7924295f327b43 (patch) | |
tree | 77d054a5c648aa473ed2d658972c55ee516da0a2 /gerbonara/gerber/rs274x.py | |
parent | a0e8aa16e1a34a8309f9fefed90fd5ddf6b33709 (diff) | |
download | gerbonara-5359e9cb37fa7037ae926751ac7924295f327b43.tar.gz gerbonara-5359e9cb37fa7037ae926751ac7924295f327b43.tar.bz2 gerbonara-5359e9cb37fa7037ae926751ac7924295f327b43.zip |
Even less failures
Diffstat (limited to 'gerbonara/gerber/rs274x.py')
-rw-r--r-- | gerbonara/gerber/rs274x.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gerbonara/gerber/rs274x.py b/gerbonara/gerber/rs274x.py index 8715497..ad5e494 100644 --- a/gerbonara/gerber/rs274x.py +++ b/gerbonara/gerber/rs274x.py @@ -317,9 +317,12 @@ class GraphicsState: if i is not None or j is not None: raise SyntaxError("i/j coordinates given for linear D01 operation (which doesn't take i/j)") + #print('interpolate line') return self._create_line(old_point, self.map_coord(*self.point), aperture) else: + #print('interpolate arc') + if i is None and j is None: warnings.warn('Linear segment implied during arc interpolation mode through D01 w/o I, J values', SyntaxWarning) return self._create_line(old_point, self.map_coord(*self.point), aperture) @@ -363,7 +366,9 @@ class GraphicsState: yield ApertureStmt(self.aperture_map[id(aperture)]) def set_current_point(self, point): + print(f'current point {self.point}') if self.point != point: + print(f'current point update {point}') self.point = point yield MoveStmt(*point) @@ -469,7 +474,7 @@ class GerberParser: for name, le_regex in self.STATEMENT_REGEXES.items(): if (match := le_regex.match(line)): - print(f'match {name}') + #print(f'match {name}') getattr(self, f'_parse_{name}')(match.groupdict()) line = line[match.end(0):] break @@ -524,10 +529,10 @@ class GerberParser: raise SyntaxError('Circular arc interpolation in multi-quadrant mode (G74) is not implemented.') if self.current_region is None: - print('D01 outside region') + #print('D01 outside region') self.target.objects.append(self.graphics_state.interpolate(x, y, i, j)) else: - print(f'D01 inside region {id(self.current_region)} of length {len(self.current_region)}') + #print(f'D01 inside region {id(self.current_region)} of length {len(self.current_region)}') self.current_region.append(self.graphics_state.interpolate(x, y, i, j)) else: @@ -674,14 +679,14 @@ class GerberParser: def _parse_region_start(self, _match): self.current_region = go.Region(polarity_dark=self.graphics_state.polarity_dark) - print(f'Region start of {id(self.current_region)}') + #print(f'Region start of {id(self.current_region)}') def _parse_region_end(self, _match): if self.current_region is None: raise SyntaxError('Region end command (G37) outside of region') if self.current_region: # ignore empty regions - print(f'Region end of {id(self.current_region)}') + #print(f'Region end of {id(self.current_region)}') self.target.objects.append(self.current_region) self.current_region = None |