Pcbnew: more about keepout areas: remove keepout for pads option and add keepout for copper zones option.
Export keepout to Specctra DSN file.
This commit is contained in:
parent
018b080001
commit
f20bf0d217
|
@ -49,6 +49,7 @@ comment
|
||||||
company
|
company
|
||||||
connect
|
connect
|
||||||
connect_pads
|
connect_pads
|
||||||
|
copperpour
|
||||||
crossbar
|
crossbar
|
||||||
date
|
date
|
||||||
descr
|
descr
|
||||||
|
|
|
@ -58,10 +58,10 @@ ZONE_CONTAINER::ZONE_CONTAINER( BOARD* aBoard ) :
|
||||||
m_priority = 0;
|
m_priority = 0;
|
||||||
m_smoothedPoly = NULL;
|
m_smoothedPoly = NULL;
|
||||||
m_cornerSmoothingType = ZONE_SETTINGS::SMOOTHING_NONE;
|
m_cornerSmoothingType = ZONE_SETTINGS::SMOOTHING_NONE;
|
||||||
m_isKeepout = false;
|
SetIsKeepout( false );
|
||||||
m_doNotAllowPads = true; // has meaning only if m_isKeepout == true
|
SetDoNotAllowCopperPour( false ); // has meaning only if m_isKeepout == true
|
||||||
m_doNotAllowVias = true; // has meaning only if m_isKeepout == true
|
SetDoNotAllowVias( true ); // has meaning only if m_isKeepout == true
|
||||||
m_doNotAllowTracks = true; // has meaning only if m_isKeepout == true
|
SetDoNotAllowTracks( true ); // has meaning only if m_isKeepout == true
|
||||||
m_cornerRadius = 0;
|
m_cornerRadius = 0;
|
||||||
utility = 0; // flags used in polygon calculations
|
utility = 0; // flags used in polygon calculations
|
||||||
utility2 = 0; // flags used in polygon calculations
|
utility2 = 0; // flags used in polygon calculations
|
||||||
|
@ -92,7 +92,7 @@ ZONE_CONTAINER::ZONE_CONTAINER( const ZONE_CONTAINER& aZone ) :
|
||||||
m_FillSegmList = aZone.m_FillSegmList;
|
m_FillSegmList = aZone.m_FillSegmList;
|
||||||
|
|
||||||
m_isKeepout = aZone.m_isKeepout;
|
m_isKeepout = aZone.m_isKeepout;
|
||||||
m_doNotAllowPads = aZone.m_doNotAllowPads;
|
m_doNotAllowCopperPour = aZone.m_doNotAllowCopperPour;
|
||||||
m_doNotAllowVias = aZone.m_doNotAllowVias;
|
m_doNotAllowVias = aZone.m_doNotAllowVias;
|
||||||
m_doNotAllowTracks = aZone.m_doNotAllowTracks;
|
m_doNotAllowTracks = aZone.m_doNotAllowTracks;
|
||||||
|
|
||||||
|
|
|
@ -539,12 +539,12 @@ public:
|
||||||
* Accessors to parameters used in Keepout zones:
|
* Accessors to parameters used in Keepout zones:
|
||||||
*/
|
*/
|
||||||
bool GetIsKeepout() const { return m_isKeepout; }
|
bool GetIsKeepout() const { return m_isKeepout; }
|
||||||
bool GetDoNotAllowPads() const { return m_doNotAllowPads; }
|
bool GetDoNotAllowCopperPour() const { return m_doNotAllowCopperPour; }
|
||||||
bool GetDoNotAllowVias() const { return m_doNotAllowVias; }
|
bool GetDoNotAllowVias() const { return m_doNotAllowVias; }
|
||||||
bool GetDoNotAllowTracks() const { return m_doNotAllowTracks; }
|
bool GetDoNotAllowTracks() const { return m_doNotAllowTracks; }
|
||||||
|
|
||||||
void SetIsKeepout( bool aEnable ) { m_isKeepout = aEnable; }
|
void SetIsKeepout( bool aEnable ) { m_isKeepout = aEnable; }
|
||||||
void SetDoNotAllowPads( bool aEnable ) { m_doNotAllowPads = aEnable; }
|
void SetDoNotAllowCopperPour( bool aEnable ) { m_doNotAllowCopperPour = aEnable; }
|
||||||
void SetDoNotAllowVias( bool aEnable ) { m_doNotAllowVias = aEnable; }
|
void SetDoNotAllowVias( bool aEnable ) { m_doNotAllowVias = aEnable; }
|
||||||
void SetDoNotAllowTracks( bool aEnable ) { m_doNotAllowTracks = aEnable; }
|
void SetDoNotAllowTracks( bool aEnable ) { m_doNotAllowTracks = aEnable; }
|
||||||
|
|
||||||
|
@ -605,7 +605,7 @@ private:
|
||||||
/* For keepout zones only:
|
/* For keepout zones only:
|
||||||
* what is not allowed inside the keepout ( pads, tracks and vias )
|
* what is not allowed inside the keepout ( pads, tracks and vias )
|
||||||
*/
|
*/
|
||||||
bool m_doNotAllowPads;
|
bool m_doNotAllowCopperPour;
|
||||||
bool m_doNotAllowVias;
|
bool m_doNotAllowVias;
|
||||||
bool m_doNotAllowTracks;
|
bool m_doNotAllowTracks;
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ ZONE_SETTINGS::ZONE_SETTINGS()
|
||||||
m_cornerRadius = 0;
|
m_cornerRadius = 0;
|
||||||
|
|
||||||
SetIsKeepout( false );
|
SetIsKeepout( false );
|
||||||
SetDoNotAllowPads( false );
|
SetDoNotAllowCopperPour( false );
|
||||||
SetDoNotAllowVias( true );
|
SetDoNotAllowVias( true );
|
||||||
SetDoNotAllowTracks( true );
|
SetDoNotAllowTracks( true );
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ ZONE_SETTINGS& ZONE_SETTINGS::operator << ( const ZONE_CONTAINER& aSource )
|
||||||
m_cornerSmoothingType = aSource.GetCornerSmoothingType();
|
m_cornerSmoothingType = aSource.GetCornerSmoothingType();
|
||||||
m_cornerRadius = aSource.GetCornerRadius();
|
m_cornerRadius = aSource.GetCornerRadius();
|
||||||
m_isKeepout = aSource.GetIsKeepout();
|
m_isKeepout = aSource.GetIsKeepout();
|
||||||
m_keepoutDoNotAllowPads = aSource.GetDoNotAllowPads();
|
m_keepoutDoNotAllowCopperPour = aSource.GetDoNotAllowCopperPour();
|
||||||
m_keepoutDoNotAllowVias = aSource.GetDoNotAllowVias();
|
m_keepoutDoNotAllowVias = aSource.GetDoNotAllowVias();
|
||||||
m_keepoutDoNotAllowTracks = aSource.GetDoNotAllowTracks();
|
m_keepoutDoNotAllowTracks = aSource.GetDoNotAllowTracks();
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ void ZONE_SETTINGS::ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport ) c
|
||||||
aTarget.SetCornerSmoothingType( m_cornerSmoothingType );
|
aTarget.SetCornerSmoothingType( m_cornerSmoothingType );
|
||||||
aTarget.SetCornerRadius( m_cornerRadius );
|
aTarget.SetCornerRadius( m_cornerRadius );
|
||||||
aTarget.SetIsKeepout( GetIsKeepout() );
|
aTarget.SetIsKeepout( GetIsKeepout() );
|
||||||
aTarget.SetDoNotAllowPads( GetDoNotAllowPads() );
|
aTarget.SetDoNotAllowCopperPour( GetDoNotAllowCopperPour() );
|
||||||
aTarget.SetDoNotAllowVias( GetDoNotAllowVias() );
|
aTarget.SetDoNotAllowVias( GetDoNotAllowVias() );
|
||||||
aTarget.SetDoNotAllowTracks( GetDoNotAllowTracks() );
|
aTarget.SetDoNotAllowTracks( GetDoNotAllowTracks() );
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ private:
|
||||||
/* For keepout zones only:
|
/* For keepout zones only:
|
||||||
* what is not allowed inside the keepout ( pads, tracks and vias )
|
* what is not allowed inside the keepout ( pads, tracks and vias )
|
||||||
*/
|
*/
|
||||||
bool m_keepoutDoNotAllowPads;
|
bool m_keepoutDoNotAllowCopperPour;
|
||||||
bool m_keepoutDoNotAllowVias;
|
bool m_keepoutDoNotAllowVias;
|
||||||
bool m_keepoutDoNotAllowTracks;
|
bool m_keepoutDoNotAllowTracks;
|
||||||
|
|
||||||
|
@ -115,12 +115,12 @@ public:
|
||||||
* Accessors to parameters used in Keepout zones:
|
* Accessors to parameters used in Keepout zones:
|
||||||
*/
|
*/
|
||||||
const bool GetIsKeepout() const { return m_isKeepout; }
|
const bool GetIsKeepout() const { return m_isKeepout; }
|
||||||
const bool GetDoNotAllowPads() const { return m_keepoutDoNotAllowPads; }
|
const bool GetDoNotAllowCopperPour() const { return m_keepoutDoNotAllowCopperPour; }
|
||||||
const bool GetDoNotAllowVias() const { return m_keepoutDoNotAllowVias; }
|
const bool GetDoNotAllowVias() const { return m_keepoutDoNotAllowVias; }
|
||||||
const bool GetDoNotAllowTracks() const { return m_keepoutDoNotAllowTracks; }
|
const bool GetDoNotAllowTracks() const { return m_keepoutDoNotAllowTracks; }
|
||||||
|
|
||||||
void SetIsKeepout( bool aEnable ) { m_isKeepout = aEnable; }
|
void SetIsKeepout( bool aEnable ) { m_isKeepout = aEnable; }
|
||||||
void SetDoNotAllowPads( bool aEnable ) { m_keepoutDoNotAllowPads = aEnable; }
|
void SetDoNotAllowCopperPour( bool aEnable ) { m_keepoutDoNotAllowCopperPour = aEnable; }
|
||||||
void SetDoNotAllowVias( bool aEnable ) { m_keepoutDoNotAllowVias = aEnable; }
|
void SetDoNotAllowVias( bool aEnable ) { m_keepoutDoNotAllowVias = aEnable; }
|
||||||
void SetDoNotAllowTracks( bool aEnable ) { m_keepoutDoNotAllowTracks = aEnable; }
|
void SetDoNotAllowTracks( bool aEnable ) { m_keepoutDoNotAllowTracks = aEnable; }
|
||||||
};
|
};
|
||||||
|
|
|
@ -175,7 +175,7 @@ void DIALOG_KEEPOUT_AREA_PROPERTIES::initDialog()
|
||||||
// Init keepout parameters:
|
// Init keepout parameters:
|
||||||
m_cbTracksCtrl->SetValue( m_zonesettings.GetDoNotAllowTracks() );
|
m_cbTracksCtrl->SetValue( m_zonesettings.GetDoNotAllowTracks() );
|
||||||
m_cbViasCtrl->SetValue( m_zonesettings.GetDoNotAllowVias() );
|
m_cbViasCtrl->SetValue( m_zonesettings.GetDoNotAllowVias() );
|
||||||
m_cbPadsCtrl->SetValue( m_zonesettings.GetDoNotAllowPads() );
|
m_cbCopperPourCtrl->SetValue( m_zonesettings.GetDoNotAllowCopperPour() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void DIALOG_KEEPOUT_AREA_PROPERTIES::OnCancelClick( wxCommandEvent& event )
|
void DIALOG_KEEPOUT_AREA_PROPERTIES::OnCancelClick( wxCommandEvent& event )
|
||||||
|
@ -208,12 +208,12 @@ bool DIALOG_KEEPOUT_AREA_PROPERTIES::AcceptOptionsForKeepOut()
|
||||||
m_zonesettings.SetIsKeepout( true );
|
m_zonesettings.SetIsKeepout( true );
|
||||||
m_zonesettings.SetDoNotAllowTracks( m_cbTracksCtrl->GetValue() );
|
m_zonesettings.SetDoNotAllowTracks( m_cbTracksCtrl->GetValue() );
|
||||||
m_zonesettings.SetDoNotAllowVias( m_cbViasCtrl->GetValue() );
|
m_zonesettings.SetDoNotAllowVias( m_cbViasCtrl->GetValue() );
|
||||||
m_zonesettings.SetDoNotAllowPads( m_cbPadsCtrl->GetValue() );
|
m_zonesettings.SetDoNotAllowCopperPour( m_cbCopperPourCtrl->GetValue() );
|
||||||
|
|
||||||
// Test for not allowed items: should have at least one item not allowed:
|
// Test for not allowed items: should have at least one item not allowed:
|
||||||
if( ! m_zonesettings.GetDoNotAllowTracks() &&
|
if( ! m_zonesettings.GetDoNotAllowTracks() &&
|
||||||
! m_zonesettings.GetDoNotAllowVias() &&
|
! m_zonesettings.GetDoNotAllowVias() &&
|
||||||
! m_zonesettings.GetDoNotAllowPads() )
|
! m_zonesettings.GetDoNotAllowCopperPour() )
|
||||||
{
|
{
|
||||||
DisplayError( NULL,
|
DisplayError( NULL,
|
||||||
_("Tracks, vias and pads are allowed. The keepout is useless" ) );
|
_("Tracks, vias and pads are allowed. The keepout is useless" ) );
|
||||||
|
|
|
@ -67,8 +67,8 @@ DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::DIALOG_KEEPOUT_AREA_PROPERTIES_BASE( wxWind
|
||||||
m_cbViasCtrl = new wxCheckBox( this, wxID_ANY, _("No Vias"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_cbViasCtrl = new wxCheckBox( this, wxID_ANY, _("No Vias"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
sbSizerCutoutOpts->Add( m_cbViasCtrl, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
sbSizerCutoutOpts->Add( m_cbViasCtrl, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_cbPadsCtrl = new wxCheckBox( this, wxID_ANY, _("No Pads"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_cbCopperPourCtrl = new wxCheckBox( this, wxID_ANY, _("No Copper Pour"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
sbSizerCutoutOpts->Add( m_cbPadsCtrl, 0, wxALL|wxEXPAND, 5 );
|
sbSizerCutoutOpts->Add( m_cbCopperPourCtrl, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
bSizerRight->Add( sbSizerCutoutOpts, 0, wxEXPAND|wxALL, 5 );
|
bSizerRight->Add( sbSizerCutoutOpts, 0, wxEXPAND|wxALL, 5 );
|
||||||
|
|
|
@ -723,7 +723,7 @@
|
||||||
<property name="gripper">0</property>
|
<property name="gripper">0</property>
|
||||||
<property name="hidden">0</property>
|
<property name="hidden">0</property>
|
||||||
<property name="id">wxID_ANY</property>
|
<property name="id">wxID_ANY</property>
|
||||||
<property name="label">No Pads</property>
|
<property name="label">No Copper Pour</property>
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
|
@ -731,7 +731,7 @@
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
<property name="moveable">1</property>
|
<property name="moveable">1</property>
|
||||||
<property name="name">m_cbPadsCtrl</property>
|
<property name="name">m_cbCopperPourCtrl</property>
|
||||||
<property name="pane_border">1</property>
|
<property name="pane_border">1</property>
|
||||||
<property name="pane_position"></property>
|
<property name="pane_position"></property>
|
||||||
<property name="pane_size"></property>
|
<property name="pane_size"></property>
|
||||||
|
|
|
@ -49,7 +49,7 @@ class DIALOG_KEEPOUT_AREA_PROPERTIES_BASE : public DIALOG_SHIM
|
||||||
wxRadioBox* m_OutlineAppearanceCtrl;
|
wxRadioBox* m_OutlineAppearanceCtrl;
|
||||||
wxCheckBox* m_cbTracksCtrl;
|
wxCheckBox* m_cbTracksCtrl;
|
||||||
wxCheckBox* m_cbViasCtrl;
|
wxCheckBox* m_cbViasCtrl;
|
||||||
wxCheckBox* m_cbPadsCtrl;
|
wxCheckBox* m_cbCopperPourCtrl;
|
||||||
wxStaticLine* m_staticline1;
|
wxStaticLine* m_staticline1;
|
||||||
wxStdDialogButtonSizer* m_sdbSizerButtons;
|
wxStdDialogButtonSizer* m_sdbSizerButtons;
|
||||||
wxButton* m_sdbSizerButtonsOK;
|
wxButton* m_sdbSizerButtonsOK;
|
||||||
|
|
|
@ -1011,10 +1011,10 @@ void PCB_IO::format( ZONE_CONTAINER* aZone, int aNestLevel ) const
|
||||||
|
|
||||||
if( aZone->GetIsKeepout() )
|
if( aZone->GetIsKeepout() )
|
||||||
{
|
{
|
||||||
m_out->Print( aNestLevel+1, "(keepout (tracks %s) (vias %s) (pads %s))\n",
|
m_out->Print( aNestLevel+1, "(keepout (tracks %s) (vias %s) (copperpour %s))\n",
|
||||||
aZone->GetDoNotAllowTracks() ? "not_allowed" : "allowed",
|
aZone->GetDoNotAllowTracks() ? "not_allowed" : "allowed",
|
||||||
aZone->GetDoNotAllowVias() ? "not_allowed" : "allowed",
|
aZone->GetDoNotAllowVias() ? "not_allowed" : "allowed",
|
||||||
aZone->GetDoNotAllowPads() ? "not_allowed" : "allowed" );
|
aZone->GetDoNotAllowCopperPour() ? "not_allowed" : "allowed" );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_out->Print( aNestLevel+1, "(fill" );
|
m_out->Print( aNestLevel+1, "(fill" );
|
||||||
|
|
|
@ -2223,10 +2223,10 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER()
|
||||||
data = strtok( NULL, delims );
|
data = strtok( NULL, delims );
|
||||||
zc->SetDoNotAllowVias( data && *data == 'N' );
|
zc->SetDoNotAllowVias( data && *data == 'N' );
|
||||||
}
|
}
|
||||||
else if( !strcmp( data, "pads" ) )
|
else if( !strcmp( data, "copperpour" ) )
|
||||||
{
|
{
|
||||||
data = strtok( NULL, delims );
|
data = strtok( NULL, delims );
|
||||||
zc->SetDoNotAllowPads( data && *data == 'N' );
|
zc->SetDoNotAllowCopperPour( data && *data == 'N' );
|
||||||
}
|
}
|
||||||
|
|
||||||
data = strtok( NULL, delims );
|
data = strtok( NULL, delims );
|
||||||
|
@ -3596,10 +3596,10 @@ void LEGACY_PLUGIN::saveZONE_CONTAINER( const ZONE_CONTAINER* me ) const
|
||||||
|
|
||||||
if( me->GetIsKeepout() )
|
if( me->GetIsKeepout() )
|
||||||
{
|
{
|
||||||
fprintf( m_fp, "ZKeepout tracks %c vias %c pads %c\n",
|
fprintf( m_fp, "ZKeepout tracks %c vias %c copperpour %c\n",
|
||||||
me->GetDoNotAllowTracks() ? 'N' : 'Y',
|
me->GetDoNotAllowTracks() ? 'N' : 'Y',
|
||||||
me->GetDoNotAllowVias() ? 'N' : 'Y',
|
me->GetDoNotAllowVias() ? 'N' : 'Y',
|
||||||
me->GetDoNotAllowPads() ? 'N' : 'Y' );
|
me->GetDoNotAllowCopperPour() ? 'N' : 'Y' );
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf( m_fp, "ZSmoothing %d %s\n",
|
fprintf( m_fp, "ZSmoothing %d %s\n",
|
||||||
|
|
|
@ -2490,16 +2490,16 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER() throw( IO_ERROR, PARSE_ERROR )
|
||||||
zone->SetDoNotAllowVias( token == T_not_allowed );
|
zone->SetDoNotAllowVias( token == T_not_allowed );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_pads:
|
case T_copperpour:
|
||||||
token = NextTok();
|
token = NextTok();
|
||||||
|
|
||||||
if( token != T_allowed && token != T_not_allowed )
|
if( token != T_allowed && token != T_not_allowed )
|
||||||
Expecting( "allowed or not_allowed" );
|
Expecting( "allowed or not_allowed" );
|
||||||
zone->SetDoNotAllowPads( token == T_not_allowed );
|
zone->SetDoNotAllowCopperPour( token == T_not_allowed );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Expecting( "tracks, vias or pads" );
|
Expecting( "tracks, vias or copperpour" );
|
||||||
}
|
}
|
||||||
|
|
||||||
NeedRIGHT();
|
NeedRIGHT();
|
||||||
|
|
|
@ -1135,7 +1135,8 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----<zone containers become planes>--------------------------------
|
//-----<zone containers (not keepout areas) become planes>--------------------------------
|
||||||
|
// Note: only zones are output here, keepout areas be be created later
|
||||||
{
|
{
|
||||||
int netlessZones = 0;
|
int netlessZones = 0;
|
||||||
|
|
||||||
|
@ -1146,6 +1147,9 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IO_ERROR )
|
||||||
{
|
{
|
||||||
ZONE_CONTAINER* item = (ZONE_CONTAINER*) items[i];
|
ZONE_CONTAINER* item = (ZONE_CONTAINER*) items[i];
|
||||||
|
|
||||||
|
if( item->GetIsKeepout() )
|
||||||
|
continue;
|
||||||
|
|
||||||
COPPER_PLANE* plane = new COPPER_PLANE( pcb->structure );
|
COPPER_PLANE* plane = new COPPER_PLANE( pcb->structure );
|
||||||
pcb->structure->planes.push_back( plane );
|
pcb->structure->planes.push_back( plane );
|
||||||
|
|
||||||
|
@ -1214,7 +1218,80 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// keepouts could go here, there are none in Kicad at this time.
|
//-----<zone containers flagged keepout areas become keepout>--------------------------------
|
||||||
|
{
|
||||||
|
static const KICAD_T scanZONEs[] = { PCB_ZONE_AREA_T, EOT };
|
||||||
|
items.Collect( aBoard, scanZONEs );
|
||||||
|
|
||||||
|
for( int i=0; i<items.GetCount(); ++i )
|
||||||
|
{
|
||||||
|
ZONE_CONTAINER* item = (ZONE_CONTAINER*) items[i];
|
||||||
|
|
||||||
|
if( ! item->GetIsKeepout() )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// keepout areas have a type. types are
|
||||||
|
// T_place_keepout, T_via_keepout, T_wire_keepout,
|
||||||
|
// T_bend_keepout, T_elongate_keepout, T_keepout.
|
||||||
|
// Pcbnew knows only T_keepout, T_via_keepout and T_wire_keepout
|
||||||
|
DSN_T keepout_type;
|
||||||
|
|
||||||
|
if( item->GetDoNotAllowVias() && item->GetDoNotAllowTracks() )
|
||||||
|
keepout_type = T_keepout;
|
||||||
|
else if( item->GetDoNotAllowVias() )
|
||||||
|
keepout_type = T_via_keepout;
|
||||||
|
else if( item->GetDoNotAllowTracks() )
|
||||||
|
keepout_type = T_wire_keepout;
|
||||||
|
else
|
||||||
|
keepout_type = T_keepout;
|
||||||
|
|
||||||
|
KEEPOUT* keepout = new KEEPOUT( pcb->structure, keepout_type );
|
||||||
|
pcb->structure->keepouts.push_back( keepout );
|
||||||
|
|
||||||
|
PATH* mainPolygon = new PATH( keepout, T_polygon );
|
||||||
|
keepout->SetShape( mainPolygon );
|
||||||
|
|
||||||
|
mainPolygon->layer_id = layerIds[ kicadLayer2pcb[ item->GetLayer() ] ];
|
||||||
|
|
||||||
|
int count = item->m_Poly->corner.size();
|
||||||
|
int ndx = 0; // used in 2 for() loops below
|
||||||
|
for( ; ndx<count; ++ndx )
|
||||||
|
{
|
||||||
|
wxPoint point( item->m_Poly->corner[ndx].x,
|
||||||
|
item->m_Poly->corner[ndx].y );
|
||||||
|
mainPolygon->AppendPoint( mapPt(point) );
|
||||||
|
|
||||||
|
// this was the end of the main polygon
|
||||||
|
if( item->m_Poly->corner[ndx].end_contour )
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
WINDOW* window = 0;
|
||||||
|
PATH* cutout = 0;
|
||||||
|
|
||||||
|
// handle the cutouts
|
||||||
|
for( ++ndx; ndx<count; ++ndx )
|
||||||
|
{
|
||||||
|
if( item->m_Poly->corner[ndx-1].end_contour )
|
||||||
|
{
|
||||||
|
window = new WINDOW( keepout );
|
||||||
|
keepout->AddWindow( window );
|
||||||
|
|
||||||
|
cutout = new PATH( window, T_polygon );
|
||||||
|
window->SetShape( cutout );
|
||||||
|
|
||||||
|
cutout->layer_id = layerIds[ kicadLayer2pcb[ item->GetLayer() ] ];
|
||||||
|
}
|
||||||
|
|
||||||
|
wxASSERT( window );
|
||||||
|
wxASSERT( cutout );
|
||||||
|
|
||||||
|
wxPoint point(item->m_Poly->corner[ndx].x,
|
||||||
|
item->m_Poly->corner[ndx].y );
|
||||||
|
cutout->AppendPoint( mapPt(point) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//-----<build the images, components, and netlist>-----------------------
|
//-----<build the images, components, and netlist>-----------------------
|
||||||
{
|
{
|
||||||
|
|
|
@ -353,20 +353,20 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add zones outlines having an higher priority
|
// Add zones outlines having an higher priority and keepout
|
||||||
for( int ii = 0; ii < GetBoard()->GetAreaCount(); ii++ )
|
for( int ii = 0; ii < GetBoard()->GetAreaCount(); ii++ )
|
||||||
{
|
{
|
||||||
ZONE_CONTAINER* zone = GetBoard()->GetArea( ii );
|
ZONE_CONTAINER* zone = GetBoard()->GetArea( ii );
|
||||||
if( zone->GetLayer() != GetLayer() )
|
if( zone->GetLayer() != GetLayer() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( zone->GetIsKeepout() )
|
if( !zone->GetIsKeepout() && zone->GetPriority() <= GetPriority() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( zone->GetPriority() <= GetPriority() )
|
if( zone->GetIsKeepout() && ! zone->GetDoNotAllowCopperPour() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// A highter priority zone is found: remove its area
|
// A highter priority zone or keepout area is found: remove its area
|
||||||
item_boundingbox = zone->GetBoundingBox();
|
item_boundingbox = zone->GetBoundingBox();
|
||||||
if( !item_boundingbox.Intersects( zone_boundingbox ) )
|
if( !item_boundingbox.Intersects( zone_boundingbox ) )
|
||||||
continue;
|
continue;
|
||||||
|
@ -377,13 +377,17 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
|
||||||
// the zone will be connected to the current zone, but filled areas
|
// the zone will be connected to the current zone, but filled areas
|
||||||
// will use different parameters (clearance, thermal shapes )
|
// will use different parameters (clearance, thermal shapes )
|
||||||
bool addclearance = GetNet() != zone->GetNet();
|
bool addclearance = GetNet() != zone->GetNet();
|
||||||
|
int clearance = zone_clearance;
|
||||||
|
|
||||||
if( zone->GetIsKeepout() )
|
if( zone->GetIsKeepout() )
|
||||||
addclearance = false;
|
{
|
||||||
|
addclearance = true;
|
||||||
|
clearance = m_ZoneMinThickness / 2;
|
||||||
|
}
|
||||||
|
|
||||||
zone->TransformShapeWithClearanceToPolygon(
|
zone->TransformShapeWithClearanceToPolygon(
|
||||||
cornerBufferPolysToSubstract,
|
cornerBufferPolysToSubstract,
|
||||||
zone_clearance, s_CircleToSegmentsCount,
|
clearance, s_CircleToSegmentsCount,
|
||||||
s_Correction, addclearance );
|
s_Correction, addclearance );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
|
* Copyright (C) 2009 Jean-Pierre Charras <jp.charras@wanadoo.fr>
|
||||||
* Copyright (C) 2007 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2007 KiCad Developers, see change_log.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@ -70,16 +70,16 @@ bool ZONE_CONTAINER::IsSame( const ZONE_CONTAINER& aZoneToCompare )
|
||||||
if( m_Netname != aZoneToCompare.m_Netname )
|
if( m_Netname != aZoneToCompare.m_Netname )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( GetPriority() != aZoneToCompare.GetPriority() )
|
if( GetPriority() != aZoneToCompare.GetPriority() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Compare zone specific parameters
|
// Compare zone specific parameters
|
||||||
if( GetIsKeepout() != aZoneToCompare.GetIsKeepout() )
|
if( GetIsKeepout() != aZoneToCompare.GetIsKeepout() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( GetIsKeepout() )
|
if( GetIsKeepout() )
|
||||||
{
|
{
|
||||||
if( GetDoNotAllowPads() != aZoneToCompare.GetDoNotAllowPads() )
|
if( GetDoNotAllowCopperPour() != aZoneToCompare.GetDoNotAllowCopperPour() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( GetDoNotAllowVias() != aZoneToCompare.GetDoNotAllowVias() )
|
if( GetDoNotAllowVias() != aZoneToCompare.GetDoNotAllowVias() )
|
||||||
|
@ -89,25 +89,25 @@ bool ZONE_CONTAINER::IsSame( const ZONE_CONTAINER& aZoneToCompare )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_ArcToSegmentsCount != aZoneToCompare.m_ArcToSegmentsCount )
|
if( m_ArcToSegmentsCount != aZoneToCompare.m_ArcToSegmentsCount )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( m_ZoneClearance != aZoneToCompare.m_ZoneClearance )
|
if( m_ZoneClearance != aZoneToCompare.m_ZoneClearance )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( m_ZoneMinThickness != aZoneToCompare.m_ZoneMinThickness )
|
if( m_ZoneMinThickness != aZoneToCompare.m_ZoneMinThickness )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( m_FillMode != aZoneToCompare.m_FillMode )
|
if( m_FillMode != aZoneToCompare.m_FillMode )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( m_PadConnection != aZoneToCompare.m_PadConnection )
|
if( m_PadConnection != aZoneToCompare.m_PadConnection )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( m_ThermalReliefGap != aZoneToCompare.m_ThermalReliefGap )
|
if( m_ThermalReliefGap != aZoneToCompare.m_ThermalReliefGap )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( m_ThermalReliefCopperBridge != aZoneToCompare.m_ThermalReliefCopperBridge )
|
if( m_ThermalReliefCopperBridge != aZoneToCompare.m_ThermalReliefCopperBridge )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue