fix incorrect slot orientation and width in export IDF

This commit is contained in:
unknown 2015-07-04 18:32:37 +02:00 committed by jean-pierre charras
parent 8d5ee67c9c
commit a85964b8ad
2 changed files with 10 additions and 15 deletions

View File

@ -328,10 +328,19 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule,
// screen with a LH coordinate system
double angle = pad->GetOrientation() / 10.0;
// NOTE: Since this code assumes the scenario where
// GetDrillSize().y is the length but idf_parser.cpp
// assumes a length along the X axis, the orientation
// must be shifted +90 deg when GetDrillSize().y is
// the major axis.
if( dlength < drill )
{
std::swap( drill, dlength );
angle += M_PI_2;
}
else
{
angle += 90.0;
}
// NOTE: KiCad measures a slot's length from end to end

View File

@ -3507,20 +3507,6 @@ bool IDF3_BOARD::AddSlot( double aWidth, double aLength, double aOrientation, do
IDF_POINT c[2]; // centers
IDF_POINT pt[4];
// make sure the user isn't giving us dud information
if( aLength < aWidth )
std::swap( aLength, aWidth );
if( aLength == aWidth )
{
ostringstream ostr;
ostr << __FILE__ << ":" << __LINE__ << ":" << __FUNCTION__ << "():\n";
ostr << "* slot length must not equal width";
errormsg = ostr.str();
return false;
}
double a1 = aOrientation / 180.0 * M_PI;
double a2 = a1 + M_PI_2;
double d1 = aLength / 2.0;