Eagle PCB import: disable copper pour for imported *Restrict layer polygons
Fixes: lp:1772245 * https://bugs.launchpad.net/kicad/+bug/1772245
This commit is contained in:
parent
3893c43eb0
commit
190d4d6f55
|
@ -1080,29 +1080,29 @@ ZONE_CONTAINER* EAGLE_PLUGIN::loadPolygon( wxXmlNode* aPolyNode )
|
||||||
EPOLYGON p( aPolyNode );
|
EPOLYGON p( aPolyNode );
|
||||||
PCB_LAYER_ID layer = kicad_layer( p.layer );
|
PCB_LAYER_ID layer = kicad_layer( p.layer );
|
||||||
ZONE_CONTAINER* zone = nullptr;
|
ZONE_CONTAINER* zone = nullptr;
|
||||||
|
bool keepout = ( p.layer == EAGLE_LAYER::TRESTRICT || p.layer == EAGLE_LAYER::BRESTRICT );
|
||||||
|
|
||||||
|
if( !IsCopperLayer( layer ) && !keepout )
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
// Handle copper and keepout layers
|
|
||||||
if( IsCopperLayer( layer )
|
|
||||||
|| p.layer == EAGLE_LAYER::TRESTRICT || p.layer == EAGLE_LAYER::BRESTRICT )
|
|
||||||
{
|
|
||||||
// use a "netcode = 0" type ZONE:
|
// use a "netcode = 0" type ZONE:
|
||||||
zone = new ZONE_CONTAINER( m_board );
|
zone = new ZONE_CONTAINER( m_board );
|
||||||
zone->SetTimeStamp( EagleTimeStamp( aPolyNode ) );
|
zone->SetTimeStamp( EagleTimeStamp( aPolyNode ) );
|
||||||
m_board->Add( zone, ADD_APPEND );
|
m_board->Add( zone, ADD_APPEND );
|
||||||
|
|
||||||
if( p.layer == EAGLE_LAYER::TRESTRICT )
|
if( p.layer == EAGLE_LAYER::TRESTRICT ) // front layer keepout
|
||||||
{
|
|
||||||
zone->SetIsKeepout( true );
|
|
||||||
zone->SetLayer( F_Cu );
|
zone->SetLayer( F_Cu );
|
||||||
}
|
else if( p.layer == EAGLE_LAYER::BRESTRICT ) // bottom layer keepout
|
||||||
else if( p.layer == EAGLE_LAYER::BRESTRICT )
|
zone->SetLayer( B_Cu );
|
||||||
|
else
|
||||||
|
zone->SetLayer( layer );
|
||||||
|
|
||||||
|
if( keepout )
|
||||||
{
|
{
|
||||||
zone->SetIsKeepout( true );
|
zone->SetIsKeepout( true );
|
||||||
zone->SetLayer( B_Cu );
|
zone->SetDoNotAllowVias( true );
|
||||||
}
|
zone->SetDoNotAllowTracks( true );
|
||||||
else
|
zone->SetDoNotAllowCopperPour( true );
|
||||||
{
|
|
||||||
zone->SetLayer( layer );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the first vertex and iterate
|
// Get the first vertex and iterate
|
||||||
|
@ -1202,7 +1202,6 @@ ZONE_CONTAINER* EAGLE_PLUGIN::loadPolygon( wxXmlNode* aPolyNode )
|
||||||
|
|
||||||
int rank = p.rank ? (p.max_priority - *p.rank) : p.max_priority;
|
int rank = p.rank ? (p.max_priority - *p.rank) : p.max_priority;
|
||||||
zone->SetPriority( rank );
|
zone->SetPriority( rank );
|
||||||
}
|
|
||||||
|
|
||||||
return zone;
|
return zone;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue