Commit 93f7d032 authored by Jan Möbius's avatar Jan Möbius

Handle whitespace in obj files

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@95 fdac6126-5c0c-442c-9429-916003d36597
parent f3a77d51
......@@ -253,6 +253,16 @@ read(std::fstream& _in, BaseImporter& _bi, Options& _opt)
return false;
}
// Trim Both leading and trailing spaces
size_t start = line.find_first_not_of(" \t");
size_t end = line.find_last_not_of(" \t");
if(( std::string::npos == start ) || ( std::string::npos == end))
line = "";
else
line = line.substr( start, end-start+1 );
// comment
if ( line.size() == 0 || line[0] == '#' || isspace(line[0]) ) {
continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment