Skip to content

Commit

Permalink
fixes #3987 (#4004)
Browse files Browse the repository at this point in the history
There as a trouble of creating itertools iterators from other iterator items... change one of the to regular matching strategy
  • Loading branch information
vicdoval authored Mar 31, 2021
1 parent e816073 commit 7b21a72
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions nodes/generator/line_mk4.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from bpy.props import IntProperty, FloatProperty, BoolProperty, EnumProperty, FloatVectorProperty

from sverchok.node_tree import SverchCustomTreeNode
from sverchok.data_structure import updateNode, numpy_list_match_modes, iter_list_match_func
from sverchok.data_structure import updateNode, numpy_list_match_modes, iter_list_match_func, list_match_func


Directions = namedtuple('Directions', ['x', 'y', 'z', 'op', 'od'])
Expand Down Expand Up @@ -57,16 +57,18 @@ def make_line(numbers=None, steps=None, sizes=None, verts_or=None, verts_dir=Non
:return: np.array of vertices, np.array of edges
"""
line_number = max(len(numbers), len(sizes), len(steps), len(verts_or), len(verts_dir))
list_match_f = iter_list_match_func[list_match_mode]
list_match_f = list_match_func[list_match_mode]
params = list_match_f([numbers, steps, sizes, verts_or, verts_dir])

vert_number = sum([v_number if v_number > 1 else 2 for _, v_number in
zip(range(line_number), params[0])])

verts_lines = np.empty((vert_number, 3))
edges_lines = []
num_added_verts = 0
indexes = iter(range(int(1e+100)))

for i_line, n, st, size, vor, vdir in zip(range(line_number), *params):
for n, st, size, vor, vdir in zip(*params):
vor, vdir = get_corner_points(dir_mode, center, vor, vdir, get_len_line(size_mode, n, size, st))
line_verts = generate_verts(vor, vdir, n)
edges_lines.extend([(i, i + 1) for i, _ in zip(indexes, line_verts[:-1])])
Expand Down

0 comments on commit 7b21a72

Please sign in to comment.