# vtkPointSource & vtkPoints

**URL:** https://discourse.vtk.org/t/vtkpointsource-vtkpoints/12082
**Category:** Development
**Created:** [August 2, 2023, 9:41pm UTC](https://discourse.vtk.org/t/vtkpointsource-vtkpoints/12082 "2023-08-02T21:41:05Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![totte\_karlsson](https://discourse.vtk.org/user_avatar/discourse.vtk.org/totte_karlsson/32/4281_2.png) [@totte\_karlsson](https://discourse.vtk.org/u/totte_karlsson)
#### Post date: [August 2, 2023, 9:56pm UTC](https://discourse.vtk.org/t/vtkpointsource-vtkpoints/12082/2 "2023-08-02T21:56:35Z")

</div>

I found (one) answer from another post here: [How to create a mesh data from vtkPoints? - #4 by Charles\_Gueunet](https://discourse.vtk.org/t/how-to-create-a-mesh-data-from-vtkpoints/6585/4)

```auto
  // vtk data set to fill
  vtkNew<vtkPolyData> myPolyData;

   // compute a vtkIdList that contains ids of each points 
 vtkIdType numPoints = points->GetNumberOfPoints();  
 vtkSmartPointer<vtkIdList> pointIds = vtkSmartPointer<vtkIdList>::New();
 pointIds->SetNumberOfIds(numPoints);
 for (vtkIdType i = 0; i < numPoints; ++i)
 {
    pointIds->SetId(i, i);
 }

   // create a vtkCellArray from this list
  vtkSmartPointer<vtkCellArray> polyPoint = vtkSmartPointer<vtkCellArray>::New();
  polyPoint->InsertNextCell(pointIds);
 
   // give the points and cells to the final poly data
  myPolyData->SetPoints(points);
  myPolyData->SetVerts(polyPoint);

```

So, the points are used to construct the cell(s). It seems all points are “within” one cell. But not sure if that is proper semantics.

I believe I read somewhere that in order to render any data, the data need to be in “cells”.

I guess this small example goes to the core of how primitive data is represented in vtk, in order to be visualized, so, time to read the manual(!)

---

_[View the full topic](https://discourse.vtk.org/t/vtkpointsource-vtkpoints/12082)._
