From 3a95e53d59c8d57f473b4c81db7202f263dfc195 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Thu, 17 Dec 2020 04:06:55 +0200 Subject: [PATCH] - Gerber parser - when simplification is used, the tolerance value will be adjusted by dividing it with 25.4 if the file units are imperial --- CHANGELOG.md | 4 ++++ appParsers/ParseGerber.py | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a7729f4..d7467065 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ CHANGELOG for FlatCAM beta ================================================= +17.12.2020 + +- Gerber parser - when simplification is used, the tolerance value will be adjusted by dividing it with 25.4 if the file units are imperial + 15.12.2020 - modified the way that the PlotCanvas widget is added diff --git a/appParsers/ParseGerber.py b/appParsers/ParseGerber.py index 577d9c6f..3826adc1 100644 --- a/appParsers/ParseGerber.py +++ b/appParsers/ParseGerber.py @@ -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)])