- fixed Panelize Tool to work with objects made by merging other objects together
This commit is contained in:
@@ -7,7 +7,11 @@ CHANGELOG for FlatCAM beta
|
|||||||
|
|
||||||
=================================================
|
=================================================
|
||||||
|
|
||||||
27.01.2021
|
28.02.2021
|
||||||
|
|
||||||
|
- fixed Panelize Tool to work with objects made by merging other objects together
|
||||||
|
|
||||||
|
27.02.2021
|
||||||
|
|
||||||
- added possibility of changing the Axis color and created a new parameter for that in Preferences
|
- added possibility of changing the Axis color and created a new parameter for that in Preferences
|
||||||
- some refactoring
|
- some refactoring
|
||||||
|
|||||||
@@ -415,52 +415,58 @@ class Panelize(AppTool):
|
|||||||
old_disp_number = 0
|
old_disp_number = 0
|
||||||
|
|
||||||
for tool in panel_source_obj.tools:
|
for tool in panel_source_obj.tools:
|
||||||
if panel_source_obj.tools[tool]['drills']:
|
if 'drills' in panel_source_obj.tools[tool]:
|
||||||
drill_nr = 0
|
if panel_source_obj.tools[tool]['drills']:
|
||||||
for drill in panel_source_obj.tools[tool]['drills']:
|
drill_nr = 0
|
||||||
# graceful abort requested by the user
|
for drill in panel_source_obj.tools[tool]['drills']:
|
||||||
if self.app.abort_flag:
|
# graceful abort requested by the user
|
||||||
raise grace
|
if self.app.abort_flag:
|
||||||
|
raise grace
|
||||||
|
|
||||||
# offset / panelization
|
# offset / panelization
|
||||||
point_offseted = affinity.translate(drill, currentx, currenty)
|
point_offseted = affinity.translate(drill, currentx, currenty)
|
||||||
obj_fin.tools[tool]['drills'].append(point_offseted)
|
obj_fin.tools[tool]['drills'].append(point_offseted)
|
||||||
|
|
||||||
# update progress
|
# update progress
|
||||||
drill_nr += 1
|
drill_nr += 1
|
||||||
disp_number = int(np.interp(drill_nr, [0, geo_len_drills], [0, 100]))
|
disp_number = int(np.interp(drill_nr, [0, geo_len_drills], [0, 100]))
|
||||||
if old_disp_number < disp_number <= 100:
|
if old_disp_number < disp_number <= 100:
|
||||||
self.app.proc_container.update_view_text(' %s: %d D:%d%%' %
|
self.app.proc_container.update_view_text(' %s: %d D:%d%%' %
|
||||||
(_("Copy"),
|
(_("Copy"),
|
||||||
int(element),
|
int(element),
|
||||||
disp_number))
|
disp_number))
|
||||||
old_disp_number = disp_number
|
old_disp_number = disp_number
|
||||||
|
else:
|
||||||
|
panel_source_obj.tools[tool]['drills'] = []
|
||||||
|
|
||||||
if panel_source_obj.tools[tool]['slots']:
|
if 'slots' in panel_source_obj.tools[tool]:
|
||||||
slot_nr = 0
|
if panel_source_obj.tools[tool]['slots']:
|
||||||
for slot in panel_source_obj.tools[tool]['slots']:
|
slot_nr = 0
|
||||||
# graceful abort requested by the user
|
for slot in panel_source_obj.tools[tool]['slots']:
|
||||||
if self.app.abort_flag:
|
# graceful abort requested by the user
|
||||||
raise grace
|
if self.app.abort_flag:
|
||||||
|
raise grace
|
||||||
|
|
||||||
# offset / panelization
|
# offset / panelization
|
||||||
start_offseted = affinity.translate(slot[0], currentx, currenty)
|
start_offseted = affinity.translate(slot[0], currentx, currenty)
|
||||||
stop_offseted = affinity.translate(slot[1], currentx, currenty)
|
stop_offseted = affinity.translate(slot[1], currentx, currenty)
|
||||||
offseted_slot = (
|
offseted_slot = (
|
||||||
start_offseted,
|
start_offseted,
|
||||||
stop_offseted
|
stop_offseted
|
||||||
)
|
)
|
||||||
obj_fin.tools[tool]['slots'].append(offseted_slot)
|
obj_fin.tools[tool]['slots'].append(offseted_slot)
|
||||||
|
|
||||||
# update progress
|
# update progress
|
||||||
slot_nr += 1
|
slot_nr += 1
|
||||||
disp_number = int(np.interp(slot_nr, [0, geo_len_slots], [0, 100]))
|
disp_number = int(np.interp(slot_nr, [0, geo_len_slots], [0, 100]))
|
||||||
if old_disp_number < disp_number <= 100:
|
if old_disp_number < disp_number <= 100:
|
||||||
self.app.proc_container.update_view_text(' %s: %d S:%d%%' %
|
self.app.proc_container.update_view_text(' %s: %d S:%d%%' %
|
||||||
(_("Copy"),
|
(_("Copy"),
|
||||||
int(element),
|
int(element),
|
||||||
disp_number))
|
disp_number))
|
||||||
old_disp_number = disp_number
|
old_disp_number = disp_number
|
||||||
|
else:
|
||||||
|
panel_source_obj.tools[tool]['slots'] = []
|
||||||
|
|
||||||
currentx += lenghtx
|
currentx += lenghtx
|
||||||
currenty += lenghty
|
currenty += lenghty
|
||||||
|
|||||||
Reference in New Issue
Block a user