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
Christian Butz
VTK
Commits
bca7c7d2
Commit
bca7c7d2
authored
Nov 30, 2011
by
David Gobbi
Committed by
Kitware Robot
Nov 30, 2011
Browse files
Merge topic 'kochanek-closed-spline-coeffs'
ab2155b9
BUG: Fix closed vtkKochanekSpline derivatives at first/last point.
parents
4a00b230
ab2155b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Filtering/vtkKochanekSpline.cxx
View file @
bca7c7d2
...
...
@@ -217,20 +217,6 @@ void vtkKochanekSpline::Fit1D (int size, double *x, double *y,
int
N
;
/* top point number */
int
i
;
if
(
size
==
2
)
{
// two points, set coefficients for a straight line
coefficients
[
0
][
3
]
=
0.0
;
coefficients
[
1
][
3
]
=
0.0
;
coefficients
[
0
][
2
]
=
0.0
;
coefficients
[
1
][
2
]
=
0.0
;
coefficients
[
0
][
1
]
=
(
y
[
1
]
-
y
[
0
])
/
(
x
[
1
]
-
x
[
0
]);
coefficients
[
1
][
1
]
=
coefficients
[
0
][
1
];
coefficients
[
0
][
0
]
=
y
[
0
];
coefficients
[
1
][
0
]
=
y
[
1
];
return
;
}
N
=
size
-
1
;
for
(
i
=
1
;
i
<
N
;
i
++
)
...
...
@@ -259,6 +245,9 @@ void vtkKochanekSpline::Fit1D (int size, double *x, double *y,
// Calculate the deriviatives at the end points
coefficients
[
0
][
0
]
=
y
[
0
];
coefficients
[
N
][
0
]
=
y
[
N
];
coefficients
[
N
][
1
]
=
0.0
;
coefficients
[
N
][
2
]
=
0.0
;
coefficients
[
N
][
3
]
=
0.0
;
if
(
this
->
Closed
)
//the curve is continuous and closed at P0=Pn
{
...
...
@@ -274,8 +263,8 @@ void vtkKochanekSpline::Fit1D (int size, double *x, double *y,
// adjust deriviatives for non uniform spacing between nodes
n1
=
x
[
1
]
-
x
[
0
];
n0
=
x
[
N
]
-
x
[
N
-
1
];
ds
*=
(
2
*
n
1
/
(
n0
+
n1
));
dd
*=
(
2
*
n
0
/
(
n0
+
n1
));
ds
*=
(
2
*
n
0
/
(
n0
+
n1
));
dd
*=
(
2
*
n
1
/
(
n0
+
n1
));
coefficients
[
0
][
1
]
=
dd
;
coefficients
[
0
][
2
]
=
ds
;
...
...
Write
Preview
Supports
Markdown
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