Page MenuHome

Cannot import PLY file generated by Rhinos3D 6.0
Confirmed, NormalPublic

Description

System Information
Operating system: Ubuntu 18
Graphics card: Integrated Intel

Blender Version
Broken: 2.79b

Short description of error
Blender can not open a PLY file exported from Rhinos 6.0. Here the file: https://github.com/cnr-isti-vclab/meshlab/files/3330082/Box.ply.zip

When run through console, it reports:

Invalid header ('end_header' line not found!)
Invalid file

I checked with a hex editor, and the end_header line is there. Maybe there is a problem with carriage return vs newline?

Exact steps for others to reproduce the error
Open Blender from a terminal/console. Import into Blender the file linked above. Check the output in the terminal.

Related:
https://github.com/cnr-isti-vclab/meshlab/issues/463
https://github.com/google/draco/issues/613

Event Timeline

Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Confirmed.Fri, Jun 26, 12:58 PM

Will confirm for now, apparently there is an issue with line termination, yes.
Not sure if it is against the specs, but using line in plyf [plyf is open(filepath, 'rb')] will not separate lines properly.
Tried using plyf.read().splitlines() - that separates them properly - but has issues later on.
Needs more investigation...

FWIW: current stable version of Rhino is v6 (SR 27 I believe).

Importing the PLY file into Rhino v6, then re-exporting as PLY, then importing in Blender works just fine. Also an export from a clean Rhino file (with just that a box) work just fine.

Even a complex model exported as PLY with Rhino 6 imports fine in Blender (2.83.1)

Thanks. The files you provided are in ASCII format, whereas the original one is in binary format. Can you see if you can select the export option as binary in 6? Otherwise we do not know if the bug is still there in 6.0. Thanks!

Right, binary format indeed fails.

Upon a bit further inspection it turns out the PLY file you provided is exported with Rhino 6.

So binary PLY also fails in 2.83.1

Ferdy Mercury (ferdymercury) renamed this task from Cannot import PLY file generated by Rhinos 3.0 to Cannot import PLY file generated by Rhinos 6.0.Sat, Jun 27, 9:57 PM
Ferdy Mercury (ferdymercury) renamed this task from Cannot import PLY file generated by Rhinos 6.0 to Cannot import PLY file generated by Rhinos3D 6.0.
Ferdy Mercury (ferdymercury) updated the task description. (Show Details)

Thanks Nathan. Sorry, I had a mind shortcut and transformed Rhinos3D 6.0 to Rhinos 3.0. Indeed, it is Rhinos 6.0 the original file.

Concerning line endings:

https://www.graphics.rwth-aachen.de/media/openmesh_static/Documentations/OpenMesh-5.2-Documentation/a00002.html
https://github.com/PointCloudLibrary/pcl/issues/1256
https://github.com/dranjan/python-plyfile

Header line endings
The specification explicitly states that lines in the header must end with carriage returns, but this rule doesn't seem to be followed by anyone, including the C-language PLY implementation by Greg Turk, the author of the format. Here, we stick to common practice and output Unix-style line endings (with no carriage returns) but accept any line ending style in input files.