PLY import under ubuntu error
A processing system for 3D triangular meshes
Brought to you by:
cignoni,
granzuglia
If I import PLY-files under Ubuntu I get following error:
While opening: '/home/noel2/bin/RGBDemo0.4/current_mesh.ply'
Error encountered while loading file:
"/home/...../bin/RGBDemo0.4/current_mesh.ply"
Error details: Unespected eof
I had this problem under Meshlab 1.22, 1.23 and 1.3 (Ubuntu-packages and self-compiled)
The file working fine with meshlab under windows and are point clouds, surfels or triangles from:
http://nicolas.burrus.name/index.php/Research/KinectRgbDemoV4#tocLink2
Please help. Thanks.
Can you provide the offending ply file?
on my ubuntu machine ply importing works fine...
cheeers
P.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
My files are a little bit large but it also happen with the "bunny":
ftp://graphics.stanford.edu/pub/3Dscanrep/bunny.tar.gz
On the console get additionally following message:
LOG: 0 Warning: Mesh /home/noel2/Downloads/bunny/data/bun090.ply has not been opened
LOG: 0 All files opened in 1374 msec
And I can also say that it happen on 3 installations on 2 different computers.
Last edit: Anonymous 2016-12-19
This issue is real and happens because of incorrectly locale-aware number parsing. I can confirm it for Ubuntu and Debian 1.2 and 1.3 versions.
The "unespected eof" - happy misspelling :) comes from import_ply.h, the loop reading vertices (in my case) failing when for first data row the Read() returns -1, because the decimal dot does not parse as number when decimal comma is specified in the locale.
My locale is Slovenian, but I guess most european locales will fail here.
Work-around is to call meshlab with LANG=C, i guess, or convert files to use commas in the data rows.
Fixing this comes down to adjusting the ply code in vcg library to not use locale-aware parsing. Should not be too hard?
Hello again, I managed to fix this by setting numeric locale to C in main.cpp of meshlab.
Please see the diff below, could not figure out how to attach it to the bug.
There is similar code already in meshlabplugins/filter_plymc/plymc_main.cpp but it doesn't take effect in meshlab.
diff --git a/meshlab/src/meshlab/main.cpp b/meshlab/src/meshlab/main.cpp
index 6a74830..1fd1c18 100644
--- a/meshlab/src/meshlab/main.cpp
+++ b/meshlab/src/meshlab/main.cpp
@@ -25,12 +25,16 @@
#include <qmessagebox>
#include "mainwindow.h"</qmessagebox>
+using namespace std;
+
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLocale::setDefault(QLocale::C);
QCoreApplication::setOrganizationName("VCG");
QCoreApplication::setApplicationName("MeshLab");
+
It is an old bug with an easy solution, but I can confirm it under Ubuntu 12.12, meshlab 1.3.0a and 1.3.3.
1.3.3 I installed from a dubious launchpad file to get rid of the bug, but no success. export LANG=C helps.
The problem properly in these cases, not sure which one make the error:
so, just try to fix them all!
you can use some standard .ply file in this site to test your meshlab
http://paulbourke.net/dataformats/ply/
I confirmed with meshlab version 1.3.2 I just downloaded today (14 - Jan - 2014) (self-compile), it works fine with ubuntu 12.04
Last edit: TRUONG Ngoc Tuan 2014-01-14
seq 0.1 1
if it points out 0,1 run
sed 's#.#,#g' yourfile.ply >> temp.ply
meshlab temp.ply