I have a PLY file (exported from Solidworks incl. vertex colors), which I want to visualize using vtk. The header information of the file shows that it contains some color information:
´
ply
format binary_little_endian 1.0
comment SOLIDWORKS generated,length unit = Millimeter
element vertex 8927
property float x
property float y
property float z
element face 17436
property uchar red
property uchar green
property uchar blue
property uchar alpha
property list uchar int vertex_indices
end_header
I read the file using vtkPLYReader, but somehow I do not see different colors on the model. The whole model is represented as white. If I open the file in e.g. ParaView or MeshLab, the colors are there.
Please see a sample file testModel.PLY (48.8 KB). As mentioned above, I can see all colors (yellow and black), if I open it via ParaView or MeshLab
Thank you!
In ParaView I had to use the calculator to strip down the alpha component of the RGBA provided to get the black/yellow color. Since the available alpha is only equal to 0.
Could you please explain how to do that in ParaView, so that I can follow your steps?
Thank you!
Ok. No need to explain. I figured it out. In “Color Map Editor” I select the “Interpret Values As Categories” and under “Annotations”, I select the desired color. During export as ply file, I deselect the “Alpha” value and write it only with RGB color information.
Thank you for your effort.