summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2022-01-23 23:27:31 +0100
committerjaseg <git@jaseg.de>2022-01-23 23:27:31 +0100
commit269087bead401513cfadc0d912bfad2b6ec8b9c6 (patch)
tree702df8087730cba41a66e4104d4d18f5ac49ab5e
parentaebce43958b7a759d903f2f3b7844b4e137e18df (diff)
downloadgerbonara-269087bead401513cfadc0d912bfad2b6ec8b9c6.tar.gz
gerbonara-269087bead401513cfadc0d912bfad2b6ec8b9c6.tar.bz2
gerbonara-269087bead401513cfadc0d912bfad2b6ec8b9c6.zip
Fix last remaining test failures except for holes_dont_clear
-rw-r--r--gerbonara/gerber/rs274x.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/gerbonara/gerber/rs274x.py b/gerbonara/gerber/rs274x.py
index ed69643..f3ae62b 100644
--- a/gerbonara/gerber/rs274x.py
+++ b/gerbonara/gerber/rs274x.py
@@ -420,13 +420,11 @@ class GraphicsState:
arc = lambda cx, cy: go.Arc(*old_point, *new_point, cx, cy,
clockwise=clockwise, aperture=(self.aperture if aperture else None),
polarity_dark=self.polarity_dark, unit=self.file_settings.unit, attrs=attrs)
- print(f'arcs: {clockwise=}')
arcs = [ arc(cx, cy), arc(-cx, cy), arc(cx, -cy), arc(-cx, -cy) ]
arcs = sorted(arcs, key=lambda a: a.numeric_error())
for a in arcs:
d = gp.point_line_distance(old_point, new_point, (old_point[0]+a.cx, old_point[1]+a.cy))
- print(f'{a.numeric_error()=:<.5f} {d=:<.5f} {a}')
if (d > 0) == clockwise:
return a
assert False
@@ -614,8 +612,6 @@ class GerberParser:
warnings.warn('File is missing mandatory M02 EOF marker. File may be truncated.', SyntaxWarning)
def _parse_coord(self, match):
- if match.group(0) == 'Y3083D02':
- print(match)
if match['interpolation'] == 'G01':
self.graphics_state.interpolation_mode = InterpMode.LINEAR
elif match['interpolation'] == 'G02':
@@ -646,8 +642,10 @@ class GerberParser:
warnings.warn('Ambiguous coordinate statement. Coordinate statement does not have an operation '\
'mode and the last operation statement was not D01. This is garbage, and forbidden '\
'by spec. but since this looks like a Siemens/Mentor Graphics file, we will let it '\
- 'slide and treat this as a D01.', SyntaxWarning)
- op = 'D01'
+ 'slide and treat this as the same as the last operation.', SyntaxWarning)
+ # Yes, we repeat the last op, and don't do a D01. This is confirmed by
+ # resources/siemens/80101_0125_F200_L12_Bottom.gdo which contains an implicit-double-D02
+ op = self.last_operation
else:
raise SyntaxError('Ambiguous coordinate statement. Coordinate statement does not have an '\
'operation mode and the last operation statement was not D01. This is garbage, and '\