Commit 4cccb0dd authored by charras's avatar charras
Browse files

First tests about copper zones filled by polygons, without grid (see changelog)

Only for tests! not for production.
parent f95db255
Loading
Loading
Loading
Loading
+14 −1
Original line number Original line Diff line number Diff line
@@ -5,16 +5,29 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.


2008-oct-02 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+pcbnew:
    First tests about copper zones filled without grid (by polygons)
    Currently for eyes and tests only.
    To select this feature choose No Grid in zone grid filling.
    Work in progress:
    currently : not implemented:
        thermal reliefs (pads are always covered by copper zones).
        texts on copper zones.
        Removing insulated copper islands.

2008-Oct-1 UPDATE Dick Hollenbeck <dick@softplc.com>
2008-Oct-1 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
+pcbnew
+pcbnew
    gen_modules_placefile.cpp: backed out of the "Cu & Cmp" centric terminology
    gen_modules_placefile.cpp: backed out of the "Cu & Cmp" centric terminology
    and moved towards using layer names which are BOARD specific.
    and moved towards using layer names which are BOARD specific.



2008-Sep-26 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
2008-Sep-26 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
================================================================================
+pcbnew:
+pcbnew:
    more about use polygons in zone fill algos on techinals layers:
    more about use polygons in zone fill algos on technicals layers:
    plot Ok. holes are handled
    plot Ok. holes are handled


2008-Sep-26 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
2008-Sep-26 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
+2 −2
Original line number Original line Diff line number Diff line
@@ -9,7 +9,7 @@ COMMON_GLOBL wxString g_BuildVersion
#    include "config.h"
#    include "config.h"
     (wxT(KICAD_SVN_VERSION))
     (wxT(KICAD_SVN_VERSION))
#  else
#  else
     (wxT("(20080920)")) /* main program version */
     (wxT("(20081002-unstable)")) /* main program version */
#  endif
#  endif
#endif
#endif
;
;
@@ -20,7 +20,7 @@ COMMON_GLOBL wxString g_BuildAboutVersion
#    include "config.h"
#    include "config.h"
     (wxT(KICAD_ABOUT_VERSION))
     (wxT(KICAD_ABOUT_VERSION))
#  else
#  else
     (wxT("(20080920)")) /* svn date & rev (normally overridden) */
     (wxT("(20081002-unstable)")) /* svn date & rev (normally overridden) */
#  endif
#  endif
#endif
#endif
;
;
+4 −2
Original line number Original line Diff line number Diff line
@@ -139,9 +139,11 @@ set(PCBNEW_SRCS
    via_edit.cpp
    via_edit.cpp
    work.cpp
    work.cpp
    xchgmod.cpp
    xchgmod.cpp
    zone_filling_algorithm.cpp
    zones_by_polygon.cpp
    zones_by_polygon.cpp
    zones_test_and_combine_areas.cpp)
    zones_convert_brd_items_to_polygons.cpp
    zone_filling_algorithm.cpp
    zones_test_and_combine_areas.cpp
    )


