From 0ee735dba2892b81c6c3c60ca67fa46b0f887bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 10 Dec 2018 10:32:10 +0100 Subject: [PATCH] - Use Fixed as stream option in OBJ writer to avoid problems with other programs reading scientific notation closes #60 --- Doc/changelog.docu | 1 + src/OpenMesh/Core/IO/writer/OBJWriter.cc | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Doc/changelog.docu b/Doc/changelog.docu index 2de118e8..273231fc 100644 --- a/Doc/changelog.docu +++ b/Doc/changelog.docu @@ -28,6 +28,7 @@
  • OM Writer/Reader: Update file format version to 2.0. Older files can still be read, but older OpenMesh versions cannot read new format.
  • OM Writer/Reader: Fixed inconsistent writing/reading of edge properties
  • OM Writer/Reader: Add option to store status
  • +
  • OBJ Writer: Use Fixed as stream option in OBJ writer to avoid problems with other programs reading scientific notation
  • Tools diff --git a/src/OpenMesh/Core/IO/writer/OBJWriter.cc b/src/OpenMesh/Core/IO/writer/OBJWriter.cc index a592e0da..a0d0ec29 100644 --- a/src/OpenMesh/Core/IO/writer/OBJWriter.cc +++ b/src/OpenMesh/Core/IO/writer/OBJWriter.cc @@ -97,8 +97,12 @@ write(const std::string& _filename, BaseExporter& _be, Options _opt, std::stream return false; } + // Set precision on output stream. The default is set via IOManager and passed through to all writers. out.precision(_precision); + // Set fixed output to avoid problems with programs not reading scientific notation correctly + out << std::fixed; + { #if defined(WIN32) std::string::size_type dot = _filename.find_last_of("\\/");