- fixed the Gerber.merge() function. When some of the Gerber files have apertures with same id, create a new aperture id for the object that is fused because each aperture id may hold different geometries.

This commit is contained in:
Marius Stanciu 2019-03-22 20:28:43 +02:00
parent df98007a4a
commit 789dcc5da5
2 changed files with 11 additions and 4 deletions

View File

@ -423,10 +423,15 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
if ap not in grb_final.apertures:
grb_final.apertures[ap] = grb.apertures[ap]
else:
if 'solid_geometry' not in grb_final.apertures[ap]:
grb_final.apertures[ap]['solid_geometry'] = []
for geo in grb.apertures[ap]['solid_geometry']:
grb_final.apertures[ap]['solid_geometry'].append(geo)
# create a list of integers out of the grb.apertures keys and find the max of that value
# then, the aperture duplicate is assigned an id value incremented with 1,
# and finally made string because the apertures dict keys are strings
max_ap = str(max([int(k) for k in grb_final.apertures.keys()]) + 1)
grb_final.apertures[max_ap] = {}
grb_final.apertures[max_ap]['solid_geometry'] = []
for k, v in grb.apertures[ap].items():
grb_final.apertures[max_ap][k] = v
grb_final.solid_geometry = MultiPolygon(grb_final.solid_geometry)
grb_final.follow_geometry = MultiPolygon(grb_final.follow_geometry)

View File

@ -12,6 +12,8 @@ CAD program, and create G-Code for Isolation routing.
22.03.2019
- fixed an error that created a situation that when saving a project with some of the CNCJob objects disabled, on project reload the CNCJob objects are no longer loaded
- fixed the Gerber.merge() function. When some of the Gerber files have apertures with same id, create a new aperture id for the object that is fused because each aperture id may hold different geometries.
20.03.2019