- fixed a bug in Tool PunchGerber when using an Excellon to punch holes in the Gerber apertures

This commit is contained in:
Marius Stanciu 2020-10-23 00:39:04 +03:00 committed by Marius
parent e09ec574aa
commit baa67b1278
2 changed files with 16 additions and 12 deletions

View File

@ -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

View File

@ -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