mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
Precision fixes
This commit is contained in:
@@ -17,12 +17,13 @@
|
|||||||
* *
|
* *
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
|
#include <iomanip>
|
||||||
|
|
||||||
#include "../ifcgeom/IfcGeomRenderStyles.h"
|
#include "../ifcgeom/IfcGeomRenderStyles.h"
|
||||||
|
|
||||||
#include "WavefrontObjSerializer.h"
|
#include "WavefrontObjSerializer.h"
|
||||||
|
|
||||||
#include <iomanip>
|
|
||||||
|
|
||||||
bool WaveFrontOBJSerializer::ready() {
|
bool WaveFrontOBJSerializer::ready() {
|
||||||
return obj_stream.is_open() && mtl_stream.is_open();
|
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 << "g " << o->unique_id() << "\n";
|
||||||
obj_stream << "s 1" << "\n";
|
obj_stream << "s 1" << "\n";
|
||||||
|
|
||||||
|
obj_stream << std::setprecision(std::numeric_limits<double>::digits10);
|
||||||
|
|
||||||
const IfcGeom::Representation::Triangulation<double>& mesh = o->geometry();
|
const IfcGeom::Representation::Triangulation<double>& mesh = o->geometry();
|
||||||
|
|
||||||
const int vcount = mesh.verts().size() / 3;
|
const int vcount = mesh.verts().size() / 3;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <locale>
|
#include <locale>
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
|
|
||||||
@@ -327,7 +328,7 @@ private:
|
|||||||
std::string format_double(const double& d) {
|
std::string format_double(const double& d) {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss.imbue(std::locale::classic());
|
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();
|
const std::string str = oss.str();
|
||||||
oss.str("");
|
oss.str("");
|
||||||
std::string::size_type e = str.find('e');
|
std::string::size_type e = str.find('e');
|
||||||
|
|||||||
Reference in New Issue
Block a user