# Clip interpolated points with stl

**URL:** https://discourse.paraview.org/t/clip-interpolated-points-with-stl/4669
**Category:** ParaView Support
**Created:** [June 24, 2020, 12:50pm UTC](https://discourse.paraview.org/t/clip-interpolated-points-with-stl/4669 "2020-06-24T12:50:04Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Jouv](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/919ad9/32.png) [@Jouv](https://discourse.paraview.org/u/Jouv)
#### Post date: [June 25, 2020, 12:45pm UTC](https://discourse.paraview.org/t/clip-interpolated-points-with-stl/4669/3 "2020-06-25T12:45:15Z")

</div>

Hey Kyoshimi, thank you for the help - I managed to get it working, although it isn’t perfect. I have to use a scalar clip to generate a contour after using the programmable filter. The below did it, if I first ctrl selected the data set and then the stl:

mesh = self.GetInputDataObject(0, 0)

import paraview.vtk as vtk

pdd = vtk.vtkImplicitPolyDataDistance()  
pdd.SetInput(mesh)

dataset = self.GetInputDataObject(0, 1)

output.CopyAttributes(dataset)  
numPts = dataset.GetNumberOfPoints()  
distArray = vtk.vtkDoubleArray()  
distArray.SetName(“Distance”)  
distArray.SetNumberOfComponents(1)  
distArray.SetNumberOfTuples(numPts)

for i in range(numPts):  
pt = dataset.GetPoint(i)  
print(pt)  
distArray.SetValue(i, pdd.EvaluateFunction(pt))

output.GetPointData().AddArray(distArray)

---

_[View the full topic](https://discourse.paraview.org/t/clip-interpolated-points-with-stl/4669)._
