# The PLY file is not working.

**URL:** https://discourse.vtk.org/t/the-ply-file-is-not-working/924
**Category:** Support
**Created:** [May 7, 2019, 7:13am UTC](https://discourse.vtk.org/t/the-ply-file-is-not-working/924 "2019-05-07T07:13:31Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![Kim\_William](https://discourse.vtk.org/user_avatar/discourse.vtk.org/kim_william/32/373_2.png) [@Kim\_William](https://discourse.vtk.org/u/Kim_William)
#### Post date: [May 7, 2019, 7:13am UTC](https://discourse.vtk.org/t/the-ply-file-is-not-working/924/1 "2019-05-07T07:13:31Z")

</div>

Hi all.

I have a question about PLY file load.

I have two PLY files.  
(A) PLY file: It made by 3D Scanner.  
(B) PLY file: The sample PLY file from the link.  
Link: [http://graphics.im.ntu.edu.tw/~robin/courses/cg04/model/index.html](http://graphics.im.ntu.edu.tw/~robin/courses/cg04/model/index.html)

The B file work normally but A file is not working on the same code.

My code snippet is as below:

vtkSmartPointer pPLYReader =  
vtkSmartPointer::New();  
pPLYReader-\>SetFileName(“myPLY.ply”);  
pPLYReader-\>Update();

vtkSmartPointer mapper =  
vtkSmartPointer::New();  
mapper-\>SetInputConnection(pPLYReader-\>GetOutputPort());

vtkSmartPointer actor =  
vtkSmartPointer::New();  
actor-\>SetMapper(mapper);

vtkSmartPointer renderer =  
vtkSmartPointer::New();  
renderer-\>AddActor(actor);  
renderer-\>SetBackground(.1, .2, .3);  
renderer-\>ResetCamera();

//vtkSmartPointer m\_vtkWindow;  
m\_vtkWindow-\>AddRenderer(renderer);  
m\_vtkWindow-\>Render();

I don’t know why A file is not working.

Unfortunately, I can’t upload the file.

Could you please advise me about loading the PLY file?

Thank you.

Have a good day 🙂

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.vtk.org/user_avatar/discourse.vtk.org/danlipsa/32/390_2.png) [@danlipsa](https://discourse.vtk.org/u/danlipsa)
#### Post date: [May 7, 2019, 12:55pm UTC](https://discourse.vtk.org/t/the-ply-file-is-not-working/924/2 "2019-05-07T12:55:37Z")

</div>

Kim,  
What version of VTK are you using? Can you try with master?

Thanks,

Dan

---

<div class="post-metadata">

### Author: ![Kim\_William](https://discourse.vtk.org/user_avatar/discourse.vtk.org/kim_william/32/373_2.png) [@Kim\_William](https://discourse.vtk.org/u/Kim_William)
#### Post date: [May 8, 2019, 12:12am UTC](https://discourse.vtk.org/t/the-ply-file-is-not-working/924/3 "2019-05-08T00:12:33Z")

</div>

Hi Dan Lipsa.

My VTK version is 8.2.0.

Thank you.

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.vtk.org/user_avatar/discourse.vtk.org/danlipsa/32/390_2.png) [@danlipsa](https://discourse.vtk.org/u/danlipsa)
#### Post date: [May 8, 2019, 12:56am UTC](https://discourse.vtk.org/t/the-ply-file-is-not-working/924/4 "2019-05-08T00:56:25Z")

</div>

Kim,

Can you try with VTK from the master branch

[https://gitlab.kitware.com/vtk/vtk](https://gitlab.kitware.com/vtk/vtk)

We had a PLY fix going in that did not make it in 8.2

Thanks,

Dan

---

<div class="post-metadata">

### Author: ![Kim\_William](https://discourse.vtk.org/user_avatar/discourse.vtk.org/kim_william/32/373_2.png) [@Kim\_William](https://discourse.vtk.org/u/Kim_William)
#### Post date: [May 8, 2019, 2:59am UTC](https://discourse.vtk.org/t/the-ply-file-is-not-working/924/5 "2019-05-08T02:59:31Z")

</div>

Hi Dan.

I tried to load my PLY file with VTK from the master branch.

But the symptom is the same…

Do you think, does the code have no problem?

I want to check the code is okay.  
If yes, I think the PLY file has a problem.

Thank you 🙂

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.vtk.org/user_avatar/discourse.vtk.org/danlipsa/32/390_2.png) [@danlipsa](https://discourse.vtk.org/u/danlipsa)
#### Post date: [May 8, 2019, 1:05pm UTC](https://discourse.vtk.org/t/the-ply-file-is-not-working/924/6 "2019-05-08T13:05:19Z")

</div>

What is the error you are seeing?

You can try loading that file in meshlab, to see if that program loads it.

If you can share your file privately, I can take a look at it. My email is my first name dot my last name at [kitware.com](http://kitware.com)

Thanks,

Dan

---

<div class="post-metadata">

### Author: ![Kim\_William](https://discourse.vtk.org/user_avatar/discourse.vtk.org/kim_william/32/373_2.png) [@Kim\_William](https://discourse.vtk.org/u/Kim_William)
#### Post date: [May 8, 2019, 11:41pm UTC](https://discourse.vtk.org/t/the-ply-file-is-not-working/924/7 "2019-05-08T23:41:53Z")

</div>

I sent you my PLY file by email.

Thank you 🙂

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [May 9, 2019, 4:20am UTC](https://discourse.vtk.org/t/the-ply-file-is-not-working/924/8 "2019-05-09T04:20:05Z")

</div>

> [@danlipsa](#):
>
> My email is my first name dot

Note that you never need to reveal your email address if you use discourse. You can send private message by clicking on the user’s photo then on the “Message” button in the top-right corner.

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.vtk.org/user_avatar/discourse.vtk.org/danlipsa/32/390_2.png) [@danlipsa](https://discourse.vtk.org/u/danlipsa)
#### Post date: [May 9, 2019, 1:42pm UTC](https://discourse.vtk.org/t/the-ply-file-is-not-working/924/9 "2019-05-09T13:42:46Z")

</div>

Hi Kim,

Thanks for sending me the file.

I took a look at it in ParaView. The problem with it is that it does not have any cells, so the default representation - surface shows nothing.

The Point Gaussian representation works.

For VTK, try

[https://vtk.org/doc/nightly/html/classvtkPointGaussianMapper.html](https://vtk.org/doc/nightly/html/classvtkPointGaussianMapper.html)

instead of

vtkPolyDataMapper.

Dan

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.vtk.org/user_avatar/discourse.vtk.org/danlipsa/32/390_2.png) [@danlipsa](https://discourse.vtk.org/u/danlipsa)
#### Post date: [May 9, 2019, 1:45pm UTC](https://discourse.vtk.org/t/the-ply-file-is-not-working/924/10 "2019-05-09T13:45:06Z")

</div>

Thanks Andras, I’ll keep this in mind.  
I use discourse through email, so I have not seen the actual site that much.

Dan

---

<div class="post-metadata">

### Author: ![Kim\_William](https://discourse.vtk.org/user_avatar/discourse.vtk.org/kim_william/32/373_2.png) [@Kim\_William](https://discourse.vtk.org/u/Kim_William)
#### Post date: [May 10, 2019, 12:43am UTC](https://discourse.vtk.org/t/the-ply-file-is-not-working/924/11 "2019-05-10T00:43:42Z")

</div>

Hi Dan.

Thank you for your support!

Finally, I can be rendering my PLY file.

But why my PLY file is only used by vtkPointGaussianMapper?  
(Why the data has not any cells?)

Thank you 🙂

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [May 10, 2019, 1:04am UTC](https://discourse.vtk.org/t/the-ply-file-is-not-working/924/12 "2019-05-10T01:04:57Z")

</div>

> [@Kim\_William](#):
>
> Why the data has not any cells?

Raw data that surface scanners acquire is just a point cloud (no cells). Some surface scanners come with sophisticated surface reconstruction software (that can merge surfaces, filter outliers, map texture, etc.). If you don’t have access to such software then you may try the few basic surface reconstructor filters that are available in VTK ([vtkSurfaceReconstructionFilter](https://lorensen.github.io/VTKExamples/site/Cxx/Filtering/SurfaceFromUnorganizedPoints/), [PoissonExtractSurface](https://lorensen.github.io/VTKExamples/site/Cxx/Points/PoissonExtractSurface/), [PowercrustExtractSurface](https://lorensen.github.io/VTKExamples/site/Cxx/Points/PowercrustExtractSurface/)).

---

<div class="post-metadata">

### Author: ![lorensen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lorensen/32/20_2.png) [@lorensen](https://discourse.vtk.org/u/lorensen)
#### Post date: [May 10, 2019, 1:30am UTC](https://discourse.vtk.org/t/the-ply-file-is-not-working/924/13 "2019-05-10T01:30:58Z")

</div>

There are several examples that process points…Take a look at:  
[https://lorensen.github.io/VTKExamples/site/Cxx/#point-cloud-operations](https://lorensen.github.io/VTKExamples/site/Cxx/#point-cloud-operations)

Bill

---

<div class="post-metadata">

### Author: ![Kim\_William](https://discourse.vtk.org/user_avatar/discourse.vtk.org/kim_william/32/373_2.png) [@Kim\_William](https://discourse.vtk.org/u/Kim_William)
#### Post date: [May 10, 2019, 2:55am UTC](https://discourse.vtk.org/t/the-ply-file-is-not-working/924/14 "2019-05-10T02:55:05Z")

</div>

Thank you everyone so much!

It was very helpful for me!

Thank you 🙂
