You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a polygon is bigger than 256 edges, this results in a ply file which cannot be read by PCL
This Possible Fix
When a polygon contains a large polygon, the simple fix is to change: property list uchar int vertex_indices
to property list uint int vertex_indices
PCL will then be able to read back in this ply file.
However, meshlab (for comparison) cannot load this ply file. VTK can parse it.
Your Environment (please complete the following information):
OS: Ubuntu 22.04
PCL Versio: 1.12 with ROS2 / humble
The text was updated successfully, but these errors were encountered:
The existing header:
ply
format ascii 1.0
comment PCL generated
element vertex 1257
property float x
property float y
property float z
property uchar red
property uchar green
property uchar blue
property float nx
property float ny
property float nz
property float curvature
element face 8
property list uchar int vertex_indices
end_header
The header containing the fix:
ply
format ascii 1.0
comment PCL generated
element vertex 1257
property float x
property float y
property float z
property uchar red
property uchar green
property uchar blue
property float nx
property float ny
property float nz
property float curvature
element face 8
property list uint int vertex_indices
end_header
PCL will then be able to read back in this ply file.
However, meshlab (for comparison) cannot load this ply file. VTK can parse it.
So the best approach probably is to check whether any face/polygon has more than 255 vertices, if yes use uint (and maybe print a warning), if not use uchar as before.
Feel free to open a pull request.
Describe the bug
When writing a PolygonMesh with large polygons, PCL doesnt properly encode the size of the vertex lists.
Very specifically these lines use
uchar
to store the size of the polygon:https://github.com/PointCloudLibrary/pcl/blob/master/io/src/ply_io.cpp#L907C32-L907C51
https://github.com/PointCloudLibrary/pcl/blob/master/io/src/ply_io.cpp#L1520
When a polygon is bigger than 256 edges, this results in a ply file which cannot be read by PCL
This Possible Fix
When a polygon contains a large polygon, the simple fix is to change:
property list uchar int vertex_indices
to
property list uint int vertex_indices
PCL will then be able to read back in this ply file.
However, meshlab (for comparison) cannot load this ply file. VTK can parse it.
Your Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: