Pcbnew plugin: 3d models stop writing 'at' keyword

Previously it wrote 'at' if all values were zero to avoid file changes.
Now write 'offset' in mm in all cases. Still read 'at' values in inches.

Fixes https://gitlab.com/kicad/code/kicad/issues/4316
This commit is contained in:
Michael Kavanagh 2020-07-24 13:01:30 +01:00 committed by Seth Hillbrand
parent a5fbbaa548
commit b3f638caaf
1 changed files with 1 additions and 19 deletions

View File

@ -1041,25 +1041,7 @@ void PCB_IO::format( MODULE* aModule, int aNestLevel ) const
if( bs3D->m_Opacity != 1.0 )
m_out->Print( aNestLevel+2, "(opacity %0.4f)", bs3D->m_Opacity );
/* Write 3D model offset in mm
* 4.0.x wrote "at" which was actually in inches
* 5.0.x onwards, 3D model offset is written using "offset"
*
* If the offset is all zero, write "at" (fewer file changes)
* Otherwise, write "offset"
*/
wxString offsetTag = "offset";
if( bs3D->m_Offset.x == 0 &&
bs3D->m_Offset.y == 0 &&
bs3D->m_Offset.z == 0 )
{
offsetTag = "at";
}
m_out->Print( aNestLevel+2, "(%s (xyz %s %s %s))\n",
offsetTag.ToStdString().c_str(),
m_out->Print( aNestLevel+2, "(offset (xyz %s %s %s))\n",
Double2Str( bs3D->m_Offset.x ).c_str(),
Double2Str( bs3D->m_Offset.y ).c_str(),
Double2Str( bs3D->m_Offset.z ).c_str() );