# How to make the point from bspline include the control point?

**URL:** https://discourse.vtk.org/t/how-to-make-the-point-from-bspline-include-the-control-point/4577
**Category:** Support
**Created:** [November 5, 2020, 2:32pm UTC](https://discourse.vtk.org/t/how-to-make-the-point-from-bspline-include-the-control-point/4577 "2020-11-05T14:32:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![zhang-qiang-github](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhang-qiang-github/32/2519_2.png) [@zhang-qiang-github](https://discourse.vtk.org/u/zhang-qiang-github)
#### Post date: [November 5, 2020, 2:32pm UTC](https://discourse.vtk.org/t/how-to-make-the-point-from-bspline-include-the-control-point/4577/1 "2020-11-05T14:32:34Z")

</div>

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:

```auto
    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?
