- Isolation Plugin: code refactoring
This commit is contained in:
@@ -10,6 +10,7 @@ CHANGELOG for FlatCAM Evo beta
|
|||||||
6.07.2023
|
6.07.2023
|
||||||
|
|
||||||
- Isolation Plugin: reversed the milling direction between the conventional and climbing milling types
|
- Isolation Plugin: reversed the milling direction between the conventional and climbing milling types
|
||||||
|
- Isolation Plugin: code refactoring
|
||||||
|
|
||||||
5.07.2023
|
5.07.2023
|
||||||
|
|
||||||
|
|||||||
@@ -3142,11 +3142,16 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
|
|
||||||
work_geo = []
|
work_geo = []
|
||||||
|
|
||||||
|
geo_len = len(geometry)
|
||||||
for idx, geo in enumerate(geometry):
|
for idx, geo in enumerate(geometry):
|
||||||
good_pass_iso = []
|
good_pass_iso = []
|
||||||
start_idx = idx + 1
|
|
||||||
|
geo_idx_list = list(range(geo_len))
|
||||||
|
# we don't want to test intersection with itself
|
||||||
|
del geo_idx_list[idx]
|
||||||
|
|
||||||
for nr_pass in range(passes):
|
for nr_pass in range(passes):
|
||||||
|
|
||||||
iso_offset = tooldia * ((2 * nr_pass + 1) / 2.0) - (nr_pass * overlap * tooldia)
|
iso_offset = tooldia * ((2 * nr_pass + 1) / 2.0) - (nr_pass * overlap * tooldia)
|
||||||
if negative_dia:
|
if negative_dia:
|
||||||
iso_offset = -iso_offset
|
iso_offset = -iso_offset
|
||||||
@@ -3155,14 +3160,8 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
check_geo = geo.buffer(buf_chek)
|
check_geo = geo.buffer(buf_chek)
|
||||||
|
|
||||||
intersect_flag = False
|
intersect_flag = False
|
||||||
# find if current pass for current geo is valid (no intersection with other geos))
|
# find if current pass for current geo is valid (no intersection with other geos)
|
||||||
for geo_search_idx in range(idx):
|
for geo_search_idx in geo_idx_list:
|
||||||
if check_geo.intersects(geometry[geo_search_idx]):
|
|
||||||
intersect_flag = True
|
|
||||||
break
|
|
||||||
|
|
||||||
if intersect_flag is False:
|
|
||||||
for geo_search_idx in range(start_idx, len(geometry)):
|
|
||||||
if check_geo.intersects(geometry[geo_search_idx]):
|
if check_geo.intersects(geometry[geo_search_idx]):
|
||||||
intersect_flag = True
|
intersect_flag = True
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user