set(PCBNEW_EXTRA_SRCS
set(PCBNEW_EXTRA_SRCS
    ../share/drawframe.cpp
    ../share/drawframe.cpp
+16 −1
Original line number Original line Diff line number Diff line
@@ -143,9 +143,24 @@ public:
     * Build m_FilledPolysList data from real outlines (m_Poly)
     * Build m_FilledPolysList data from real outlines (m_Poly)
     * in order to have drawable (and plottable) filled polygons
     * in order to have drawable (and plottable) filled polygons
     * drawable filled polygons are polygons without hole
     * drawable filled polygons are polygons without hole
     * @param aPcb: the current board (can be NULL for non copper zones)
     * @return number of polygons
     * @return number of polygons
     * This function does not add holes for pads and tracks but calls
     * AddClearanceAreasPolygonsToPolysList() to do that for copper layers
     */
     */
    int  BuildFilledPolysListData( void );
    int  BuildFilledPolysListData( BOARD * aPcb );

    /** function AddClearanceAreasPolygonsToPolysList
     * Add non copper areas polygons (pads and tracks with clearence)
     * to a filled copper area
     * used in BuildFilledPolysListData when calculating filled areas in a zone
     * Non copper areas are pads and track and their clearance area
     * The filled copper area must be computed before
     * BuildFilledPolysListData() call this function just after creating the 
     *  filled copper area polygon (without clearence areas
     * @param aPcb: the current board
     */
    void AddClearanceAreasPolygonsToPolysList( BOARD * aPcb );


    /**
    /**
     * Function HitTestForCorner
     * Function HitTestForCorner
+29 −7
Original line number Original line Diff line number Diff line
@@ -48,6 +48,8 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_ZoneFrame, wxDialog )
BEGIN_EVENT_TABLE( WinEDA_ZoneFrame, wxDialog )
BEGIN_EVENT_TABLE( WinEDA_ZoneFrame, wxDialog )


////@begin WinEDA_ZoneFrame event table entries
////@begin WinEDA_ZoneFrame event table entries
    EVT_INIT_DIALOG( WinEDA_ZoneFrame::OnInitDialog )

    EVT_BUTTON( wxID_OK, WinEDA_ZoneFrame::OnOkClick )
    EVT_BUTTON( wxID_OK, WinEDA_ZoneFrame::OnOkClick )


    EVT_BUTTON( wxID_CANCEL, WinEDA_ZoneFrame::OnCancelClick )
    EVT_BUTTON( wxID_CANCEL, WinEDA_ZoneFrame::OnCancelClick )
@@ -133,12 +135,8 @@ bool WinEDA_ZoneFrame::Create( wxWindow* parent,


void WinEDA_ZoneFrame::CreateControls()
void WinEDA_ZoneFrame::CreateControls()
{
{
    BOARD*  board = m_Parent->m_Pcb;

    SetFont( *g_DialogFont );

////@begin WinEDA_ZoneFrame content construction
////@begin WinEDA_ZoneFrame content construction
    // Generated by DialogBlocks, 24/01/2008 11:39:58 (unregistered)
    // Generated by DialogBlocks, 02/10/2008 15:53:10 (unregistered)


    WinEDA_ZoneFrame* itemDialog1 = this;
    WinEDA_ZoneFrame* itemDialog1 = this;


@@ -156,6 +154,7 @@ void WinEDA_ZoneFrame::CreateControls()
    m_GridCtrlStrings.Add(_("0.00000"));
    m_GridCtrlStrings.Add(_("0.00000"));
    m_GridCtrlStrings.Add(_("0.00000"));
    m_GridCtrlStrings.Add(_("0.00000"));
    m_GridCtrlStrings.Add(_("0.00000"));
    m_GridCtrlStrings.Add(_("0.00000"));
    m_GridCtrlStrings.Add(_("No Grid (For tests only!)"));
    m_GridCtrl = new wxRadioBox( itemDialog1, ID_RADIOBOX_GRID_SELECTION, _("Grid Size for Filling:"), wxDefaultPosition, wxDefaultSize, m_GridCtrlStrings, 1, wxRA_SPECIFY_COLS );
    m_GridCtrl = new wxRadioBox( itemDialog1, ID_RADIOBOX_GRID_SELECTION, _("Grid Size for Filling:"), wxDefaultPosition, wxDefaultSize, m_GridCtrlStrings, 1, wxRA_SPECIFY_COLS );
    m_GridCtrl->SetSelection(0);
    m_GridCtrl->SetSelection(0);
    itemBoxSizer4->Add(m_GridCtrl, 0, wxGROW|wxALL, 5);
    itemBoxSizer4->Add(m_GridCtrl, 0, wxGROW|wxALL, 5);
@@ -246,7 +245,19 @@ void WinEDA_ZoneFrame::CreateControls()
    m_NetSortingOption->SetValidator( wxGenericValidator(& m_NetSorting) );
    m_NetSortingOption->SetValidator( wxGenericValidator(& m_NetSorting) );
////@end WinEDA_ZoneFrame content construction
////@end WinEDA_ZoneFrame content construction


    // Initialise options
}


/*!
 * wxEVT_INIT_DIALOG event handler for ID_DIALOG
 */
// Initialise dialog options
void WinEDA_ZoneFrame::OnInitDialog( wxInitDialogEvent& event )
{
    BOARD*  board = m_Parent->m_Pcb;

    SetFont( *g_DialogFont );

    wxString title = _( "Zone clearance value:" ) + ReturnUnitSymbol( g_UnitMetric );
    wxString title = _( "Zone clearance value:" ) + ReturnUnitSymbol( g_UnitMetric );
    m_ClearanceValueTitle->SetLabel( title );
    m_ClearanceValueTitle->SetLabel( title );


@@ -266,7 +277,7 @@ void WinEDA_ZoneFrame::CreateControls()
    static const int GridList[4] = { 25, 50, 100, 250 };
    static const int GridList[4] = { 25, 50, 100, 250 };
    int selection = 0;
    int selection = 0;


    for( unsigned ii = 0; ii < (unsigned) m_GridCtrl->GetCount(); ii++ )
    for( unsigned ii = 0; ii < 4; ii++ )
    {
    {
        wxString msg = ReturnStringFromValue( g_UnitMetric,
        wxString msg = ReturnStringFromValue( g_UnitMetric,
                                              GridList[ii],
                                              GridList[ii],
@@ -409,6 +420,10 @@ void WinEDA_ZoneFrame::CreateControls()
            }
            }
        }
        }
    }
    }
    if (GetSizer())
    {
        GetSizer()->SetSizeHints(this);
    }
}
}




@@ -520,6 +535,11 @@ bool WinEDA_ZoneFrame::AcceptOptions(bool aPromptForErrors)
    case 3:
    case 3:
        g_GridRoutingSize = 250;
        g_GridRoutingSize = 250;
        break;
        break;
    case 4:
        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;
    }
    }


    wxString txtvalue = m_ZoneClearanceCtrl->GetValue();
    wxString txtvalue = m_ZoneClearanceCtrl->GetValue();
@@ -607,3 +627,5 @@ void WinEDA_ZoneFrame::OnOkClick( wxCommandEvent& event )
        EndModal( ZONE_OK );
        EndModal( ZONE_OK );
}
}



Loading