# Footpoints of streamline

**URL:** https://discourse.paraview.org/t/footpoints-of-streamline/14021
**Category:** ParaView Support
**Created:** [February 26, 2024, 10:35am UTC](https://discourse.paraview.org/t/footpoints-of-streamline/14021 "2024-02-26T10:35:33Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ssmaity](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/e8c25b/32.png) [@ssmaity](https://discourse.paraview.org/u/ssmaity)
#### Post date: [February 26, 2024, 10:35am UTC](https://discourse.paraview.org/t/footpoints-of-streamline/14021/1 "2024-02-26T10:35:34Z")

</div>

Hi, I would like to extract the coordinate of the footprints of streamlines. Thanks in advance.

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [February 26, 2024, 10:40am UTC](https://discourse.paraview.org/t/footpoints-of-streamline/14021/2 "2024-02-26T10:40:29Z")

</div>

Um, what is a streamline footprint?

---

<div class="post-metadata">

### Author: ![ssmaity](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/e8c25b/32.png) [@ssmaity](https://discourse.paraview.org/u/ssmaity)
#### Post date: [February 26, 2024, 2:08pm UTC](https://discourse.paraview.org/t/footpoints-of-streamline/14021/3 "2024-02-26T14:08:01Z")

</div>

The endpoints of streamlines.

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [February 27, 2024, 7:33pm UTC](https://discourse.paraview.org/t/footpoints-of-streamline/14021/4 "2024-02-27T19:33:56Z")

</div>

I can’t think of any existing filters that will do this easily. But I think a `Programmable Filter` with this script will extract the first and last point of each streamline:

```py
input0 = inputs[0]
numCells = input0.GetNumberOfCells()

# Clear output
output.DeepCopy(vtk.vtkPolyData())

newPoints = vtk.vtkPoints()
newPoints.Resize(numCells * 2)

output.AllocateEstimate(0, 1, numCells, 2, 0, 0, 0, 0)

for cellIndex in range(numCells):
    cellPoints = input0.GetCell(cellIndex).GetPoints()
    firstPoint = cellPoints.GetPoint(0)
    lastPoint = cellPoints.GetPoint(cellPoints.GetNumberOfPoints() - 1)
    ptidx1 = newPoints.InsertNextPoint(firstPoint)
    ptidx2 = newPoints.InsertNextPoint(lastPoint)
    output.InsertNextCell(vtk.VTK_LINE, (ptidx1, ptidx2))

output.SetPoints(newPoints)

```

 ![Screenshot 2024-02-27 at 2.33.20 PM](https://discourse.paraview.org/uploads/default/original/2X/0/0bfe088cefc27f747fd2091c5c927e32c60e7956.png)
