mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Precision fixes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user