- fixed bug in camlib.parse_lines() in the clear_geometry processing section for self.apertures
This commit is contained in:
parent
e7a32c5c90
commit
d7031bc89a
|
@ -94,8 +94,8 @@ class App(QtCore.QObject):
|
||||||
log.addHandler(handler)
|
log.addHandler(handler)
|
||||||
|
|
||||||
# Version
|
# Version
|
||||||
version = 8.915
|
version = 8.916
|
||||||
version_date = "2019/05/1"
|
version_date = "2019/05/7"
|
||||||
beta = True
|
beta = True
|
||||||
|
|
||||||
# current date now
|
# current date now
|
||||||
|
@ -2169,6 +2169,9 @@ class App(QtCore.QObject):
|
||||||
# set call source to the Editor we go into
|
# set call source to the Editor we go into
|
||||||
self.call_source = 'exc_editor'
|
self.call_source = 'exc_editor'
|
||||||
|
|
||||||
|
if self.ui.splitter.sizes()[0] == 0:
|
||||||
|
self.ui.splitter.setSizes([1, 1])
|
||||||
|
|
||||||
elif isinstance(edited_object, FlatCAMGerber):
|
elif isinstance(edited_object, FlatCAMGerber):
|
||||||
# store the Gerber Editor Toolbar visibility before entering in the Editor
|
# store the Gerber Editor Toolbar visibility before entering in the Editor
|
||||||
self.grb_editor.toolbar_old_state = True if self.ui.grb_edit_toolbar.isVisible() else False
|
self.grb_editor.toolbar_old_state = True if self.ui.grb_edit_toolbar.isVisible() else False
|
||||||
|
@ -2177,6 +2180,9 @@ class App(QtCore.QObject):
|
||||||
# set call source to the Editor we go into
|
# set call source to the Editor we go into
|
||||||
self.call_source = 'grb_editor'
|
self.call_source = 'grb_editor'
|
||||||
|
|
||||||
|
if self.ui.splitter.sizes()[0] == 0:
|
||||||
|
self.ui.splitter.setSizes([1, 1])
|
||||||
|
|
||||||
# # make sure that we can't select another object while in Editor Mode:
|
# # make sure that we can't select another object while in Editor Mode:
|
||||||
# self.collection.view.setSelectionMode(QtWidgets.QAbstractItemView.NoSelection)
|
# self.collection.view.setSelectionMode(QtWidgets.QAbstractItemView.NoSelection)
|
||||||
self.ui.project_frame.setDisabled(True)
|
self.ui.project_frame.setDisabled(True)
|
||||||
|
|
|
@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing.
|
||||||
|
|
||||||
=================================================
|
=================================================
|
||||||
|
|
||||||
|
4.05.2019
|
||||||
|
|
||||||
|
- fixed bug in camlib.parse_lines() in the clear_geometry processing section for self.apertures
|
||||||
|
|
||||||
01.05.2019
|
01.05.2019
|
||||||
|
|
||||||
- the project items color is now controlled from Foreground Role in ObjectCollection.data()
|
- the project items color is now controlled from Foreground Role in ObjectCollection.data()
|
||||||
|
|
40
camlib.py
40
camlib.py
|
@ -3200,24 +3200,42 @@ class Gerber (Geometry):
|
||||||
|
|
||||||
conversion_factor = 25.4 if file_units == 'IN' else (1/25.4) if file_units != app_units else 1
|
conversion_factor = 25.4 if file_units == 'IN' else (1/25.4) if file_units != app_units else 1
|
||||||
|
|
||||||
# first check if we have any clear_geometry (LPC) and if yes then we need to substract it
|
# --- the following section is usefull for Gerber editor only --- #
|
||||||
# from the apertures solid_geometry
|
# list of clear geos that are to be applied to the entire file
|
||||||
temp_geo = []
|
global_clear_geo = []
|
||||||
|
|
||||||
for apid in self.apertures:
|
for apid in self.apertures:
|
||||||
|
# first check if we have any clear_geometry (LPC) and if yes added it to the global_clear_geo
|
||||||
if 'clear_geometry' in self.apertures[apid]:
|
if 'clear_geometry' in self.apertures[apid]:
|
||||||
clear_geo = MultiPolygon(self.apertures[apid]['clear_geometry'])
|
for pol in self.apertures[apid]['clear_geometry']:
|
||||||
for solid_geo in self.apertures[apid]['solid_geometry']:
|
global_clear_geo.append(pol)
|
||||||
if clear_geo.intersects(solid_geo):
|
|
||||||
res_geo = solid_geo.difference(clear_geo)
|
|
||||||
temp_geo.append(res_geo)
|
|
||||||
else:
|
|
||||||
temp_geo.append(solid_geo)
|
|
||||||
self.apertures[apid]['solid_geometry'] = deepcopy(temp_geo)
|
|
||||||
self.apertures[apid].pop('clear_geometry', None)
|
self.apertures[apid].pop('clear_geometry', None)
|
||||||
|
|
||||||
|
temp_geo = []
|
||||||
|
for apid in self.apertures:
|
||||||
|
if 'solid_geometry' in self.apertures[apid]:
|
||||||
|
for solid_geo in self.apertures[apid]['solid_geometry']:
|
||||||
|
for clear_geo in global_clear_geo:
|
||||||
|
# Make sure that the solid_geo is not completely within the clear_geo otherwise we loose
|
||||||
|
# the solid_geometry. We want for clear_geometry just to cut into solid_geometry not to
|
||||||
|
# delete it
|
||||||
|
if not solid_geo.within(clear_geo):
|
||||||
|
solid_geo = solid_geo.difference(clear_geo)
|
||||||
|
try:
|
||||||
|
for poly in solid_geo:
|
||||||
|
temp_geo.append(poly)
|
||||||
|
except TypeError:
|
||||||
|
temp_geo.append(solid_geo)
|
||||||
|
|
||||||
|
self.apertures[apid]['solid_geometry'] = deepcopy(temp_geo)
|
||||||
|
temp_geo[:] = []
|
||||||
|
|
||||||
|
for apid in self.apertures:
|
||||||
|
# scale de aperture geometries according to the used units
|
||||||
for k, v in self.apertures[apid].items():
|
for k, v in self.apertures[apid].items():
|
||||||
if k == 'size' or k == 'width' or k == 'height':
|
if k == 'size' or k == 'width' or k == 'height':
|
||||||
self.apertures[apid][k] = v * conversion_factor
|
self.apertures[apid][k] = v * conversion_factor
|
||||||
|
# -------------------------------------------------------------
|
||||||
|
|
||||||
# --- Apply buffer ---
|
# --- Apply buffer ---
|
||||||
# this treats the case when we are storing geometry as paths
|
# this treats the case when we are storing geometry as paths
|
||||||
|
|
|
@ -2947,6 +2947,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||||
if geo is not None:
|
if geo is not None:
|
||||||
self.add_gerber_shape(DrawToolShape(geo), follow_storage_elem)
|
self.add_gerber_shape(DrawToolShape(geo), follow_storage_elem)
|
||||||
self.storage_dict[apid][k] = follow_storage_elem
|
self.storage_dict[apid][k] = follow_storage_elem
|
||||||
|
elif k == 'clear_geometry':
|
||||||
|
continue
|
||||||
else:
|
else:
|
||||||
self.storage_dict[apid][k] = v
|
self.storage_dict[apid][k] = v
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
Loading…
Reference in New Issue