From 567767346c11474cdd75ba0370f093e540163a7e Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 9 Sep 2021 16:08:51 +0200 Subject: [PATCH] VRML exporter: fix broken export, at least on msys2. For an obscure reason, some floating values were fully broken. the small change in code fixes this strange issue. --- pcbnew/exporters/export_vrml.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pcbnew/exporters/export_vrml.cpp b/pcbnew/exporters/export_vrml.cpp index 1e636c8775..31b6bedaa6 100644 --- a/pcbnew/exporters/export_vrml.cpp +++ b/pcbnew/exporters/export_vrml.cpp @@ -777,7 +777,8 @@ void EXPORTER_PCB_VRML::ExportVrmlFootprint( FOOTPRINT* aFootprint, std::ostream { wxCHECK( aFootprint && aOutputFile, /* void */ ); - auto old_precision = aOutputFile->precision(); + int old_precision = aOutputFile->precision(); + aOutputFile->precision( m_precision ); // Export pad holes for( PAD* pad : aFootprint->Pads() ) @@ -893,11 +894,11 @@ void EXPORTER_PCB_VRML::ExportVrmlFootprint( FOOTPRINT* aFootprint, std::ostream // only write a rotation if it is >= 0.1 deg if( std::abs( rot[3] ) > 0.0001745 ) { - (*aOutputFile) << " rotation " << aOutputFile->precision( 5 ); + (*aOutputFile) << " rotation "; (*aOutputFile) << rot[0] << " " << rot[1] << " " << rot[2] << " " << rot[3] << "\n"; } - (*aOutputFile) << " translation " << aOutputFile->precision( m_precision ); + (*aOutputFile) << " translation "; (*aOutputFile) << trans.x << " "; (*aOutputFile) << trans.y << " "; (*aOutputFile) << trans.z << "\n";