Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilhem Saurel
ndcurves
Commits
0b5cb22e
Commit
0b5cb22e
authored
Jan 09, 2020
by
stevet
Browse files
added boost shared ptr to binding type
parent
e5651543
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
python/curves_python.cpp
View file @
0b5cb22e
...
...
@@ -534,7 +534,7 @@ BOOST_PYTHON_MODULE(curves) {
;
/** END bezier3 curve**/
/** BEGIN bezier curve**/
class_
<
bezier_t
,
bases
<
curve_abc_t
>
>
(
"bezier"
,
init
<>
())
class_
<
bezier_t
,
bases
<
curve_abc_t
>
,
boost
::
shared_ptr
<
bezier_t
>
>
(
"bezier"
,
init
<>
())
.
def
(
"__init__"
,
make_constructor
(
&
wrapBezierConstructor
))
.
def
(
"__init__"
,
make_constructor
(
&
wrapBezierConstructorBounds
))
.
def
(
"__init__"
,
make_constructor
(
&
wrapBezierConstructorConstraints
))
...
...
@@ -582,7 +582,7 @@ BOOST_PYTHON_MODULE(curves) {
.
def
(
"isZero"
,
&
linear_variable_t
::
isZero
)
.
def
(
"norm"
,
&
linear_variable_t
::
norm
);
class_
<
bezier_linear_variable_t
>
(
"bezier_linear_variable"
,
no_init
)
class_
<
bezier_linear_variable_t
,
bases
<
curve_abc_t
>
,
boost
::
shared_ptr
<
bezier_linear_variable_t
>
>
(
"bezier_linear_variable"
,
no_init
)
.
def
(
"__init__"
,
make_constructor
(
&
wrapBezierLinearConstructor
))
.
def
(
"__init__"
,
make_constructor
(
&
wrapBezierLinearConstructorBounds
))
.
def
(
"min"
,
&
bezier_linear_variable_t
::
min
)
...
...
python/test/sandbox/test.ipynb
View file @
0b5cb22e
This diff is collapsed.
Click to expand it.
python/test/test.py
View file @
0b5cb22e
...
...
@@ -440,7 +440,8 @@ class TestCurves(unittest.TestCase):
a
=
bezier
(
waypoints
,
0.
,
1.
)
b
=
bezier
(
waypoints
,
1.
,
2.
)
pc
=
piecewise
(
a
)
pc
.
append
(
b
)
pc
.
append
(
b
)
a
.
split
(
array
([
0.4
,
0.8
])).
curve_at_index
(
0
)
pc
.
min
()
pc
.
max
()
pc
(
0.4
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment