# Curve deviates or forms spikes when using Open Curve Markup Tool

**URL:** <https://discourse.slicer.org/t/curve-deviates-or-forms-spikes-when-using-open-curve-markup-tool/43654>\
**Category:** Support\
**Tags:** markups\
**Created:** [July 8, 2025, 12:46pm UTC](https://discourse.slicer.org/t/curve-deviates-or-forms-spikes-when-using-open-curve-markup-tool/43654 "2025-07-08T12:46:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LJW](https://avatars.discourse-cdn.com/v4/letter/l/51bf81/32.png) [@LJW](https://discourse.slicer.org/u/LJW)\
**Post date:** [July 8, 2025, 12:46pm UTC](https://discourse.slicer.org/t/curve-deviates-or-forms-spikes-when-using-open-curve-markup-tool/43654/1 "2025-07-08T12:46:15Z")

</div>

Hi,

I’m using the Open Curve Markup Tool in 3D Slicer to create curves on a surface model, such as between the mesial and distal papilla of a tooth. To support this, I’m also calculating and visualizing minimum curvature using the following Python code in the Python Interactor:

```auto
-----------------------------------------------------------------
modelNode = getNode('DB')

import vtk
curv = vtk.vtkCurvatures()
curv.SetInputData(modelNode.GetPolyData())
curv.SetCurvatureTypeToMinimum()

modelNode.SetPolyDataConnection(curv.GetOutputPort())
modelNode.GetDisplayNode().SetActiveScalar("Minimum_Curvature", vtk.vtkAssignAttribute.POINT_DATA)
modelNode.GetDisplayNode().SetScalarVisibility(True)
-----------------------------------------------------------------

```

In the Markups module (Create open curve markup), I’m setting:

- Curve type: Shortest distance on surface
- Model node: the surface model
- Cost function: Inverse squared
- Weighting: distance / curvature

The problem is that the generated curve sometimes deviates in unexpected directions, even when the path seems straightforward. When I try to correct it by manually adding control points (Ctrl + click), the curve often becomes worse, with sharp spikes or unnatural shapes.

Is there any way to prevent this kind of behavior or improve the curve stability when editing?

Thanks.
