VTK/Tutorials/GeometryTopology

From KitwarePublic
< VTK‎ | Tutorials
Jump to navigationJump to search

A big confusion among VTK beginners is "I added points to my file - why are there no points when I visualize it??". VTK strongly divides GEOMETRY from TOPOLOGY. What most users would think of as "points" are actually "points + vertices" in VTK. The geometry is ALWAYS simply a list of coordinates - the topology represents the connectedness of these coordinates. If no topology at all is specified, then, as far as VTK is aware, there is NOTHING to show. If you want to see points, you must tell VTK that each point is independent of the rest by creating a vertex (a 0-D topology) at each point. The following examples use a triangle to demonstrate a step at a time how to add geometry and topology to polydata.

  • Triangle - Geometry only - Create a polydata consisting of the three corners of a triangle. There is nothing to visualize as there is no topology.
  • Triangle - Geometry + Vertices - Create a polydata consisting of the three corners of a triangle. A vertex is added at each point so there is now 3 "points" for the user to see. This is 0-D topology.
  • Triangle - Geometry + Lines - Create a polydata consisting of three corners of a triangle. A line is added between each point. This is 1-D topology.
  • Triangle - Geometry + Polygon - Create a polydata consisting of three corners of a triangle. A polygon (in this case, a triangle) is added on the three points. This is 2-D topology.