Import copper pour cutouts from Eagle packages (footprints).

Fixes https://gitlab.com/kicad/code/kicad/issues/13503
This commit is contained in:
Jeff Young 2023-01-13 14:40:34 +00:00
parent 7fbad183db
commit f358749b28
2 changed files with 19 additions and 5 deletions

View File

@ -199,7 +199,7 @@ static wxString interpret_text( const wxString& aText )
} }
static void setKeepoutSettingsToZone( ZONE* aZone, int aLayer ) void EAGLE_PLUGIN::setKeepoutSettingsToZone( ZONE* aZone, int aLayer ) const
{ {
if( aLayer == EAGLE_LAYER::TRESTRICT || aLayer == EAGLE_LAYER::BRESTRICT ) if( aLayer == EAGLE_LAYER::TRESTRICT || aLayer == EAGLE_LAYER::BRESTRICT )
{ {
@ -226,6 +226,17 @@ static void setKeepoutSettingsToZone( ZONE* aZone, int aLayer )
aZone->SetLayerSet( LSET::AllCuMask() ); aZone->SetLayerSet( LSET::AllCuMask() );
} }
else // copper pour cutout
{
aZone->SetIsRuleArea( true );
aZone->SetDoNotAllowVias( false );
aZone->SetDoNotAllowTracks( false );
aZone->SetDoNotAllowCopperPour( true );
aZone->SetDoNotAllowPads( false );
aZone->SetDoNotAllowFootprints( false );
aZone->SetLayerSet( kicad_layer( aLayer ) );
}
} }
@ -2279,9 +2290,10 @@ void EAGLE_PLUGIN::packagePolygon( FOOTPRINT* aFootprint, wxXmlNode* aTree ) con
} }
} }
if( p.layer == EAGLE_LAYER::TRESTRICT if( p.pour == EPOLYGON::CUTOUT
|| p.layer == EAGLE_LAYER::BRESTRICT || p.layer == EAGLE_LAYER::TRESTRICT
|| p.layer == EAGLE_LAYER::VRESTRICT ) || p.layer == EAGLE_LAYER::BRESTRICT
|| p.layer == EAGLE_LAYER::VRESTRICT )
{ {
FP_ZONE* zone = new FP_ZONE( aFootprint ); FP_ZONE* zone = new FP_ZONE( aFootprint );
aFootprint->Add( zone, ADD_MODE::APPEND ); aFootprint->Add( zone, ADD_MODE::APPEND );

View File

@ -233,8 +233,10 @@ private:
/// Get Eagle layer number by its name /// Get Eagle layer number by its name
int eagle_layer_id( const wxString& aLayerName ) const; int eagle_layer_id( const wxString& aLayerName ) const;
void setKeepoutSettingsToZone( ZONE* aZone, int aLayer ) const;
/// This PLUGIN only caches one footprint library, this determines which one. /// This PLUGIN only caches one footprint library, this determines which one.
void cacheLib( const wxString& aLibraryPath ); void cacheLib( const wxString& aLibraryPath );
/// get a file's or dir's modification time. /// get a file's or dir's modification time.
static wxDateTime getModificationTime( const wxString& aPath ); static wxDateTime getModificationTime( const wxString& aPath );