Changed model offset in file to mm
- Written in mm - Read as mm if newer than 20171114 - Read as inches if older than 20171114 - Added some documentation
This commit is contained in:
parent
b80449b069
commit
3e71ed2421
|
@ -95,9 +95,9 @@ class MODULE_3D_SETTINGS
|
|||
double x, y, z;
|
||||
};
|
||||
|
||||
VECTOR3D m_Scale;
|
||||
VECTOR3D m_Rotation;
|
||||
VECTOR3D m_Offset;
|
||||
VECTOR3D m_Scale; ///< 3D model scaling factor (dimensionless)
|
||||
VECTOR3D m_Rotation; ///< 3D model rotation (degrees)
|
||||
VECTOR3D m_Offset; ///< 3D model offset (mm)
|
||||
wxString m_Filename; ///< The 3D shape filename in 3D library
|
||||
};
|
||||
|
||||
|
|
|
@ -1140,6 +1140,7 @@ void PCB_IO::format( MODULE* aModule, int aNestLevel ) const
|
|||
m_out->Print( aNestLevel+1, "(model %s\n",
|
||||
m_out->Quotew( bs3D->m_Filename ).c_str() );
|
||||
|
||||
// Model offset is in mm
|
||||
m_out->Print( aNestLevel+2, "(at (xyz %s %s %s))\n",
|
||||
Double2Str( bs3D->m_Offset.x ).c_str(),
|
||||
Double2Str( bs3D->m_Offset.y ).c_str(),
|
||||
|
|
|
@ -44,7 +44,8 @@ class NETINFO_MAPPING;
|
|||
//#define SEXPR_BOARD_FILE_VERSION 20160815 // differential pair settings per net class
|
||||
//#define SEXPR_BOARD_FILE_VERSION 20170123 // EDA_TEXT refactor, moved 'hide'
|
||||
//#define SEXPR_BOARD_FILE_VERSION 20170920 // long pad names and custom pad shape
|
||||
#define SEXPR_BOARD_FILE_VERSION 20170922 // Keepout zones can exist on multiple layers
|
||||
//#define SEXPR_BOARD_FILE_VERSION 20170922 // Keepout zones can exist on multiple layers
|
||||
#define SEXPR_BOARD_FILE_VERSION 20171114 // Save 3D model offset in mm, instead of inches
|
||||
|
||||
#define CTL_STD_LAYER_NAMES (1 << 0) ///< Use English Standard layer names
|
||||
#define CTL_OMIT_NETS (1 << 1) ///< Omit pads net names (useless in library)
|
||||
|
|
|
@ -359,9 +359,26 @@ MODULE_3D_SETTINGS* PCB_PARSER::parse3DModel()
|
|||
if( token != T_xyz )
|
||||
Expecting( T_xyz );
|
||||
|
||||
/* Note:
|
||||
* Prior to SEXPR_BOARD_FILE_VERSION 20171114,
|
||||
* 3D model offset was read and written in inches
|
||||
*
|
||||
* Now, the offset is explicitly written in mm.
|
||||
* If a board is read with an older version,
|
||||
* the offset is converted from inches to mm
|
||||
*/
|
||||
|
||||
n3D->m_Offset.x = parseDouble( "x value" );
|
||||
n3D->m_Offset.y = parseDouble( "y value" );
|
||||
n3D->m_Offset.z = parseDouble( "z value" );
|
||||
|
||||
if(m_requiredVersion < 20171114UL)
|
||||
{
|
||||
n3D->m_Offset.x *= 25.4f;
|
||||
n3D->m_Offset.y *= 25.4f;
|
||||
n3D->m_Offset.z *= 25.4f;
|
||||
}
|
||||
|
||||
NeedRIGHT();
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue