Commit 3683ab74 authored by charras's avatar charras

More about copper zones filled without grid (by polygons)

parent 7d1170c4
......@@ -5,6 +5,20 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2008-oct-07 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+pcbnew:
More about copper zones filled without grid (by polygons)
Currently for eyes and tests only.
now working
thermal reliefs.
texts on copper zones.
To select this feature choose No Grid in zone grid filling.
Work in progress:
currently : not implemented:
Removing insulated copper islands.
trapezoidal pads
2008-Oct-6 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
......
No preview for this file type
This diff is collapsed.
......@@ -136,6 +136,11 @@ bool ZONE_CONTAINER::Save( FILE* aFile ) const
if( ret < 2 )
return false;
ret = fprintf( aFile, "ZOptions %d\n", m_GridFillValue);
if( ret < 1 )
return false;
// Save the corner list
for( item_pos = 0; item_pos < corners_count; item_pos++ )
{
......@@ -246,7 +251,17 @@ int ZONE_CONTAINER::ReadDescr( FILE* aFile, int* aLineNum )
}
}
}
if( strnicmp( Line, "ZClearance", 10 ) == 0 ) // aux info found
if( strnicmp( Line, "ZOptions", 8 ) == 0 ) // Options info found
{
int gridsize = 50;
text = Line + 8;
ret = sscanf( text, "%d", &gridsize );
if( ret < 1 )
return false;
else
m_GridFillValue = gridsize;
}
if( strnicmp( Line, "ZClearance", 10 ) == 0 ) // Clearence and pad options info found
{
int clearance = 200;
char padoption;
......@@ -738,6 +753,12 @@ void ZONE_CONTAINER::Display_Infos( WinEDA_DrawFrame* frame )
msg.Printf( wxT( "%d" ), m_Poly->corner.size() );
Affiche_1_Parametre( frame, text_pos, _( "Corners" ), msg, BLUE );
text_pos += 8;
if ( m_GridFillValue )
msg.Printf( wxT( "%d" ), m_GridFillValue );
else msg = _("No Grid");
Affiche_1_Parametre( frame, text_pos, _( "Fill Grid" ), msg, BROWN );
text_pos += 8;
msg.Printf( wxT( "%d" ), m_Poly->m_HatchLines.size() );
Affiche_1_Parametre( frame, text_pos, _( "Hatch lines" ), msg, BLUE );
......
......@@ -257,6 +257,8 @@ void WinEDA_ZoneFrame::OnInitDialog( wxInitDialogEvent& event )
BOARD* board = m_Parent->m_Pcb;
SetFont( *g_DialogFont );
SetFocus(); // Required under wxGTK if we want to demiss the dialog with the ESC key
wxString title = _( "Zone clearance value:" ) + ReturnUnitSymbol( g_UnitMetric );
m_ClearanceValueTitle->SetLabel( title );
......@@ -277,16 +279,23 @@ void WinEDA_ZoneFrame::OnInitDialog( wxInitDialogEvent& event )
static const int GridList[4] = { 25, 50, 100, 250 };
int selection = 0;
int grid_routing = g_GridRoutingSize;
if( m_Zone_Container )
grid_routing = m_Zone_Container->m_GridFillValue;
for( unsigned ii = 0; ii < 4; ii++ )
{
wxString msg = ReturnStringFromValue( g_UnitMetric,
GridList[ii],
m_Parent->m_InternalUnits );
m_GridCtrl->SetString( ii, msg );
if( g_GridRoutingSize == GridList[ii] )
if( grid_routing == GridList[ii] )
selection = ii;
}
if( grid_routing == 0 ) // No Grid: fill with polygons
selection = 4;
m_GridCtrl->SetSelection( selection );
if( m_Zone_Container )
......@@ -536,9 +545,9 @@ bool WinEDA_ZoneFrame::AcceptOptions(bool aPromptForErrors)
g_GridRoutingSize = 250;
break;
case 4:
g_GridRoutingSize = 0;
wxMessageBox( wxT(
"You are using No grid for filling zones\nThis is currently in development and for tests only.\n Do not use for production"));
g_GridRoutingSize = 0;
break;
}
......
......@@ -42,6 +42,9 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
wxString msg;
BOARD* Pcb = frame->m_Pcb;
if( g_GridRoutingSize < 25 )
g_GridRoutingSize = 25;
// Set the g_DesignSettings.m_TrackClearence (used to fill board map) to the max of m_TrackClearence and m_ZoneClearence
g_DesignSettings.m_TrackClearence = max ( g_DesignSettings.m_TrackClearence, g_DesignSettings.m_ZoneClearence);
......@@ -59,8 +62,6 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
// calculate the fixed step of the routing matrix as 25 mils or more
E_scale = g_GridRoutingSize / 25;
if( g_GridRoutingSize < 1 )
g_GridRoutingSize = 1;
// calculate the Ncols and Nrows, size of the routing matrix
ComputeMatriceSize( frame, g_GridRoutingSize );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment