- Gerber parser - when simplification is used, the tolerance value will be adjusted by dividing it with 25.4 if the file units are imperial

This commit is contained in:
Marius Stanciu
2020-12-17 04:06:55 +02:00
committed by Marius
parent 66bb202a17
commit 3a95e53d59
2 changed files with 13 additions and 0 deletions

View File

@@ -540,6 +540,8 @@ class Gerber(Geometry):
self.app.log.debug("Gerber units found = %s" % self.units)
# Changed for issue #80
# self.convert_units(match.group(1))
s_tol = float(self.app.defaults["gerber_simp_tolerance"]) / 25.4 if self.units == 'IN' else s_tol
self.conversion_done = True
continue
@@ -560,6 +562,8 @@ class Gerber(Geometry):
self.app.log.debug("Gerber format found. Coordinates type = %s (Absolute or Relative)" % absolute)
self.units = match.group(5)
s_tol = float(self.app.defaults["gerber_simp_tolerance"]) / 25.4 if self.units == 'IN' else s_tol
self.app.log.debug("Gerber units found = %s" % self.units)
# Changed for issue #80
# self.convert_units(match.group(5))
@@ -590,6 +594,9 @@ class Gerber(Geometry):
"Gerber format found. Coordinates type = %s (Absolute or Relative)" % absolute)
self.units = match.group(1)
s_tol = float(
self.app.defaults["gerber_simp_tolerance"]) / 25.4 if self.units == 'IN' else s_tol
self.app.log.debug("Gerber units found = %s" % self.units)
# Changed for issue #80
# self.convert_units(match.group(5))
@@ -603,6 +610,8 @@ class Gerber(Geometry):
if match:
obs_gerber_units = {'0': 'IN', '1': 'MM'}[match.group(1)]
self.units = obs_gerber_units
s_tol = float(self.app.defaults["gerber_simp_tolerance"]) / 25.4 if self.units == 'IN' else s_tol
self.app.log.warning("Gerber obsolete units found = %s" % obs_gerber_units)
# Changed for issue #80
# self.convert_units({'0': 'IN', '1': 'MM'}[match.group(1)])