Открыть боковую панель
nikitronn
sverchok
Коммиты
66d67b30
Коммит
66d67b30
создал
Окт 07, 2019
по автору
zeffii
Просмотр файлов
update cross section and bisect node
владелец
53f7d211
Изменения
2
Скрыть пробелы
Построчно
Рядом
nodes/modifier_make/bisect.py
Просмотр файла @
66d67b30
...
...
@@ -19,7 +19,7 @@
import
bpy
from
bpy.props
import
BoolProperty
import
bmesh
from
mathutils
import
Vector
from
mathutils
import
Vector
,
Matrix
from
sverchok.node_tree
import
SverchCustomTreeNode
from
sverchok.data_structure
import
updateNode
,
Matrix_generate
,
Vector_generate
...
...
@@ -123,7 +123,7 @@ class SvBisectNode(bpy.types.Node, SverchCustomTreeNode):
def
process
(
self
):
if
not
all
([
s
.
is_linked
for
s
in
self
.
inputs
]):
if
not
all
([
s
.
is_linked
for
s
in
self
.
inputs
[:
2
]
]):
return
if
not
self
.
outputs
[
'vertices'
].
is_linked
:
...
...
@@ -131,7 +131,7 @@ class SvBisectNode(bpy.types.Node, SverchCustomTreeNode):
verts_ob
=
Vector_generate
(
self
.
inputs
[
'vertices'
].
sv_get
())
edg_pols
=
self
.
inputs
[
'edg_pol'
].
sv_get
()
cut_mats
=
self
.
inputs
[
'cut_matrix'
].
sv_get
()
cut_mats
=
self
.
inputs
[
'cut_matrix'
].
sv_get
(
default
=
[
Matrix
()]
)
verts_out
=
[]
edges_out
=
[]
polys_out
=
[]
...
...
nodes/modifier_make/cross_section.py
Просмотр файла @
66d67b30
...
...
@@ -87,13 +87,13 @@ def section(cut_me_vertices, cut_me_edges, mx, pp, pno, FILL=False, TRI=True):
# first apply transformation matrix so we get the real section
vert1
=
ed
.
vertices
[
0
]
v1
=
new_me
.
vertices
[
vert1
].
co
*
mx
.
transposed
()
v1
=
new_me
.
vertices
[
vert1
].
co
@
mx
.
transposed
()
vert2
=
ed
.
vertices
[
1
]
v2
=
new_me
.
vertices
[
vert2
].
co
*
mx
.
transposed
()
v2
=
new_me
.
vertices
[
vert2
].
co
@
mx
.
transposed
()
vec
=
v2
-
v1
mul
=
vec
*
pno
mul
=
vec
@
pno
if
mul
==
0.0
:
if
not
point_on_plane
(
v1
,
ep
):
# parallel and not on plane
...
...
@@ -209,8 +209,8 @@ class CrossSectionNode(bpy.types.Node, SverchCustomTreeNode):
verts_out
=
[]
edges_out
=
[]
for
cut_mat
in
cut_mats
:
pp
=
Vector
((
0.0
,
0.0
,
0.0
))
*
cut_mat
.
transposed
()
pno
=
Vector
((
0.0
,
0.0
,
1.0
))
*
cut_mat
.
to_3x3
().
transposed
()
pp
=
Vector
((
0.0
,
0.0
,
0.0
))
@
cut_mat
.
transposed
()
pno
=
Vector
((
0.0
,
0.0
,
1.0
))
@
cut_mat
.
to_3x3
().
transposed
()
verts_pre_out
=
[]
edges_pre_out
=
[]
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать