- fixed bug in Gerber editor FCDisk and FCSemiDisc that the resulting geometry was not stored into the '0' aperture where all the solids are stored

- fixed minor issue in Gerber Editor where apertures were included in the saved object even if there was no geometric data for that aperture
This commit is contained in:
Marius Stanciu 2019-05-22 23:02:23 +03:00
parent d7aeb7b37f
commit 8a273b3a6f
2 changed files with 32 additions and 4 deletions

View File

@ -9,12 +9,18 @@ CAD program, and create G-Code for Isolation routing.
=================================================
23.05.2019
- fixed bug in Gerber editor FCDisk and FCSemiDisc that the resulting geometry was not stored into the '0' aperture where all the solids are stored
- fixed minor issue in Gerber Editor where apertures were included in the saved object even if there was no geometric data for that aperture
22.05.2019
- Geo Editor - added a new editor tool, Eraser
- some PEP8 cleanup of the Geo Editor
- fixed some selection issues in the new tool Eraser in Geometry Editor
- updated the translation files
- RELEASE 8.917
21.05.2019

View File

@ -1349,7 +1349,14 @@ class FCDisc(FCShapeTool):
size_ap = float(self.draw_app.storage_dict[self.draw_app.last_aperture_selected]['size'])
self.buf_val = (size_ap / 2) if size_ap > 0 else 0.0000001
self.storage_obj = self.draw_app.storage_dict[self.draw_app.last_aperture_selected]['geometry']
if '0' in self.draw_app.storage_dict:
self.storage_obj = self.draw_app.storage_dict['0']['geometry']
else:
self.draw_app.storage_dict['0'] = dict()
self.draw_app.storage_dict['0']['type'] = 'C'
self.draw_app.storage_dict['0']['size'] = 0.0
self.draw_app.storage_dict['0']['geometry'] = list()
self.storage_obj = self.draw_app.storage_dict['0']['geometry']
self.draw_app.app.inform.emit(_("Click on Center point ..."))
@ -1436,7 +1443,14 @@ class FCSemiDisc(FCShapeTool):
size_ap = float(self.draw_app.storage_dict[self.draw_app.last_aperture_selected]['size'])
self.buf_val = (size_ap / 2) if size_ap > 0 else 0.0000001
self.storage_obj = self.draw_app.storage_dict[self.draw_app.last_aperture_selected]['geometry']
if '0' in self.draw_app.storage_dict:
self.storage_obj = self.draw_app.storage_dict['0']['geometry']
else:
self.draw_app.storage_dict['0'] = dict()
self.draw_app.storage_dict['0']['type'] = 'C'
self.draw_app.storage_dict['0']['size'] = 0.0
self.draw_app.storage_dict['0']['geometry'] = list()
self.storage_obj = self.draw_app.storage_dict['0']['geometry']
self.steps_per_circ = self.draw_app.app.defaults["gerber_circle_steps"]
@ -2050,7 +2064,9 @@ class FCEraser(FCShapeTool):
if 'solid' in geo_el.geo:
geometric_data = geo_el.geo['solid']
if eraser_sel_shapes.within(geometric_data) or eraser_sel_shapes.intersects(geometric_data):
geo_el.geo['solid'] = geometric_data.difference(eraser_sel_shapes)
geos = geometric_data.difference(eraser_sel_shapes)
geos = geos.buffer(0)
geo_el.geo['solid'] = deepcopy(geos)
except KeyError:
pass
@ -3621,7 +3637,13 @@ class FlatCAMGrbEditor(QtCore.QObject):
self.gerber_obj.options['name'].upper())
out_name = outname
local_storage_dict = deepcopy(self.storage_dict)
local_storage_dict = dict()
for aperture in self.storage_dict:
if 'geometry' in self.storage_dict[aperture]:
# add aperture only if it has geometry
if len(self.storage_dict[aperture]['geometry']) > 0:
local_storage_dict[aperture] = deepcopy(self.storage_dict[aperture])
# How the object should be initialized
def obj_init(grb_obj, app_obj):