[vtkusers] Please Help!!!

Goodwin Lawlor goodwin.lawlor at ucd.ie
Thu Oct 17 11:49:40 EDT 2002


Hi Theodore,

I've come up against this problem with vtkOBJReader in the past and have
posted to the list about it
(http://public.kitware.com/pipermail/vtkusers/2001-June/006909.html)

Basically, vtkOBJReader reads in a polygon from disk and inserts its
vertices  into the points list regardless if they've been inserted already.

The way around this is to follow vtkOBJReader with vtkCleanPolyData. So....

vtkOBJReader reader
    reader SetFileName "file.obj"

vtkCleanPolyData clean
    clean SetInput [reader GetOutput]

vtkXXXXFilter filter
    filter SetInput [clean GetOutput]

The vtkCleanPolyData filter will delete duplicate points from the points
list. This works fine except the order of the points list will be different
from the order of the points in the OBJ file... if there are scalars
associated with the points in the file they wont be assigned correctly. I've
been meaning to write another obj reader that would preserve the list
order... sometime.

HTH

Goodwin
University College Dublin


----- Original Message -----
From: "Theodore Papatheodorou" <tp500 at doc.ic.ac.uk>
To: <vtk-developers at public.kitware.com>; "'VTK Users'"
<vtkusers at public.kitware.com>
Sent: Thursday, October 17, 2002 10:43 AM
Subject: [vtkusers] Please Help!!!


> Hello VTKuser  & developers,
> please help! I am loading a file of type .OBJ into VTK and although it
> only has about 9000 points the vtkPolyData object that is returned has
> 46.000. I have printed the list of all the points in the resulting
> vtkPolyData object and I have seen that there are a lot of repetitions
> something that does not exist in the original data set.
> Can anyone tell me why it loads the OBJ file incorrectly? Why does it
> produce these replications of data and how I can fix it?
>
> vtkOBJReader  *face = vtkOBJReader::New();
>     face->SetFileName("face.obj");
>
> vtkPolyData *datum = vtkPolyData::New();
>     datum = face->GetOutput();
>
> int x = datum->GetNumberOfPoints()
>
> x = 46845  (when it really is around 9000).
>
> Any Ideas? I have spent a lot of time on this. If you know something
> please email me! Thanks!!!!
> Theodoros
>
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers




More information about the vtkusers mailing list