Открыть боковую панель
nikitronn
sverchok
Коммиты
aae102a1
Коммит
aae102a1
создал
Июл 03, 2021
по автору
Ilya Portnov
Просмотр файлов
Change according to
https://github.com/orbingol/NURBS-Python/issues/135
владелец
c7d91452
Изменения
2
Скрыть пробелы
Построчно
Рядом
tests/nurbs_tests.py
Просмотр файла @
aae102a1
...
@@ -494,9 +494,9 @@ class OtherNurbsTests(SverchokTestCase):
...
@@ -494,9 +494,9 @@ class OtherNurbsTests(SverchokTestCase):
self
.
assert_numpy_arrays_equal
(
removed
.
get_knotvector
(),
kv
)
self
.
assert_numpy_arrays_equal
(
removed
.
get_knotvector
(),
kv
)
#self.assert_numpy_arrays_equal(removed.evaluate_array(ts), orig_pts)
#self.assert_numpy_arrays_equal(removed.evaluate_array(ts), orig_pts)
print
(
"CP"
,
removed
.
get_control_points
())
#
print("CP", removed.get_control_points())
print
(
"W"
,
removed
.
get_weights
())
#
print("W", removed.get_weights())
#
self.assert_numpy_arrays_equal(removed.get_control_points(), points)
self
.
assert_numpy_arrays_equal
(
removed
.
get_control_points
(),
points
)
def
test_split_1
(
self
):
def
test_split_1
(
self
):
points
=
np
.
array
([[
0
,
0
,
0
],
[
1
,
0
,
0
]])
points
=
np
.
array
([[
0
,
0
,
0
],
[
1
,
0
,
0
]])
...
...
utils/curve/nurbs.py
Просмотр файла @
aae102a1
...
@@ -699,7 +699,9 @@ class SvGeomdlCurve(SvNurbsCurve):
...
@@ -699,7 +699,9 @@ class SvGeomdlCurve(SvNurbsCurve):
def
remove_knot
(
self
,
u
,
count
=
1
):
def
remove_knot
(
self
,
u
,
count
=
1
):
curve
=
self
.
copy
()
curve
=
self
.
copy
()
curve
=
operations
.
remove_knot
(
curve
.
curve
,
[
u
],
[
count
])
curve
=
operations
.
remove_knot
(
curve
.
curve
,
[
u
],
[
count
])
return
SvGeomdlCurve
(
curve
)
result
=
SvGeomdlCurve
(
curve
)
result
.
u_bounds
=
self
.
u_bounds
return
result
class
SvNativeNurbsCurve
(
SvNurbsCurve
):
class
SvNativeNurbsCurve
(
SvNurbsCurve
):
def
__init__
(
self
,
degree
,
knotvector
,
control_points
,
weights
=
None
,
normalize_knots
=
False
):
def
__init__
(
self
,
degree
,
knotvector
,
control_points
,
weights
=
None
,
normalize_knots
=
False
):
...
@@ -1001,7 +1003,7 @@ class SvNativeNurbsCurve(SvNurbsCurve):
...
@@ -1001,7 +1003,7 @@ class SvNativeNurbsCurve(SvNurbsCurve):
else
:
else
:
j
-=
1
j
-=
1
for
k
in
range
(
i
+
1
,
len
(
ctrlpts
)):
for
k
in
range
(
i
+
1
,
len
(
ctrlpts
)):
ctrlpts_new
[
j
]
=
ctrlpts
[
k
]
ctrlpts_new
[
j
]
=
ctrlpts
_new
[
k
]
j
+=
1
j
+=
1
# Slice to get the new control points
# Slice to get the new control points
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать