From 89381e1103dbbdd00b784e60642deeea53af3539 Mon Sep 17 00:00:00 2001 From: Russell Oliver Date: Mon, 2 Apr 2018 21:49:11 +1000 Subject: [PATCH] Eagle Import: Correct layer set based on cream setting and rotate rectangles Fixes: lp:1758747 * https://bugs.launchpad.net/kicad/+bug/1758747 --- pcbnew/eagle_plugin.cpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/pcbnew/eagle_plugin.cpp b/pcbnew/eagle_plugin.cpp index 5ac8589e90..74041d0d70 100644 --- a/pcbnew/eagle_plugin.cpp +++ b/pcbnew/eagle_plugin.cpp @@ -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.x1 ), kicad_y( r.y2 ) ), outlineIdx ); + if( r.rot ) + { + zone->Rotate( zone->GetPosition(), r.rot->degrees * 10 ); + } // this is not my fault: zone->SetHatch( outline_hatch, zone->GetDefaultHatchPitch(), true ); } @@ -1517,6 +1521,11 @@ void EAGLE_PLUGIN::packageRectangle( MODULE* aModule, wxXmlNode* aTree ) const dwg->SetStart0( start ); 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 ); } - // Solder paste (only for SMD pads) - if( !e.cream || !*e.cream ) // enabled by default - { - pad->SetLocalSolderPasteMargin( Clamp( m_rules->mlMinCreamFrame, - (int)( m_rules->mvCreamFrame * minPadSize ), + pad->SetLocalSolderPasteMargin( Clamp( m_rules->mlMinCreamFrame, + (int) ( m_rules->mvCreamFrame * minPadSize ), 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 ) ); } }