Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pierre Fernbach
hpp-spline
Commits
b357d665
Unverified
Commit
b357d665
authored
Nov 16, 2018
by
stonneau
Committed by
GitHub
Nov 16, 2018
Browse files
Merge pull request #7 from stonneau/bug_fix_extract
tentative bug fix for extract
parents
55466e8d
4cdcfb59
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/spline/bezier_curve.h
View file @
b357d665
...
...
@@ -304,6 +304,8 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point>
* @return
*/
std
::
pair
<
bezier_curve_t
,
bezier_curve_t
>
split
(
const
Numeric
T
){
if
(
T
==
T_
)
throw
std
::
runtime_error
(
"can't split curve, interval range is equal to original curve"
);
t_point_t
wps_first
(
size_
),
wps_second
(
size_
);
const
double
t
=
T
/
T_
;
wps_first
[
0
]
=
pts_
.
front
();
...
...
@@ -325,6 +327,8 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point>
bezier_curve_t
extract
(
const
Numeric
t1
,
const
Numeric
t2
){
if
(
t1
<
0.
||
t1
>
T_
||
t2
<
0.
||
t2
>
T_
)
throw
std
::
out_of_range
(
"In Extract curve : times out of bounds"
);
if
(
t1
==
0.
&&
t2
==
T_
)
return
bezier_curve_t
(
waypoints
().
begin
(),
waypoints
().
end
(),
T_
,
mult_T_
);
if
(
t1
==
0.
)
return
split
(
t2
).
first
;
if
(
t2
==
T_
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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