# vtkSplineWidget is unable to set open loop such as ClosedOff() or SetClosed(true)

**URL:** https://discourse.vtk.org/t/vtksplinewidget-is-unable-to-set-open-loop-such-as-closedoff-or-setclosed-true/8123
**Category:** Web
**Created:** [March 23, 2022, 5:19pm UTC](https://discourse.vtk.org/t/vtksplinewidget-is-unable-to-set-open-loop-such-as-closedoff-or-setclosed-true/8123 "2022-03-23T17:19:25Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![gui](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@gui](https://discourse.vtk.org/u/gui)
#### Post date: [March 23, 2022, 5:19pm UTC](https://discourse.vtk.org/t/vtksplinewidget-is-unable-to-set-open-loop-such-as-closedoff-or-setclosed-true/8123/1 "2022-03-23T17:19:25Z")

</div>

Hi everyone. I use vtk.js version 23.0.0 (the latest) and vtkSplineWidget.js has no method such as ClosedOff() or SetClosed(true) to create only straight line without continuous loop. Is there any other ways to create an open spline? Thanks for your help.

---

<div class="post-metadata">

### Author: ![finetjul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/finetjul/32/154_2.png) [@finetjul](https://discourse.vtk.org/u/finetjul)
#### Post date: [March 23, 2022, 8:45pm UTC](https://discourse.vtk.org/t/vtksplinewidget-is-unable-to-set-open-loop-such-as-closedoff-or-setclosed-true/8123/2 "2022-03-23T20:45:44Z")

</div>

Unfortunately spline functions have not been implemented for the “open” case.  
See [KochanekSpline1D](https://github.com/Kitware/vtk-js/blob/master/Sources/Common/DataModel/KochanekSpline1D/index.js#L107) and [CardinalSpline1D](https://github.com/Kitware/vtk-js/blob/master/Sources/Common/DataModel/CardinalSpline1D/index.js#L118).

If you implement those (look at the C++ implementation [here](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Common/ComputationalGeometry/vtkKochanekSpline.cxx#L109-133) and [here](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Common/ComputationalGeometry/vtkKochanekSpline.cxx#L254-319)), I would be happy to integrate it into vtkSplineWidget.

Regards,  
Julien.
