Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between vertex and point in vtk

What's the main difference between a vertex and a point in VTK?

Well, I was assigning some computed points to an vtkPolyData output:

vtkPolyData* oput = vtkPolyData::SafeDownCast(out_info->Get(vtkDataObject::DATA_OBJECT()));

and I wondered whether to use the method SetVerts(vtkCellArray *v) or the method SetPoints(vtkPoints *).

like image 709
Nana89 Avatar asked Feb 06 '23 23:02

Nana89


1 Answers

In VTK datasets (i.e., classes inheriting vtkDataSet which is the simplest type of data that provides a notion of points), points are simply locations in space. Data may be stored at locations in space or on cells (e.g., triangles or tetrahedra) that represent a locus of points. Values stored on cells take on the same value at every point in the cell's locus.

Cells are defined by their corner points. In vtkPolyData, every cell is defined by a list of integer offsets into the point coordinates in a vtkPoints instance.

A vertex in VTK is a cell whose point locus is a single point.

It is possible to have points listed explicitly in a VTK dataset which are not reference by any cell (e.g., you can specify point coordinates in a vtkPoints object that are not used as corner points for any tetrahedron, triangle, or vertex cell). These points can only have point data (stored by arrays in a vtkPointData instance held by the vtkDataSet) and not cell data (stored by arrays in a vtkCellData instance held by the vtkDataSet).

So, SetPoints() lets you provide point coordinates which vtkCellArray instances then reference to define point locii of various shapes. One category of shapes is vertices (hence SetVerts()) while others include lines and polylines (SetLines()) and triangles/quads (SetPolys()).

like image 156
Drone2537 Avatar answered Mar 15 '23 04:03

Drone2537