For example, I have 7 control point, then I use the bspline to generate the smooth line. However, I find the generated smooth points may not include the control point. The code is:
spParametricSpline = vtk.vtkParametricSpline()
xspline = vtk.vtkKochanekSpline()
yspline = vtk.vtkKochanekSpline()
zspline = vtk.vtkKochanekSpline()
spParametricSpline.SetXSpline(xspline)
spParametricSpline.SetYSpline(yspline)
spParametricSpline.SetZSpline(zspline)
# spParametricSpline.ParameterizeByLengthOn()
spParametricFunctionSource = vtk.vtkParametricFunctionSource()
spParametricFunctionSource.SetParametricFunction(spParametricSpline)
spParametricFunctionSource.SetScalarModeToNone()
spParametricFunctionSource.GenerateTextureCoordinatesOff()
spParametricFunctionSource.SetUResolution(500)
spSplineFilter = vtk.vtkSplineFilter()
spSplineFilter.SetSubdivideToLength()
spSplineFilter.SetInputConnection(spParametricFunctionSource.GetOutputPort())
spParametricSpline.SetNumberOfPoints(X.size)
for i in range(X.size):
spParametricSpline.SetPoint(i, X[i], Y[i], Z[i])
spParametricSpline.ClosedOff()
spSplineFilter.SetLength(spacing)
spSplineFilter.Update()
points = spSplineFilter.GetOutput()
Is there any method to make the bspline results include the control point?