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