Fix issues with importing NPTH pads from CircuitStudio.
Fixes https://gitlab.com/kicad/code/kicad/issues/10493
This commit is contained in:
parent
535ecb9b7b
commit
118a37f19f
|
@ -2463,23 +2463,23 @@ void ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper( FOOTPRINT* aFootprint, con
|
|||
|
||||
slotRotation.Normalize();
|
||||
|
||||
if( slotRotation == ANGLE_0 || slotRotation == ANGLE_180 )
|
||||
if( slotRotation.IsHorizontal() )
|
||||
{
|
||||
pad->SetDrillSize( wxSize( aElem.sizeAndShape->slotsize, aElem.holesize ) );
|
||||
}
|
||||
else if( slotRotation.IsVertical() )
|
||||
{
|
||||
pad->SetDrillSize( wxSize( aElem.holesize, aElem.sizeAndShape->slotsize ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( slotRotation != ANGLE_90 && slotRotation != ANGLE_270 )
|
||||
{
|
||||
wxLogWarning( _( "Footprint %s pad %s has a hole-rotation of %f "
|
||||
"degrees. KiCad only supports 90 degree rotations." ),
|
||||
wxLogWarning( _( "Footprint %s pad %s has a hole-rotation of %f degrees. "
|
||||
"KiCad only supports 90 degree rotations." ),
|
||||
aFootprint->GetReference(),
|
||||
aElem.name,
|
||||
slotRotation.AsDegrees() );
|
||||
}
|
||||
|
||||
pad->SetDrillSize( wxSize( aElem.holesize, aElem.sizeAndShape->slotsize ) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2497,10 +2497,8 @@ void ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper( FOOTPRINT* aFootprint, con
|
|||
}
|
||||
|
||||
if( aElem.sizeAndShape )
|
||||
{
|
||||
pad->SetOffset( aElem.sizeAndShape->holeoffset[0] );
|
||||
}
|
||||
}
|
||||
|
||||
if( aElem.padmode != ALTIUM_PAD_MODE::SIMPLE )
|
||||
{
|
||||
|
@ -2530,6 +2528,7 @@ void ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper( FOOTPRINT* aFootprint, con
|
|||
{
|
||||
pad->SetShape( PAD_SHAPE::OVAL );
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case ALTIUM_PAD_SHAPE::OCTAGONAL:
|
||||
|
@ -2545,6 +2544,14 @@ void ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper( FOOTPRINT* aFootprint, con
|
|||
break;
|
||||
}
|
||||
|
||||
if( pad->GetAttribute() == PAD_ATTRIB::NPTH && pad->GetDrillSizeX() )
|
||||
{
|
||||
// KiCad likes NPTH pads to be the same size & shape as their holes
|
||||
pad->SetShape( pad->GetDrillShape() == PAD_DRILL_SHAPE_CIRCLE ? PAD_SHAPE::CIRCLE
|
||||
: PAD_SHAPE::OVAL );
|
||||
pad->SetSize( pad->GetDrillSize() );
|
||||
}
|
||||
|
||||
switch( aElem.layer )
|
||||
{
|
||||
case ALTIUM_LAYER::TOP_LAYER:
|
||||
|
|
Loading…
Reference in New Issue