Открыть боковую панель
nikitronn
sverchok
Коммиты
e29d6787
Коммит
e29d6787
создал
Дек 12, 2021
по автору
luz paz
Просмотр файлов
Fix source typos
владелец
852b4d7e
Изменения
10
Скрыть пробелы
Построчно
Рядом
node_scripts/SNLite_templates/demo/voronoi_with_radius.py
Просмотр файла @
e29d6787
...
@@ -323,8 +323,8 @@ def get_voronoi_with_radius(verts_in,radius,resolution):
...
@@ -323,8 +323,8 @@ def get_voronoi_with_radius(verts_in,radius,resolution):
len_neibs
=
len
(
dict
[
'neibs'
])
len_neibs
=
len
(
dict
[
'neibs'
])
#We could start from chord which has the list height chord
#We could start from chord which has the list height chord
min_hight
=
min
(
dict
[
'height_chords'
])
min_h
e
ight
=
min
(
dict
[
'height_chords'
])
i_min_chord
=
dict
[
'height_chords'
].
index
(
min_hight
)
i_min_chord
=
dict
[
'height_chords'
].
index
(
min_h
e
ight
)
iterator
=
list
(
range
(
len_neibs
))[
i_min_chord
:]
+
list
(
range
(
len_neibs
))[:
i_min_chord
]
iterator
=
list
(
range
(
len_neibs
))[
i_min_chord
:]
+
list
(
range
(
len_neibs
))[:
i_min_chord
]
if
is_chords
:
if
is_chords
:
...
...
nodes/generators_extended/super_ellipsoid.py
Просмотр файла @
e29d6787
...
@@ -35,7 +35,7 @@ super_presets = {
...
@@ -35,7 +35,7 @@ super_presets = {
"SPHERE"
:
[
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
32
,
32
],
"SPHERE"
:
[
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
32
,
32
],
"CUBE"
:
[
1.0
,
1.0
,
1.0
,
0.0
,
0.0
,
3
,
5
],
"CUBE"
:
[
1.0
,
1.0
,
1.0
,
0.0
,
0.0
,
3
,
5
],
"CYLINDER"
:
[
1.0
,
1.0
,
1.0
,
1.0
,
0.0
,
4
,
32
],
"CYLINDER"
:
[
1.0
,
1.0
,
1.0
,
1.0
,
0.0
,
4
,
32
],
"OCT
O
HEDRON"
:
[
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
3
,
4
],
"OCT
A
HEDRON"
:
[
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
3
,
4
],
"SPINNING_TOP"
:
[
1.0
,
1.0
,
1.0
,
1.0
,
4.0
,
32
,
32
],
"SPINNING_TOP"
:
[
1.0
,
1.0
,
1.0
,
1.0
,
4.0
,
32
,
32
],
"CUBIC_CONE"
:
[
1.0
,
1.0
,
1.0
,
1.0
,
2.0
,
32
,
32
],
"CUBIC_CONE"
:
[
1.0
,
1.0
,
1.0
,
1.0
,
2.0
,
32
,
32
],
"CUBIC_BALL"
:
[
1.0
,
1.0
,
1.0
,
2.0
,
1.0
,
32
,
32
],
"CUBIC_BALL"
:
[
1.0
,
1.0
,
1.0
,
2.0
,
1.0
,
32
,
32
],
...
...
nodes/modifier_change/mesh_separate.py
Просмотр файла @
e29d6787
...
@@ -33,16 +33,16 @@ class SvSeparateMeshNode(bpy.types.Node, SverchCustomTreeNode):
...
@@ -33,16 +33,16 @@ class SvSeparateMeshNode(bpy.types.Node, SverchCustomTreeNode):
def
sv_init
(
self
,
context
):
def
sv_init
(
self
,
context
):
self
.
inputs
.
new
(
'SvVerticesSocket'
,
'Vertices'
)
self
.
inputs
.
new
(
'SvVerticesSocket'
,
'Vertices'
)
self
.
inputs
.
new
(
'SvStringsSocket'
,
'Poly E
g
de'
)
self
.
inputs
.
new
(
'SvStringsSocket'
,
'Poly Ed
g
e'
)
self
.
outputs
.
new
(
'SvVerticesSocket'
,
'Vertices'
)
self
.
outputs
.
new
(
'SvVerticesSocket'
,
'Vertices'
)
self
.
outputs
.
new
(
'SvStringsSocket'
,
'Poly E
g
de'
)
self
.
outputs
.
new
(
'SvStringsSocket'
,
'Poly Ed
g
e'
)
def
process
(
self
):
def
process
(
self
):
if
not
any
(
s
.
is_linked
for
s
in
self
.
outputs
):
if
not
any
(
s
.
is_linked
for
s
in
self
.
outputs
):
return
return
verts
=
self
.
inputs
[
'Vertices'
].
sv_get
(
deepcopy
=
False
)
verts
=
self
.
inputs
[
'Vertices'
].
sv_get
(
deepcopy
=
False
)
poly
=
self
.
inputs
[
'Poly E
g
de'
].
sv_get
(
deepcopy
=
False
)
poly
=
self
.
inputs
[
'Poly Ed
g
e'
].
sv_get
(
deepcopy
=
False
)
verts_out
=
[]
verts_out
=
[]
poly_edge_out
=
[]
poly_edge_out
=
[]
for
ve
,
pe
in
zip_long_repeat
(
verts
,
poly
):
for
ve
,
pe
in
zip_long_repeat
(
verts
,
poly
):
...
@@ -91,7 +91,7 @@ class SvSeparateMeshNode(bpy.types.Node, SverchCustomTreeNode):
...
@@ -91,7 +91,7 @@ class SvSeparateMeshNode(bpy.types.Node, SverchCustomTreeNode):
poly_edge_out
.
append
(
pe
)
poly_edge_out
.
append
(
pe
)
self
.
outputs
[
'Vertices'
].
sv_set
(
verts_out
)
self
.
outputs
[
'Vertices'
].
sv_set
(
verts_out
)
self
.
outputs
[
'Poly E
g
de'
].
sv_set
(
poly_edge_out
)
self
.
outputs
[
'Poly Ed
g
e'
].
sv_set
(
poly_edge_out
)
def
register
():
def
register
():
...
...
nodes/modifier_change/mesh_separate_mk2.py
Просмотр файла @
e29d6787
...
@@ -41,18 +41,18 @@ class SvSeparateMeshNodeMK2(bpy.types.Node, SverchCustomTreeNode):
...
@@ -41,18 +41,18 @@ class SvSeparateMeshNodeMK2(bpy.types.Node, SverchCustomTreeNode):
def
sv_init
(
self
,
context
):
def
sv_init
(
self
,
context
):
self
.
inputs
.
new
(
'SvVerticesSocket'
,
'Vertices'
)
self
.
inputs
.
new
(
'SvVerticesSocket'
,
'Vertices'
)
self
.
inputs
.
new
(
'SvStringsSocket'
,
'Poly E
g
de'
)
self
.
inputs
.
new
(
'SvStringsSocket'
,
'Poly Ed
g
e'
)
self
.
outputs
.
new
(
'SvVerticesSocket'
,
'Vertices'
)
self
.
outputs
.
new
(
'SvVerticesSocket'
,
'Vertices'
)
self
.
outputs
.
new
(
'SvStringsSocket'
,
'Poly E
g
de'
)
self
.
outputs
.
new
(
'SvStringsSocket'
,
'Poly Ed
g
e'
)
self
.
outputs
.
new
(
'SvStringsSocket'
,
'Vert idx'
)
self
.
outputs
.
new
(
'SvStringsSocket'
,
'Vert idx'
)
self
.
outputs
.
new
(
'SvStringsSocket'
,
'Poly E
g
de idx'
)
self
.
outputs
.
new
(
'SvStringsSocket'
,
'Poly Ed
g
e idx'
)
def
process
(
self
):
def
process
(
self
):
if
not
any
(
s
.
is_linked
for
s
in
self
.
outputs
):
if
not
any
(
s
.
is_linked
for
s
in
self
.
outputs
):
return
return
verts
=
self
.
inputs
[
'Vertices'
].
sv_get
(
deepcopy
=
False
)
verts
=
self
.
inputs
[
'Vertices'
].
sv_get
(
deepcopy
=
False
)
poly
=
self
.
inputs
[
'Poly E
g
de'
].
sv_get
(
deepcopy
=
False
)
poly
=
self
.
inputs
[
'Poly Ed
g
e'
].
sv_get
(
deepcopy
=
False
)
verts_out
=
[]
verts_out
=
[]
poly_edge_out
=
[]
poly_edge_out
=
[]
...
@@ -125,9 +125,9 @@ class SvSeparateMeshNodeMK2(bpy.types.Node, SverchCustomTreeNode):
...
@@ -125,9 +125,9 @@ class SvSeparateMeshNodeMK2(bpy.types.Node, SverchCustomTreeNode):
poly_edge_index
.
append
(
new_poly_indexes
)
poly_edge_index
.
append
(
new_poly_indexes
)
self
.
outputs
[
'Vertices'
].
sv_set
(
verts_out
)
self
.
outputs
[
'Vertices'
].
sv_set
(
verts_out
)
self
.
outputs
[
'Poly E
g
de'
].
sv_set
(
poly_edge_out
)
self
.
outputs
[
'Poly Ed
g
e'
].
sv_set
(
poly_edge_out
)
self
.
outputs
[
'Vert idx'
].
sv_set
(
vert_index
)
self
.
outputs
[
'Vert idx'
].
sv_set
(
vert_index
)
self
.
outputs
[
'Poly E
g
de idx'
].
sv_set
(
poly_edge_index
)
self
.
outputs
[
'Poly Ed
g
e idx'
].
sv_set
(
poly_edge_index
)
def
register
():
def
register
():
...
...
nodes/modifier_change/planar_edgenet_to_polygons.py
Просмотр файла @
e29d6787
...
@@ -97,7 +97,7 @@ def calc_angle(p1,p2):
...
@@ -97,7 +97,7 @@ def calc_angle(p1,p2):
def
cycles_list
(
value
,
list
):
def
cycles_list
(
value
,
list
):
#Cycle list as item is equal value gets first position
#Cycle list as item is equal value gets first position
cut_i
=
l
s
it
.
index
(
value
)
cut_i
=
li
s
t
.
index
(
value
)
return
list
[
cut_i
:]
+
list
[:
cut_i
]
return
list
[
cut_i
:]
+
list
[:
cut_i
]
def
get_next_neighbour
(
start
,
neibs
,
turn
=
'left'
):
def
get_next_neighbour
(
start
,
neibs
,
turn
=
'left'
):
...
...
nodes/modifier_change/subdivide_to_quads.py
Просмотр файла @
e29d6787
...
@@ -114,11 +114,11 @@ class SvSubdivideToQuadsNode(bpy.types.Node, SverchCustomTreeNode, SvRecursiveNo
...
@@ -114,11 +114,11 @@ class SvSubdivideToQuadsNode(bpy.types.Node, SverchCustomTreeNode, SvRecursiveNo
def
process_data
(
self
,
params
):
def
process_data
(
self
,
params
):
result
=
[[]
for
s
in
self
.
outputs
]
result
=
[[]
for
s
in
self
.
outputs
]
output_edges
=
self
.
outputs
[
'Edges'
].
is_linked
output_edges
=
self
.
outputs
[
'Edges'
].
is_linked
ouput_vert_map
=
self
.
outputs
[
'Vert Map'
].
is_linked
ou
t
put_vert_map
=
self
.
outputs
[
'Vert Map'
].
is_linked
for
sub_params
in
zip
(
*
params
):
for
sub_params
in
zip
(
*
params
):
output
=
subdiv_mesh_to_quads_np
(
*
sub_params
,
output
=
subdiv_mesh_to_quads_np
(
*
sub_params
,
output_edges
=
output_edges
,
output_edges
=
output_edges
,
output_vert_map
=
ouput_vert_map
)
output_vert_map
=
ou
t
put_vert_map
)
if
isinstance
(
sub_params
[
8
],
SvDict
):
if
isinstance
(
sub_params
[
8
],
SvDict
):
vert_data
=
SvDict
(
check_numpy
(
output
[
4
],
sub_params
[
8
]))
vert_data
=
SvDict
(
check_numpy
(
output
[
4
],
sub_params
[
8
]))
...
...
nodes/modifier_change/vertices_mask.py
Просмотр файла @
e29d6787
...
@@ -34,17 +34,17 @@ class SvVertMaskNode(bpy.types.Node, SverchCustomTreeNode):
...
@@ -34,17 +34,17 @@ class SvVertMaskNode(bpy.types.Node, SverchCustomTreeNode):
def
sv_init
(
self
,
context
):
def
sv_init
(
self
,
context
):
self
.
inputs
.
new
(
'SvStringsSocket'
,
'Mask'
)
self
.
inputs
.
new
(
'SvStringsSocket'
,
'Mask'
)
self
.
inputs
.
new
(
'SvVerticesSocket'
,
'Vertices'
)
self
.
inputs
.
new
(
'SvVerticesSocket'
,
'Vertices'
)
self
.
inputs
.
new
(
'SvStringsSocket'
,
'Poly E
g
de'
)
self
.
inputs
.
new
(
'SvStringsSocket'
,
'Poly Ed
g
e'
)
self
.
outputs
.
new
(
'SvVerticesSocket'
,
'Vertices'
)
self
.
outputs
.
new
(
'SvVerticesSocket'
,
'Vertices'
)
self
.
outputs
.
new
(
'SvStringsSocket'
,
'Poly E
g
de'
)
self
.
outputs
.
new
(
'SvStringsSocket'
,
'Poly Ed
g
e'
)
def
process
(
self
):
def
process
(
self
):
if
not
any
(
s
.
is_linked
for
s
in
self
.
outputs
):
if
not
any
(
s
.
is_linked
for
s
in
self
.
outputs
):
return
return
if
self
.
inputs
[
'Vertices'
].
is_linked
and
self
.
inputs
[
'Poly E
g
de'
].
is_linked
:
if
self
.
inputs
[
'Vertices'
].
is_linked
and
self
.
inputs
[
'Poly Ed
g
e'
].
is_linked
:
verts
=
self
.
inputs
[
'Vertices'
].
sv_get
(
deepcopy
=
False
)
verts
=
self
.
inputs
[
'Vertices'
].
sv_get
(
deepcopy
=
False
)
poly
=
self
.
inputs
[
'Poly E
g
de'
].
sv_get
(
deepcopy
=
False
)
poly
=
self
.
inputs
[
'Poly Ed
g
e'
].
sv_get
(
deepcopy
=
False
)
verts
=
dataCorrect
(
verts
)
verts
=
dataCorrect
(
verts
)
poly
=
dataCorrect
(
poly
)
poly
=
dataCorrect
(
poly
)
self
.
inputs
[
'Mask'
].
sv_get
(
default
=
[[
1
,
0
]])
self
.
inputs
[
'Mask'
].
sv_get
(
default
=
[[
1
,
0
]])
...
@@ -75,7 +75,7 @@ class SvVertMaskNode(bpy.types.Node, SverchCustomTreeNode):
...
@@ -75,7 +75,7 @@ class SvVertMaskNode(bpy.types.Node, SverchCustomTreeNode):
poly_edge_out
.
append
(
pe
)
poly_edge_out
.
append
(
pe
)
self
.
outputs
[
'Vertices'
].
sv_set
(
verts_out
)
self
.
outputs
[
'Vertices'
].
sv_set
(
verts_out
)
self
.
outputs
[
'Poly E
g
de'
].
sv_set
(
poly_edge_out
)
self
.
outputs
[
'Poly Ed
g
e'
].
sv_set
(
poly_edge_out
)
def
register
():
def
register
():
...
...
nodes/modifier_make/framework.py
Просмотр файла @
e29d6787
...
@@ -137,7 +137,7 @@ class SvFrameworkNode(bpy.types.Node, SverchCustomTreeNode):
...
@@ -137,7 +137,7 @@ class SvFrameworkNode(bpy.types.Node, SverchCustomTreeNode):
min
=
0
,
default
=
1.0
,
min
=
0
,
default
=
1.0
,
update
=
updateNode
)
update
=
updateNode
)
n_connections
:
IntProperty
(
name
=
"Conections"
,
n_connections
:
IntProperty
(
name
=
"Con
n
ections"
,
description
=
"How many vertices to connect to each vertex"
,
description
=
"How many vertices to connect to each vertex"
,
min
=
0
,
default
=
1
,
min
=
0
,
default
=
1
,
update
=
updateNode
)
update
=
updateNode
)
...
...
nodes/number/mix_inputs.py
Просмотр файла @
e29d6787
...
@@ -326,7 +326,7 @@ class SvMixInputsNode(bpy.types.Node, SverchCustomTreeNode):
...
@@ -326,7 +326,7 @@ class SvMixInputsNode(bpy.types.Node, SverchCustomTreeNode):
[
a
,
b
]
=
input_getter
(
self
.
inputs
[
i
],
self
.
inputs
[
j
])
[
a
,
b
]
=
input_getter
(
self
.
inputs
[
i
],
self
.
inputs
[
j
])
return
[
f
,
a
,
b
]
return
[
f
,
a
,
b
]
def
set_ouputs
(
self
,
values
):
def
set_ou
t
puts
(
self
,
values
):
output_setter
=
input_info
[
self
.
mode
][
"Outputs"
]
output_setter
=
input_info
[
self
.
mode
][
"Outputs"
]
output_setter
(
self
.
outputs
[
0
],
values
)
output_setter
(
self
.
outputs
[
0
],
values
)
...
@@ -364,7 +364,7 @@ class SvMixInputsNode(bpy.types.Node, SverchCustomTreeNode):
...
@@ -364,7 +364,7 @@ class SvMixInputsNode(bpy.types.Node, SverchCustomTreeNode):
v
=
mix
(
t
,
v1
,
v2
)
v
=
mix
(
t
,
v1
,
v2
)
values
.
append
(
v
)
values
.
append
(
v
)
self
.
set_ouputs
(
values
)
self
.
set_ou
t
puts
(
values
)
def
register
():
def
register
():
...
...
nodes/transforms/barycentric_transform.py
Просмотр файла @
e29d6787
...
@@ -69,7 +69,7 @@ def prepare_dest_data(tri_dest):
...
@@ -69,7 +69,7 @@ def prepare_dest_data(tri_dest):
def
compute_barycentric_transform_np
(
params
,
matched_index
,
result
,
out_numpy
,
edg_pol_data
):
def
compute_barycentric_transform_np
(
params
,
matched_index
,
result
,
out_numpy
,
edg_pol_data
):
'''NumPy Implementation of a barycentric transform'''
'''NumPy Implementation of a barycentric transform'''
verts
,
e
g
de_pol
,
tri_src
,
tri_dest
=
params
verts
,
ed
g
e_pol
,
tri_src
,
tri_dest
=
params
np_verts
=
[
array
(
v
)
for
v
in
verts
]
np_verts
=
[
array
(
v
)
for
v
in
verts
]
inverted_matrix_s
,
tri3_src
=
prepare_source_data
(
tri_src
)
inverted_matrix_s
,
tri3_src
=
prepare_source_data
(
tri_src
)
matrix_transform_d
,
tri3_dest
=
prepare_dest_data
(
tri_dest
)
matrix_transform_d
,
tri3_dest
=
prepare_dest_data
(
tri_dest
)
...
@@ -82,7 +82,7 @@ def compute_barycentric_transform_np(params, matched_index, result, out_numpy, e
...
@@ -82,7 +82,7 @@ def compute_barycentric_transform_np(params, matched_index, result, out_numpy, e
result
[
0
].
append
(
cartesian_co
if
out_numpy
else
cartesian_co
.
tolist
())
result
[
0
].
append
(
cartesian_co
if
out_numpy
else
cartesian_co
.
tolist
())
if
edg_pol_data
:
if
edg_pol_data
:
result
[
1
].
append
(
e
g
de_pol
[
edge_id
])
result
[
1
].
append
(
ed
g
e_pol
[
edge_id
])
def
compute_barycentric_transform_mu
(
params
,
result
):
def
compute_barycentric_transform_mu
(
params
,
result
):
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать