diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b3f28ab..fead9a47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ CHANGELOG for FlatCAM beta - added some new strings for translation and updated the translation strings - in ToolsDB2UI class made the vertical layouts have a preferred minimum dimension as opposed to the previous fixed one - in Geometry Object made sure that the Tools Table second column is set to Resize to contents +- fixed a bug in Tool PunchGerber when using an Excellon to punch holes in the Gerber apertures 21.10.2020 diff --git a/appTools/ToolPunchGerber.py b/appTools/ToolPunchGerber.py index a7e2c9ec..a84a898f 100644 --- a/appTools/ToolPunchGerber.py +++ b/appTools/ToolPunchGerber.py @@ -233,21 +233,24 @@ class ToolPunchGerber(AppTool): for elem in val['geometry']: # make it work only for Gerber Flashes who are Points in 'follow' if 'solid' in elem and isinstance(elem['follow'], Point): - for drill in exc_obj.drills: - clear_apid_size = exc_obj.tools[drill['tool']]['tooldia'] + for tool in exc_obj.tools: + clear_apid_size = exc_obj.tools[tool]['tooldia'] - # since there may be drills that do not drill into a pad we test only for drills in a pad - if drill['point'].within(elem['solid']): - geo_elem = {} - geo_elem['clear'] = drill['point'] + if 'drills' in exc_obj.tools[tool]['drills']: + for drill_pt in exc_obj.tools[tool]['drills']: + # since there may be drills that do not drill into a pad we test only for + # drills in a pad + if drill_pt.within(elem['solid']): + geo_elem = {} + geo_elem['clear'] = drill_pt - if clear_apid_size not in holes_apertures: - holes_apertures[clear_apid_size] = {} - holes_apertures[clear_apid_size]['type'] = 'C' - holes_apertures[clear_apid_size]['size'] = clear_apid_size - holes_apertures[clear_apid_size]['geometry'] = [] + if clear_apid_size not in holes_apertures: + holes_apertures[clear_apid_size] = {} + holes_apertures[clear_apid_size]['type'] = 'C' + holes_apertures[clear_apid_size]['size'] = clear_apid_size + holes_apertures[clear_apid_size]['geometry'] = [] - holes_apertures[clear_apid_size]['geometry'].append(deepcopy(geo_elem)) + holes_apertures[clear_apid_size]['geometry'].append(deepcopy(geo_elem)) # add the clear geometry to new apertures; it's easier than to test if there are apertures with the same # size and add there the clear geometry