FABMASTER: Try harder to figure out nets

Find all intersecting points both forward and back between the filled
areas and the outlines in order to determine the proper net assignment
for the zones

Also creates rule areas for special zones instead of filled zones

Fixes https://gitlab.com/kicad/code/kicad/issues/7732
This commit is contained in:
Seth Hillbrand 2021-02-26 13:02:45 -08:00
parent b31bf1e40f
commit 2d5015c217
1 changed files with 26 additions and 7 deletions

View File

@ -1795,7 +1795,7 @@ bool FABMASTER::loadZones( BOARD* aBoard )
for( auto& zone : zones ) for( auto& zone : zones )
{ {
if( IsCopperLayer( getLayer( zone->layer ) ) ) if( IsCopperLayer( getLayer( zone->layer ) ) || zone->layer == "ALL" )
loadZone( aBoard, zone ); loadZone( aBoard, zone );
else else
{ {
@ -1856,12 +1856,17 @@ bool FABMASTER::loadZones( BOARD* aBoard )
for( auto& pt1 : outline1.CPoints() ) for( auto& pt1 : outline1.CPoints() )
{ {
if( !outline2.PointOnEdge( pt1, 1 ) )
continue;
/// We're looking for the netcode with the most overlaps to the un-netted zone /// We're looking for the netcode with the most overlaps to the un-netted zone
overlaps[ zone2->GetNetCode() ]++; if( outline2.PointOnEdge( pt1, 1 ) )
break; overlaps[ zone2->GetNetCode() ]++;
}
for( auto& pt2 : outline2.CPoints() )
{
/// The overlap between outline1 and outline2 isn't perfect, so look for overlaps
/// in both directions
if( outline1.PointOnEdge( pt2, 1 ) )
overlaps[ zone2->GetNetCode() ]++;
} }
} }
@ -2509,7 +2514,10 @@ bool FABMASTER::loadZone( BOARD* aBoard, const std::unique_ptr<FABMASTER::TRACE>
if( net_it != netinfo.end() ) if( net_it != netinfo.end() )
zone->SetNet( net_it->second ); zone->SetNet( net_it->second );
zone->SetLayer( layer ); if( aLine->layer == "ALL" )
zone->SetLayerSet( aBoard->GetLayerSet() & LSET::AllCuMask() );
else
zone->SetLayer( layer );
zone->SetIsRuleArea( false ); zone->SetIsRuleArea( false );
zone->SetDoNotAllowTracks( false ); zone->SetDoNotAllowTracks( false );
@ -2518,6 +2526,17 @@ bool FABMASTER::loadZone( BOARD* aBoard, const std::unique_ptr<FABMASTER::TRACE>
zone->SetDoNotAllowFootprints( false ); zone->SetDoNotAllowFootprints( false );
zone->SetDoNotAllowCopperPour( false ); zone->SetDoNotAllowCopperPour( false );
if( aLine->lclass == "ROUTE KEEPOUT")
{
zone->SetIsRuleArea( true );
zone->SetDoNotAllowTracks( true );
}
else if( aLine->lclass == "VIA KEEPOUT")
{
zone->SetIsRuleArea( true );
zone->SetDoNotAllowVias( true );
}
zone->SetPriority( 50 ); zone->SetPriority( 50 );
zone->SetLocalClearance( 0 ); zone->SetLocalClearance( 0 );
zone->SetPadConnection( ZONE_CONNECTION::FULL ); zone->SetPadConnection( ZONE_CONNECTION::FULL );