From 6167f5fc753f6755e16e23209d2555481e6cfc72 Mon Sep 17 00:00:00 2001 From: charras Date: Tue, 7 Oct 2008 12:10:24 +0000 Subject: [PATCH] More about copper zones filled without grid (by polygons) - work still in progress --- change_log.txt | 2 +- pcbnew/class_zone.cpp | 8 +++++++- pcbnew/pcbplot.h | 2 ++ pcbnew/plot_rtn.cpp | 5 ++--- pcbnew/plotgerb.cpp | 9 +++++++++ pcbnew/plotps.cpp | 9 +++++++++ 6 files changed, 30 insertions(+), 5 deletions(-) diff --git a/change_log.txt b/change_log.txt index 14ae803f7f..5d5c5bcb4e 100644 --- a/change_log.txt +++ b/change_log.txt @@ -9,7 +9,7 @@ email address. ================================================================================ +pcbnew: More about copper zones filled without grid (by polygons) - Currently for eyes and tests only. + Currently for eyes and tests only (work in progress). now working thermal reliefs. texts on copper zones. diff --git a/pcbnew/class_zone.cpp b/pcbnew/class_zone.cpp index 8051598711..3f7d281d4e 100644 --- a/pcbnew/class_zone.cpp +++ b/pcbnew/class_zone.cpp @@ -392,6 +392,7 @@ void ZONE_CONTAINER::DrawFilledArea( WinEDA_DrawPanel* panel, { static int* CornersBuffer = NULL; static unsigned CornersBufferSize = 0; + bool sketch_mode = false; // true to show areas outlines only (test and debug purposes) if( DC == NULL ) return; @@ -454,7 +455,12 @@ void ZONE_CONTAINER::DrawFilledArea( WinEDA_DrawPanel* panel, corners_count++; if( corner->end_contour ) { // Draw the current filled area - GRPoly( &panel->m_ClipBox, DC, corners_count, CornersBuffer, true, 0, color, color ); + if ( sketch_mode ) + GRClosedPoly( &panel->m_ClipBox, DC, corners_count, CornersBuffer, + false, 0, color, color ); + else + GRPoly( &panel->m_ClipBox, DC, corners_count, CornersBuffer, + true , 0, color, color ); corners_count = 0; ii = 0; } diff --git a/pcbnew/pcbplot.h b/pcbnew/pcbplot.h index 48bf8ba222..7989950884 100644 --- a/pcbnew/pcbplot.h +++ b/pcbnew/pcbplot.h @@ -161,6 +161,8 @@ void PlotMirePcb( MIREPCB* PtMire, int format_plot,int masque_layer ); void Plot_1_EdgeModule(int format_plot, EDGE_MODULE * PtEdge); +void PlotFilledAreas( ZONE_CONTAINER * aZone, int aFormat); + /* PLOTGERB.CPP */ void PlotGERBERLine(wxPoint start, wxPoint end, int width); void PlotCircle_GERBER( wxPoint centre, int rayon, int width); diff --git a/pcbnew/plot_rtn.cpp b/pcbnew/plot_rtn.cpp index 1ba03ba601..0a68c11754 100644 --- a/pcbnew/plot_rtn.cpp +++ b/pcbnew/plot_rtn.cpp @@ -21,7 +21,6 @@ /* Fonctions locales */ static void Plot_Edges_Modules( BOARD* pcb, int format_plot, int masque_layer ); static void PlotTextModule( TEXTE_MODULE* pt_texte ); -static void PlotFilledAreas( ZONE_CONTAINER * aZone, int aFormat); /**********************************************************/ @@ -299,8 +298,8 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( int format_plot, for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ ) { ZONE_CONTAINER* edge_zone = m_Pcb->GetArea(ii); - if( ( (1 << edge_zone->GetLayer()) & masque_layer ) == 0 ) - continue; + if( ( (1 << edge_zone->GetLayer()) & masque_layer ) == 0 ) + continue; PlotFilledAreas(edge_zone, format_plot); } diff --git a/pcbnew/plotgerb.cpp b/pcbnew/plotgerb.cpp index 5920b0db1a..319a4d21d3 100644 --- a/pcbnew/plotgerb.cpp +++ b/pcbnew/plotgerb.cpp @@ -350,6 +350,15 @@ void WinEDA_BasePcbFrame::Plot_Layer_GERBER( FILE* File, int masque_layer, msg.Printf( wxT( "%d" ), nb_items ); Affiche_1_Parametre( this, 72, wxEmptyString, msg, YELLOW ); } + + /* Plot filled ares */ + for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ ) + { + ZONE_CONTAINER* edge_zone = m_Pcb->GetArea(ii); + if( ( (1 << edge_zone->GetLayer()) & masque_layer ) == 0 ) + continue; + PlotFilledAreas(edge_zone, PLOT_FORMAT_GERBER); + } } diff --git a/pcbnew/plotps.cpp b/pcbnew/plotps.cpp index 71df033760..c5161bbebc 100644 --- a/pcbnew/plotps.cpp +++ b/pcbnew/plotps.cpp @@ -425,6 +425,15 @@ void WinEDA_BasePcbFrame::Plot_Layer_PS( FILE* File, int masque_layer, Affiche_1_Parametre( this, 64, wxEmptyString, msg, YELLOW ); } + /* Plot filled ares */ + for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ ) + { + ZONE_CONTAINER* edge_zone = m_Pcb->GetArea(ii); + if( ( (1 << edge_zone->GetLayer()) & masque_layer ) == 0 ) + continue; + PlotFilledAreas(edge_zone, PLOT_FORMAT_POST); + } + // Trace des trous de percage if( modetrace == FILLED ) PrintDrillMark( m_Pcb );