- moved the polarity change processing from FlatCAMGrbEditor() class to camlib.Gerber().parse_lines()
This commit is contained in:
@@ -22,6 +22,7 @@ CAD program, and create G-Code for Isolation routing.
|
|||||||
- Gerber Editor: fixed error when adding an aperture with code value lower than the ones that already exists
|
- Gerber Editor: fixed error when adding an aperture with code value lower than the ones that already exists
|
||||||
- when adding an aperture with code '0' (zero) it will automatically be set with size zero and type: 'REG' (from region); here we store all the regions from a Gerber file, the ones without a declared aperture
|
- when adding an aperture with code '0' (zero) it will automatically be set with size zero and type: 'REG' (from region); here we store all the regions from a Gerber file, the ones without a declared aperture
|
||||||
- Gerber Editor: added support for Gerber polarity change commands (LPD, LPC)
|
- Gerber Editor: added support for Gerber polarity change commands (LPD, LPC)
|
||||||
|
- moved the polarity change processing from FlatCAMGrbEditor() class to camlib.Gerber().parse_lines()
|
||||||
|
|
||||||
11.04.2019
|
11.04.2019
|
||||||
|
|
||||||
|
|||||||
16
camlib.py
16
camlib.py
@@ -3178,8 +3178,22 @@ class Gerber (Geometry):
|
|||||||
self.apertures[last_path_aperture]['solid_geometry'] = []
|
self.apertures[last_path_aperture]['solid_geometry'] = []
|
||||||
self.apertures[last_path_aperture]['solid_geometry'].append(geo)
|
self.apertures[last_path_aperture]['solid_geometry'].append(geo)
|
||||||
|
|
||||||
# --- Apply buffer ---
|
# first check if we have any clear_geometry (LPC) and if yes then we need to substract it
|
||||||
|
# from the apertures solid_geometry
|
||||||
|
temp_geo = []
|
||||||
|
for apid in self.apertures:
|
||||||
|
if 'clear_geometry' in self.apertures[apid]:
|
||||||
|
for clear_geo in self.apertures[apid]['clear_geometry']:
|
||||||
|
for solid_geo in self.apertures[apid]['solid_geometry']:
|
||||||
|
if solid_geo.intersects(clear_geo):
|
||||||
|
res_geo = clear_geo.symmetric_difference(solid_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)
|
||||||
|
|
||||||
|
# --- Apply buffer ---
|
||||||
# this treats the case when we are storing geometry as paths
|
# this treats the case when we are storing geometry as paths
|
||||||
self.follow_geometry = follow_buffer
|
self.follow_geometry = follow_buffer
|
||||||
|
|
||||||
|
|||||||
@@ -1896,18 +1896,6 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
|||||||
follow_storage_elem = []
|
follow_storage_elem = []
|
||||||
|
|
||||||
self.storage_dict[apid] = {}
|
self.storage_dict[apid] = {}
|
||||||
# first check if we have any clear_geometry (LPC) and if yes then we need to substract it
|
|
||||||
# from the solid_geometry
|
|
||||||
temp_geo = []
|
|
||||||
if 'clear_geometry' in self.gerber_obj.apertures[apid]:
|
|
||||||
for clear_geo in self.gerber_obj.apertures[apid]['clear_geometry']:
|
|
||||||
for solid_geo in self.gerber_obj.apertures[apid]['solid_geometry']:
|
|
||||||
if solid_geo.intersects(clear_geo):
|
|
||||||
res_geo = clear_geo.symmetric_difference(solid_geo)
|
|
||||||
temp_geo.append(res_geo)
|
|
||||||
else:
|
|
||||||
temp_geo.append(solid_geo)
|
|
||||||
self.gerber_obj.apertures[apid]['solid_geometry'] = deepcopy(temp_geo)
|
|
||||||
|
|
||||||
# add the Gerber geometry to editor storage
|
# add the Gerber geometry to editor storage
|
||||||
for k, v in self.gerber_obj.apertures[apid].items():
|
for k, v in self.gerber_obj.apertures[apid].items():
|
||||||
|
|||||||
Reference in New Issue
Block a user