Precision fixes

This commit is contained in:
aothms
2015-11-30 22:59:21 +01:00
parent fdf1b29682
commit bf292cccd0
2 changed files with 7 additions and 3 deletions
+5 -2
View File
@@ -17,12 +17,13 @@
* *
********************************************************************************/
#include <limits>
#include <iomanip>
#include "../ifcgeom/IfcGeomRenderStyles.h"
#include "WavefrontObjSerializer.h"
#include <iomanip>
bool WaveFrontOBJSerializer::ready() {
return obj_stream.is_open() && mtl_stream.is_open();
}
@@ -70,6 +71,8 @@ void WaveFrontOBJSerializer::write(const IfcGeom::TriangulationElement<double>*
obj_stream << "g " << o->unique_id() << "\n";
obj_stream << "s 1" << "\n";
obj_stream << std::setprecision(std::numeric_limits<double>::digits10);
const IfcGeom::Representation::Triangulation<double>& mesh = o->geometry();
const int vcount = mesh.verts().size() / 3;
+2 -1
View File
@@ -19,6 +19,7 @@
#include <iomanip>
#include <locale>
#include <limits>
#include <boost/algorithm/string.hpp>
@@ -327,7 +328,7 @@ private:
std::string format_double(const double& d) {
std::ostringstream oss;
oss.imbue(std::locale::classic());
oss << std::setprecision(15) << d;
oss << std::setprecision(std::numeric_limits<double>::digits10) << d;
const std::string str = oss.str();
oss.str("");
std::string::size_type e = str.find('e');