Eagle Import: Correct layer set based on cream setting and rotate rectangles

Fixes: lp:1758747
* https://bugs.launchpad.net/kicad/+bug/1758747
This commit is contained in:
Russell Oliver 2018-04-02 21:49:11 +10:00 committed by Seth Hillbrand
parent ee05b1c92e
commit 89381e1103
1 changed files with 19 additions and 5 deletions

View File

@ -648,6 +648,10 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics )
zone->AppendCorner( wxPoint( kicad_x( r.x2 ), kicad_y( r.y2 ) ), outlineIdx ); zone->AppendCorner( wxPoint( kicad_x( r.x2 ), kicad_y( r.y2 ) ), outlineIdx );
zone->AppendCorner( wxPoint( kicad_x( r.x1 ), kicad_y( r.y2 ) ), outlineIdx ); zone->AppendCorner( wxPoint( kicad_x( r.x1 ), kicad_y( r.y2 ) ), outlineIdx );
if( r.rot )
{
zone->Rotate( zone->GetPosition(), r.rot->degrees * 10 );
}
// this is not my fault: // this is not my fault:
zone->SetHatch( outline_hatch, zone->GetDefaultHatchPitch(), true ); zone->SetHatch( outline_hatch, zone->GetDefaultHatchPitch(), true );
} }
@ -1517,6 +1521,11 @@ void EAGLE_PLUGIN::packageRectangle( MODULE* aModule, wxXmlNode* aTree ) const
dwg->SetStart0( start ); dwg->SetStart0( start );
dwg->SetEnd0( end ); dwg->SetEnd0( end );
if( r.rot )
{
dwg->Rotate( dwg->GetCenter(), r.rot->degrees * 10 );
}
} }
@ -1725,12 +1734,17 @@ void EAGLE_PLUGIN::packageSMD( MODULE* aModule, wxXmlNode* aTree ) const
pad->SetOrientation( e.rot->degrees * 10 ); pad->SetOrientation( e.rot->degrees * 10 );
} }
// Solder paste (only for SMD pads) pad->SetLocalSolderPasteMargin( Clamp( m_rules->mlMinCreamFrame,
if( !e.cream || !*e.cream ) // enabled by default (int) ( m_rules->mvCreamFrame * minPadSize ),
{
pad->SetLocalSolderPasteMargin( Clamp( m_rules->mlMinCreamFrame,
(int)( m_rules->mvCreamFrame * minPadSize ),
m_rules->mlMaxCreamFrame ) ); m_rules->mlMaxCreamFrame ) );
// Solder paste (only for SMD pads)
if( e.cream && *e.cream == false ) // enabled by default
{
if( layer == F_Cu )
pad->SetLayerSet( pad->GetLayerSet().set( F_Paste, false ) );
else if( layer == B_Cu )
pad->SetLayerSet( pad->GetLayerSet().set( B_Paste, false ) );
} }
} }