Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Pierre Fernbach
curves
Commits
a6fa3e7f
Commit
a6fa3e7f
authored
May 04, 2020
by
Pierre Fernbach
Browse files
[Python] add API for piecewise.FromPointsFile
parent
b330e5a5
Pipeline
#9447
passed with stage
in 4 minutes and 32 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
python/curves/curves_python.cpp
python/curves/curves_python.cpp
+8
-0
No files found.
python/curves/curves_python.cpp
View file @
a6fa3e7f
...
...
@@ -263,6 +263,9 @@ static piecewise_t discretPointToPolynomialC2(const pointX_list_t& points, const
return
piecewise_t
::
convert_discrete_points_to_polynomial
<
polynomial_t
>
(
points_list
,
points_derivative_list
,
points_second_derivative_list
,
time_points_list
);
}
static
piecewise_t
load_piecewise_from_text_file
(
const
std
::
string
&
filename
,
const
real
dt
,
const
std
::
size_t
dim
){
return
piecewise_t
::
load_piecewise_from_text_file
<
polynomial_t
>
(
filename
,
dt
,
dim
);
}
void
addFinalPointC0
(
piecewise_t
&
self
,
const
pointX_t
&
end
,
const
real
time
)
{
...
...
@@ -748,6 +751,11 @@ BOOST_PYTHON_MODULE(curves) {
"given points derivative and second derivative values. The created piecewise is C2 continuous."
,
args
(
"points"
,
"points_derivative"
,
"points_second_derivative"
,
"time_points"
))
.
staticmethod
(
"FromPointsList"
)
.
def
(
"FromPointsFile"
,
&
load_piecewise_from_text_file
,
args
(
"filename"
,
"dt"
,
"dimension"
),
"Create a piecewise-polynomial connecting exactly all the points in the given text file."
"The file should contains one points per line, optionally with it's derivative and second derivatives."
"Each lines should thus contains dim, 2*dim or 3*dim values"
)
.
staticmethod
(
"FromPointsFile"
)
.
def
(
"append"
,
&
addFinalPointC0
,
"Append a new polynomial curve of degree 1 at the end of the piecewise curve, defined between self.max() "
"and time and connecting exactly self(self.max()) and end"
,
...
...
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