When exporting meshes with assimp
through code as shown below I receive very limited precision output. Is there a way in assimp
to increase export precision? (Nothing hints at this in the documentation.)
void export(aiScene* scene, const std::string & outputFile)
{
Assimp::Exporter exporter;
// exporter.mOutput.precision(16); ???
exporter.Export(scene, "obj", outputFile);
}
Output in the .obj
file will contain no more than 6 digits per value:
v 557760 4.07449e+06 -49.1995
v 557760 4.07449e+06 -49.095
v 557760 4.0745e+06 -49.0082
v 557760 4.0745e+06 -49.1127
When looking at the actual exporter class (ObjExporter.cpp
) all data is written through a public stringstream
:
public:
std::ostringstream mOutput, mOutputMat;
[...]
mOutput << "# " << vp.size() << " vertex positions" << endl;
for(const aiVector3D& v : vp) {
mOutput << "v " << v.x << " " << v.y << " " << v.z << endl;
}
mOutput << endl;
Is there a way I could increase the stringstream
precision (http://www.cplusplus.com/reference/ios/ios_base/precision/) without having to change the assimp
source?