fix incorrect slot orientation and width in export IDF
This commit is contained in:
parent
8d5ee67c9c
commit
a85964b8ad
|
@ -328,10 +328,19 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule,
|
||||||
// screen with a LH coordinate system
|
// screen with a LH coordinate system
|
||||||
double angle = pad->GetOrientation() / 10.0;
|
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 )
|
if( dlength < drill )
|
||||||
{
|
{
|
||||||
std::swap( drill, dlength );
|
std::swap( drill, dlength );
|
||||||
angle += M_PI_2;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
angle += 90.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: KiCad measures a slot's length from end to end
|
// NOTE: KiCad measures a slot's length from end to end
|
||||||
|
|
|
@ -3507,20 +3507,6 @@ bool IDF3_BOARD::AddSlot( double aWidth, double aLength, double aOrientation, do
|
||||||
IDF_POINT c[2]; // centers
|
IDF_POINT c[2]; // centers
|
||||||
IDF_POINT pt[4];
|
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 a1 = aOrientation / 180.0 * M_PI;
|
||||||
double a2 = a1 + M_PI_2;
|
double a2 = a1 + M_PI_2;
|
||||||
double d1 = aLength / 2.0;
|
double d1 = aLength / 2.0;
|
||||||
|
|
Loading…
Reference in New Issue