[vtkusers] vtkPolyData - multiple normals per vertex and vertex duplication

eternallite2 cdavid.tran at gmail.com
Tue Sep 2 10:24:54 EDT 2014


This is a fundamental question about how to deal with multiple normals per
vertex/point.

If I have a cube with 8 vertices and 6 faces for example, I would store this
into a vtkPolyData object with
8 vtkPoints using vtkPolyData->SetPoints and for the faces I would store 
6 vtkPolygon (faces) with each face referencing 4 point IDs from the points
array.

Since there are 6 faces and each face references 4 points, I would have a
total
of 6 * 4 = 24 point IDs for the faces.

This makes sense, but now let's say I want to texture map the cube (or add
normals); 
I can't just assign each point one normal or one texture coordinate because
on a cube, 
every point is shared by 3 other faces so every point would have 3 different
normals depending on which face of the cube that point is on.

In VTK, one vtkPoint can only have one normal, so I noticed the way VTK
tries to remedy this
is by duplicating the point everytime the face references the point.

So since every point is referenced by 3 faces in the cube, every point will
have 3 normals.
But since there are only 8 unique points, VTK will duplicate the 8 points 3
times and make 24
vtkPoints with 24 normals.

Sorry for the long explanation, so my question is... there are only 8 unique
points but now my vtkPolyData contains 24 vtkPoints (even though it's 3x
duplicates), how would I get the individual unique points from the
vtkPolyData while still preserving its normals/texture coordinates?

(I know vtkCleanPolyData can merge points within the same position, but they
also merge 
normals and texture coordinates so that each point has one normal, etc. 

Is there a data structure in VTK that preserves the relationship without
duplicating? (or can I extract
the unique points and their referenced texture coordinates, normals easily
from a vtkPolyData is what I'm asking) - 

Thanks for any help I can get :)








--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkPolyData-multiple-normals-per-vertex-and-vertex-duplication-tp5728535.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list