[vtkusers] vtk PLY reader errors

Meehan, Bernard MEEHANBT at nv.doe.gov
Wed Jul 8 18:25:37 EDT 2015


If you add a line after "element face 0”

property list uchar int vertex_index

It will load just fine. Just for clarity, here is the whole file:
ply
format ascii 1.0
element vertex 15
property float x
property float y
property float z
element face 0
property list uchar int vertex_index
end_header
53.242 91.622 149.959
129.485 97.222 149.719
81.920 4.705 46.381
81.827 4.788 46.983
80.120 4.781 47.902
76.090 4.647 49.168
68.482 6.366 51.216
68.482 6.366 51.216
58.200 11.971 54.295
48.691 17.704 54.613
40.140 25.495 53.721
32.668 34.396 51.962
26.993 44.212 46.917
22.274 51.449 35.907
24.514 49.859 18.384

Here is the code I tested it with:
import vtk
r = vtk.vtkPLYReader()
r.SetFileName("stuff.ply")
r.Update()

From: vtkusers <vtkusers-bounces at vtk.org<mailto:vtkusers-bounces at vtk.org>> on behalf of Anderson chidi Apunike via vtkusers <vtkusers at vtk.org<mailto:vtkusers at vtk.org>>
Reply-To: Anderson chidi Apunike <anderchidi at yahoo.com<mailto:anderchidi at yahoo.com>>
Date: Wednesday, July 8, 2015 at 2:39 PM
To: "vtkusers at vtk.org<mailto:vtkusers at vtk.org>" <vtkusers at vtk.org<mailto:vtkusers at vtk.org>>
Subject: [vtkusers] vtk PLY reader errors

Hi VTK developpers,

I am currently using vtkPLYReader class to load some polygonal objects.
I convert a txt file into a ply file  (ascii format) with Python. When I try opening the ply file with VTKplyreader, it returns the following error:

ERROR: In ..\..\VTK\IO\vtkPLYReader.cxx, line 125
vtkPLYReader (000000000483BDE0): Cannot read geometry

When I try opening the same PLY file that I created usinga software caled MeshLab, it opens the file in Meshlab, showing all the points.

I am confused at this point, not knowing what to do about it.

Here's part of my file. It has 266 vertices, but I reduced them to 15.
It has no faces. It only has vertices with their respective x, y,z coordinates.

ply
format ascii 1.0
element vertex 15
property float x
property float y
property float z
element face 0
end_header
53.242 91.622 149.959
129.485 97.222 149.719
81.920 4.705 46.381
81.827 4.788 46.983
80.120 4.781 47.902
76.090 4.647 49.168
68.482 6.366 51.216
68.482 6.366 51.216
58.200 11.971 54.295
48.691 17.704 54.613
40.140 25.495 53.721
32.668 34.396 51.962
26.993 44.212 46.917
22.274 51.449 35.907
24.514 49.859 18.384

Thanks.

Anderson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150708/200bbede/attachment.html>


More information about the vtkusers mailing list