From 912f3f01628b1fa01398caaa8d9c5b342f48ec30 Mon Sep 17 00:00:00 2001 From: Sebastian Hegler Date: Mon, 6 Nov 2023 17:34:29 +0100 Subject: [PATCH] read_OBJ: allow arbitrary whitespace in "f" lines --- Stream_support/include/CGAL/IO/OBJ.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Stream_support/include/CGAL/IO/OBJ.h b/Stream_support/include/CGAL/IO/OBJ.h index d8123bc0073a..a2d437f96461 100644 --- a/Stream_support/include/CGAL/IO/OBJ.h +++ b/Stream_support/include/CGAL/IO/OBJ.h @@ -136,8 +136,11 @@ bool read_OBJ(std::istream& is, } // the format can be "f v1/vt1/vn1 v2/vt2/vn2 v3/vt3/vn3 ..." and we only read vertex ids for now, - // so skip to the next vertex - iss.ignore(256, ' '); + // so skip to the next vertex, but be tolerant about which whitespace is used + if (!std::isspace(iss.peek())) { + std::string ignoreme; + iss >> ignoreme; + } } if(iss.bad())