# Error message:\[Qt\] ctkSliderWidget::setSingleStep() 0 is out of bounds. 0 100 1

**URL:** <https://discourse.slicer.org/t/error-message-qt-ctksliderwidget-setsinglestep-0-is-out-of-bounds-0-100-1/29064>\
**Category:** Support\
**Created:** [April 22, 2023, 9:12pm UTC](https://discourse.slicer.org/t/error-message-qt-ctksliderwidget-setsinglestep-0-is-out-of-bounds-0-100-1/29064 "2023-04-22T21:12:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dexter777](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dexter777/32/6118_2.png) [@Dexter777](https://discourse.slicer.org/u/Dexter777)\
**Post date:** [April 22, 2023, 9:12pm UTC](https://discourse.slicer.org/t/error-message-qt-ctksliderwidget-setsinglestep-0-is-out-of-bounds-0-100-1/29064/1 "2023-04-22T21:12:24Z")

</div>

Hi, when I’m drawing a closed curve on a surface mesh to cut out and create a new surface model, I am receiving the following message:  
[Qt] ctkSliderWidget::setSingleStep() 0 is out of bounds. 0 100 1

The code I’m using is:

# Get input data

curveNode = getNode(‘CC\_5’)  
modelNode = getNode(‘Segment\_1’)  
extractLargestPart = False

# Get VTK data objects from MRML nodes

curvePoints = curveNode.GetCurvePointsWorld()  
meshToClip = modelNode.GetMesh() # we should apply transform to World

# Clip model with curve

loop = vtk.vtkSelectPolyData()  
loop.SetLoop(curvePoints)  
loop.GenerateSelectionScalarsOn()  
loop.SetInputData(meshToClip)  
loop.SetSelectionModeToLargestRegion()  
clip = vtk.vtkClipPolyData()  
clip.InsideOutOn()  
clip.SetInputConnection(loop.GetOutputPort())  
clip.GenerateClippedOutputOn()  
clip.Update()  
clippedOutput = clip.GetOutput() if extractLargestPart else clip.GetClippedOutput()

connectivity = vtk.vtkConnectivityFilter()  
connectivity.SetInputData(clippedOutput)  
connectivity.Update()  
clippedOutput2 = connectivity.GetOutput()

# Remove unused points

cleaner = vtk.vtkCleanPolyData()  
cleaner.SetInputData(clippedOutput2)  
cleaner.Update()  
cleanedClippedOutput = cleaner.GetOutput()

# Save result to new node

clippedModel = slicer.modules.models.logic().AddModel(cleanedClippedOutput)  
clippedModel.GetDisplayNode().SetActiveScalarName(“”)  
clippedModel.GetDisplayNode().BackfaceCullingOff()

Previously I was able to cut the skin surface out but the cut line was not close enough to where it needed to be. Trying again, I am receiving the error message.

Any suggestions?  
Thank you.

 ![Skin Model](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/4/e4ac0e9efaa4a02917168c99366bae5759c58895.png)  
 ![Error Message](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/c/2cc648568b775845db77bf0d12a8732f74dbec6a.png)

---

<div class="post-metadata">

**Author:** ![Dexter777](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dexter777/32/6118_2.png) [@Dexter777](https://discourse.slicer.org/u/Dexter777)\
**Post date:** [April 25, 2023, 11:39pm UTC](https://discourse.slicer.org/t/error-message-qt-ctksliderwidget-setsinglestep-0-is-out-of-bounds-0-100-1/29064/2 "2023-04-25T23:39:21Z")

</div>

The problem is having a green segmentation under the red model. I was hoping to use the green segmentation as a guide to show me where to cut the skin. The closed curve created can not find the red model to cut the surface model. If I turn off the green segmentation off I can cut the red surface as a model.

I am creating veterinary medical simulators which are then molded to create duplicates. It would be great to have a parametric function to create boxes/cubes with a draft on them to facilitate removal from the mold.  
Thanks

 ![Green Segmentation](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/6/769561dd4bacc2223558494777c5fdeb0c2b1c0c.png)  
 ![Red Model](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/a/2aaefc373ffb751e61371022af68cf8aeec69dc2.png)
