- fixed a bug in Tool PunchGerber when using an Excellon to punch holes in the Gerber apertures
This commit is contained in:
@@ -22,6 +22,7 @@ CHANGELOG for FlatCAM beta
|
|||||||
- added some new strings for translation and updated the translation strings
|
- 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 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
|
- 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
|
21.10.2020
|
||||||
|
|
||||||
|
|||||||
@@ -233,21 +233,24 @@ class ToolPunchGerber(AppTool):
|
|||||||
for elem in val['geometry']:
|
for elem in val['geometry']:
|
||||||
# make it work only for Gerber Flashes who are Points in 'follow'
|
# make it work only for Gerber Flashes who are Points in 'follow'
|
||||||
if 'solid' in elem and isinstance(elem['follow'], Point):
|
if 'solid' in elem and isinstance(elem['follow'], Point):
|
||||||
for drill in exc_obj.drills:
|
for tool in exc_obj.tools:
|
||||||
clear_apid_size = exc_obj.tools[drill['tool']]['tooldia']
|
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 'drills' in exc_obj.tools[tool]['drills']:
|
||||||
if drill['point'].within(elem['solid']):
|
for drill_pt in exc_obj.tools[tool]['drills']:
|
||||||
geo_elem = {}
|
# since there may be drills that do not drill into a pad we test only for
|
||||||
geo_elem['clear'] = drill['point']
|
# 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:
|
if clear_apid_size not in holes_apertures:
|
||||||
holes_apertures[clear_apid_size] = {}
|
holes_apertures[clear_apid_size] = {}
|
||||||
holes_apertures[clear_apid_size]['type'] = 'C'
|
holes_apertures[clear_apid_size]['type'] = 'C'
|
||||||
holes_apertures[clear_apid_size]['size'] = clear_apid_size
|
holes_apertures[clear_apid_size]['size'] = clear_apid_size
|
||||||
holes_apertures[clear_apid_size]['geometry'] = []
|
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
|
# 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
|
# size and add there the clear geometry
|
||||||
|
|||||||
Reference in New Issue
Block a user