[vtkusers] vtkOBJReader + minor bug

Goodwin Lawlor goodwin.lawlor at ucd.ie
Thu Jun 21 12:45:41 EDT 2001


> is it true that vtkOBJReader does only return PolyData with faces and
> neglects points and lines of the Wavefront .obj file ?

Yes, this is true. vtkOBJReader reads vertex geometry, vertex normals,
texture coordinates and face elements into a vtkPolyData object.

It could be extend to read point and line elements.

Minor bug:
- vtkOBJReader duplicates (and triplicates!...) vertex geometry. This is
because is reads a face from file, then gets the vertices of the face which
it inserts into a vtkPoints object. Since faces share vertices (in a mesh)
with one another they get duplicated.

(eg)
-The file vtkdata/viewpoint/cow.obj says there are 2903 vertices in the
dataset
-Run the tcl example contrib/examples/OBJReader.tcl
-Type "u" for the console and type there:
"puts [[wavefront GetOutput] GetNumberOfPoints]"
-You'll see that vtkOBJReader read in 12330 points not 2903
- Now type:
"puts [[clean GetOutput] GetNumberOfPoints]
-You'll see that vtkCleanPolyData has merged coincident points and the cow
has the correct number of points again - 2903

Goodwin
University College Dublin





More information about the vtkusers mailing list