Открыть боковую панель
nikitronn
sverchok
Коммиты
01c47d26
Коммит
01c47d26
создал
Май 13, 2022
по автору
Dealga McArdle
Просмотр файлов
alternative to newaxis
владелец
36fb17be
Изменения
1
Скрыть пробелы
Построчно
Рядом
utils/geom.py
Просмотр файла @
01c47d26
...
...
@@ -207,6 +207,7 @@ class CubicSpline(Spline):
super
().
__init__
()
if
is_cyclic
:
#print(describe_data_shape(vertices))
...
...
@@ -241,8 +242,11 @@ class CubicSpline(Spline):
"""
h
=
tknots
[
1
:]
-
tknots
[:
-
1
]
h
[
h
==
0
]
=
1e-8
# newaxis not supported..
nn
=
3
/
h
[
1
:,
np
.
newaxis
]
*
(
locs
[
2
:]
-
locs
[
1
:
-
1
])
-
3
/
h
[:
-
1
,
np
.
newaxis
]
*
(
locs
[
1
:
-
1
]
-
locs
[:
-
2
])
Dx
=
(
locs
[
2
:]
-
locs
[
1
:
-
1
])
Dy
=
(
locs
[
1
:
-
1
]
-
locs
[:
-
2
])
nn
=
(
3
/
h
[
1
:].
reshape
((
-
1
,
1
))
*
Dx
)
-
(
3
/
h
[:
-
1
].
reshape
((
-
1
,
1
))
*
Dy
)
q
=
np
.
vstack
((
np
.
array
([[
0.0
,
0.0
,
0.0
]]),
nn
))
l
=
np
.
zeros
((
n
,
3
))
...
...
@@ -275,8 +279,6 @@ class CubicSpline(Spline):
return
splines
if
numba
:
tknots
=
np
.
array
(
tknots
)
locs
=
np
.
array
(
locs
)
if
'perform_stage'
not
in
local_numba_storage
:
local_numba_storage
[
'perform_stage'
]
=
numba
.
njit
(
perform_stage
)
perform_stage
=
local_numba_storage
[
'perform_stage'
]
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать