fix multi buffer regression
This commit is contained in:
parent
d14266b10b
commit
5b07110895
1 changed files with 24 additions and 8 deletions
|
|
@ -487,23 +487,39 @@ class SLICENODE_BufferShellsMultiple(SliceNode):
|
||||||
else:
|
else:
|
||||||
prepared_paths = paths
|
prepared_paths = paths
|
||||||
|
|
||||||
all_res_paths = []
|
all_buffers: list[SlicePaths] = []
|
||||||
all_res_groups = []
|
|
||||||
|
|
||||||
for i in range(count):
|
for i in range(count):
|
||||||
dist = base_distance + (i * width_step)
|
dist = base_distance + (i * width_step)
|
||||||
res_paths, res_groups = slice.buffer_slice(prepared_paths, dist, miter=self.shape_option)
|
res_paths, res_groups = slice.buffer_slice(prepared_paths, dist, miter=self.shape_option)
|
||||||
all_res_paths.extend(res_paths)
|
all_buffers.append(SlicePaths(res_paths, res_groups))
|
||||||
all_res_groups.extend(res_groups)
|
|
||||||
|
# Zip Logic: Interleave paths by group (Z-layer)
|
||||||
|
all_groups = set()
|
||||||
|
grouped_inputs = []
|
||||||
|
for p_list in all_buffers:
|
||||||
|
d = {}
|
||||||
|
for i, g in enumerate(p_list.groups):
|
||||||
|
all_groups.add(g)
|
||||||
|
d.setdefault(g, []).append(p_list[i])
|
||||||
|
grouped_inputs.append(d)
|
||||||
|
|
||||||
|
sorted_groups = sorted(list(all_groups))
|
||||||
|
|
||||||
|
merged = SlicePaths()
|
||||||
|
for g in sorted_groups:
|
||||||
|
for d in grouped_inputs:
|
||||||
|
group_paths = d.get(g, [])
|
||||||
|
for p in group_paths:
|
||||||
|
merged.append_with_group(p, g)
|
||||||
|
|
||||||
if any(rotation):
|
if any(rotation):
|
||||||
mat_inv = Euler(rotation).to_matrix()
|
mat_inv = Euler(rotation).to_matrix()
|
||||||
mat_inv_np = np.array(mat_inv)
|
mat_inv_np = np.array(mat_inv)
|
||||||
final_paths = [s @ mat_inv_np.T for s in all_res_paths]
|
final_paths = [s @ mat_inv_np.T for s in merged]
|
||||||
else:
|
return SlicePaths(final_paths, merged.groups)
|
||||||
final_paths = all_res_paths
|
|
||||||
|
|
||||||
return SlicePaths(final_paths, all_res_groups)
|
return merged
|
||||||
|
|
||||||
@register_class
|
@register_class
|
||||||
class SLICENODE_Infill(SliceNode):
|
class SLICENODE_Infill(SliceNode):
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue