← Back to team overview

kicad-developers team mailing list archive

[RFC] Experimental grid pattern in zone fill

 

I wrote a purely experimental option to fill zones (copper and not copper) with a grid patter.
It is only an experimental feature made mainly to know what issues can be created by this feature.

The main issue is the fact polygons have much more corners, thus creating a longer calculation time.
(However, grid pattern is expected to be used in specific cases)

It should be compatible with the current DRC.

Regards

-- 
Jean-Pierre CHARRAS
From 043aec266e99226ee3dba225ddaea6fc960d4075 Mon Sep 17 00:00:00 2001
From: jean-pierre charras <jp.charras@xxxxxxxxxx>
Date: Sun, 18 Feb 2018 10:09:13 +0100
Subject: [PATCH] allow grid pattern in filled zones

---
 common/pcb.keywords                                |   3 +
 pcbnew/class_zone.cpp                              |   6 +-
 pcbnew/class_zone.h                                |  14 +-
 pcbnew/dialogs/dialog_copper_zones.cpp             |  51 +-
 pcbnew/dialogs/dialog_copper_zones_base.cpp        | 105 ++--
 pcbnew/dialogs/dialog_copper_zones_base.fbp        | 420 ++++++++++++++--
 pcbnew/dialogs/dialog_copper_zones_base.h          |  67 ++-
 .../dialogs/dialog_non_copper_zones_properties.cpp |  28 +-
 .../dialog_non_copper_zones_properties_base.cpp    |  40 +-
 .../dialog_non_copper_zones_properties_base.fbp    | 534 ++++++++++++++++++++-
 .../dialog_non_copper_zones_properties_base.h      |  16 +-
 pcbnew/kicad_plugin.cpp                            |  15 +-
 pcbnew/pcb_parser.cpp                              |  24 +-
 pcbnew/zone_filler.cpp                             |  77 ++-
 pcbnew/zone_filler.h                               |   9 +
 pcbnew/zone_settings.cpp                           |   6 +
 pcbnew/zone_settings.h                             |   8 +-
 pcbnew/zones_by_polygon.cpp                        |   3 +-
 18 files changed, 1282 insertions(+), 144 deletions(-)

diff --git a/common/pcb.keywords b/common/pcb.keywords
index 1998f9a..edf1fa8 100644
--- a/common/pcb.keywords
+++ b/common/pcb.keywords
@@ -85,6 +85,7 @@ fp_text
 full
 general
 grid_origin
+grid_pattern
 gr_arc
 gr_circle
 gr_curve
@@ -134,6 +135,8 @@ pad_to_paste_clearance
 pad_to_paste_clearance_ratio
 page
 path
+pattern_thickness
+pattern_gap
 pcb_text_size
 pcb_text_width
 pcbplotparams
diff --git a/pcbnew/class_zone.cpp b/pcbnew/class_zone.cpp
index 13b01e5..1647d2d 100644
--- a/pcbnew/class_zone.cpp
+++ b/pcbnew/class_zone.cpp
@@ -55,6 +55,8 @@ ZONE_CONTAINER::ZONE_CONTAINER( BOARD* aBoard ) :
     m_CornerSelection = nullptr;                // no corner is selected
     m_IsFilled = false;                         // fill status : true when the zone is filled
     m_FillMode = ZFM_POLYGONS;
+    m_ZoneGridPatternThickness = 0;
+    m_ZoneGridPatternGap = 0;
     m_priority = 0;
     m_cornerSmoothingType = ZONE_SETTINGS::SMOOTHING_NONE;
     SetIsKeepout( false );
@@ -488,12 +490,12 @@ void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel,
         }
 
         // Draw areas:
-        if( m_FillMode == ZFM_POLYGONS && !outline_mode )
+        if( m_FillMode != ZFM_SEGMENTS && !outline_mode )
             GRPoly( panel->GetClipBox(), DC, CornersBuffer.size(), &CornersBuffer[0],
                     true, 0, color, color );
     }
 
-    if( m_FillMode == 1  && !outline_mode )     // filled with segments
+    if( m_FillMode == ZFM_SEGMENTS && !outline_mode )     // filled with segments
     {
         for( unsigned ic = 0; ic < m_FillSegmList.size(); ic++ )
         {
diff --git a/pcbnew/class_zone.h b/pcbnew/class_zone.h
index b950245..505993a 100644
--- a/pcbnew/class_zone.h
+++ b/pcbnew/class_zone.h
@@ -198,6 +198,12 @@ public:
     int GetMinThickness() const { return m_ZoneMinThickness; }
     void SetMinThickness( int aMinThickness ) { m_ZoneMinThickness = aMinThickness; }
 
+    int GetGridPatternThickness() const { return m_ZoneGridPatternThickness; }
+    void SetGridPatternThickness( int aThickness ) { m_ZoneGridPatternThickness = aThickness; }
+
+    int GetGridPatternGap() const { return m_ZoneGridPatternGap; }
+    void SetGridPatternGap( int aStep ) { m_ZoneGridPatternGap = aStep; }
+
     int GetSelectedCorner() const
     {
         // Transform relative indices to global index
@@ -711,9 +717,15 @@ private:
     int                   m_ThermalReliefCopperBridge;
 
 
-    /// How to fill areas: ZFM_POLYGONS => use filled polygons, ZFM_SEGMENTS => fill with segments.
+    /// How to fill areas: ZFM_POLYGONS => use solid polygons, ZFM_SEGMENTS => fill by segments.
     ZONE_FILL_MODE        m_FillMode;
 
+    /// Grid style shape: thickness of lines (if 0 -> solid shape)
+    int m_ZoneGridPatternThickness;
+
+    /// Grid style shape: dist between center of lines (grid size) (0 -> solid shape)
+    int m_ZoneGridPatternGap;
+
     /// The index of the corner being moved or nullptr if no corner is selected.
     SHAPE_POLY_SET::VERTEX_INDEX* m_CornerSelection;
 
diff --git a/pcbnew/dialogs/dialog_copper_zones.cpp b/pcbnew/dialogs/dialog_copper_zones.cpp
index db10961..fa3c000 100644
--- a/pcbnew/dialogs/dialog_copper_zones.cpp
+++ b/pcbnew/dialogs/dialog_copper_zones.cpp
@@ -103,6 +103,7 @@ private:
     void ExportSetupToOtherCopperZones( wxCommandEvent& event ) override;
     void OnPadsInZoneClick( wxCommandEvent& event ) override;
     void OnRunFiltersButtonClick( wxCommandEvent& event ) override;
+	void OnStyleSelection( wxCommandEvent& event ) override;
 
     void buildAvailableListOfNets();
 
@@ -177,7 +178,11 @@ void DIALOG_COPPER_ZONE::initDialog()
     if( m_settings.m_Zone_45_Only )
         m_OrientEdgesOpt->SetSelection( 1 );
 
-    m_FillModeCtrl->SetSelection( m_settings.m_FillMode == ZFM_SEGMENTS ? 1 : 0 );
+    m_GridStyleCtrl->SetSelection( m_settings.m_FillMode == ZFM_GRID_PATTERN ? 1 : 0 );
+    msg = StringFromValue( g_UserUnit, m_settings.m_ZoneGridPatternThickness );
+    m_tcGridStyleThickness->SetValue( msg );
+    msg = StringFromValue( g_UserUnit, m_settings.m_ZoneGridPatternGap );
+    m_tcGridStyleSize->SetValue( msg );
 
     AddUnitSymbol( *m_ClearanceValueTitle, g_UserUnit );
     msg = StringFromValue( g_UserUnit, m_settings.m_ZoneClearance );
@@ -302,8 +307,10 @@ void DIALOG_COPPER_ZONE::initDialog()
     m_DoNotShowNetNameFilter->SetValue( netNameDoNotShowFilter );
     buildAvailableListOfNets();
 
+    // Enable/Disable some widgets
     wxCommandEvent event;
     OnCornerSmoothingModeChoice( event );
+    OnStyleSelection( event );
 }
 
 
@@ -317,6 +324,7 @@ void DIALOG_COPPER_ZONE::OnButtonCancelClick( wxCommandEvent& event )
     Close( true );
 }
 
+
 void DIALOG_COPPER_ZONE::OnButtonOkClick( wxCommandEvent& event )
 {
     m_netNameShowFilter = m_ShowNetNameFilter->GetValue();
@@ -339,8 +347,18 @@ void DIALOG_COPPER_ZONE::OnClose( wxCloseEvent& event )
 }
 
 
+void DIALOG_COPPER_ZONE::OnStyleSelection( wxCommandEvent& event )
+{
+    bool enable = m_GridStyleCtrl->GetSelection() == 1;
+    m_tcGridStyleThickness->Enable( enable );
+    m_tcGridStyleSize->Enable( enable );
+}
+
+
 bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportableSetupOnly )
 {
+    wxString msg;
+
     switch( m_PadInZoneOpt->GetSelection() )
     {
     case 3:
@@ -392,18 +410,23 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportab
     }
 
     m_netNameShowFilter = m_ShowNetNameFilter->GetValue();
-    m_settings.m_FillMode = (m_FillModeCtrl->GetSelection() == 0) ? ZFM_POLYGONS : ZFM_SEGMENTS;
+    m_settings.m_FillMode = (m_GridStyleCtrl->GetSelection() == 0) ? ZFM_POLYGONS : ZFM_GRID_PATTERN;
 
     wxString txtvalue = m_ZoneClearanceCtrl->GetValue();
     m_settings.m_ZoneClearance = ValueFromString( g_UserUnit, txtvalue );
 
+    txtvalue = m_tcGridStyleThickness->GetValue();
+    m_settings.m_ZoneGridPatternThickness = ValueFromString( g_UserUnit, txtvalue );
+
+    txtvalue = m_tcGridStyleSize->GetValue();
+    m_settings.m_ZoneGridPatternGap = ValueFromString( g_UserUnit, txtvalue );
+
     // Test if this is a reasonable value for this parameter
     // A too large value can hang Pcbnew
     #define CLEARANCE_MAX_VALUE ZONE_CLEARANCE_MAX_VALUE_MIL*IU_PER_MILS
 
     if( m_settings.m_ZoneClearance > CLEARANCE_MAX_VALUE )
     {
-        wxString msg;
         msg.Printf( _( "Clearance must be smaller than %f\" / %f mm." ),
             ZONE_CLEARANCE_MAX_VALUE_MIL / 1000.0, ZONE_CLEARANCE_MAX_VALUE_MIL * 0.0254 );
         DisplayError( this, msg );
@@ -415,13 +438,33 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportab
 
     if( m_settings.m_ZoneMinThickness < (ZONE_THICKNESS_MIN_VALUE_MIL*IU_PER_MILS) )
     {
-        wxString msg;
         msg.Printf( _( "Minimum width must be larger than %f\" / %f mm." ),
             ZONE_THICKNESS_MIN_VALUE_MIL / 1000.0, ZONE_THICKNESS_MIN_VALUE_MIL * 0.0254 );
         DisplayError( this, msg );
         return false;
     }
 
+    // For grid pattern fill option, ensure grid pattern parameters are valid
+    if( m_settings.m_FillMode == ZFM_GRID_PATTERN )
+    {
+        if( m_settings.m_ZoneGridPatternThickness <= m_settings.m_ZoneMinThickness )
+        {
+            DisplayError( this, _( "Pattern thickness must be > zone min thickness" ) );
+            return false;
+        }
+
+        // perhaps not mandatory, but this is a reasonable constraint
+        if( m_settings.m_ZoneGridPatternGap <= m_settings.m_ZoneMinThickness )
+        {
+            DisplayError( this, _( "Pattern gap must be > zone min thickness" ) );
+            return false;
+        }
+    }
+
+    txtvalue = m_tcGridStyleSize->GetValue();
+    m_settings.m_ZoneGridPatternGap = ValueFromString( g_UserUnit, txtvalue );
+
+
     m_settings.SetCornerSmoothingType( m_cornerSmoothingChoice->GetSelection() );
     txtvalue = m_cornerSmoothingCtrl->GetValue();
     m_settings.SetCornerRadius( ValueFromString( g_UserUnit, txtvalue ) );
diff --git a/pcbnew/dialogs/dialog_copper_zones_base.cpp b/pcbnew/dialogs/dialog_copper_zones_base.cpp
index 6bb48b0..52ef0a8 100644
--- a/pcbnew/dialogs/dialog_copper_zones_base.cpp
+++ b/pcbnew/dialogs/dialog_copper_zones_base.cpp
@@ -1,8 +1,8 @@
 ///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Dec 30 2017)
+// C++ code generated with wxFormBuilder (version Aug  4 2017)
 // http://www.wxformbuilder.org/
 //
-// PLEASE DO *NOT* EDIT THIS FILE!
+// PLEASE DO "NOT" EDIT THIS FILE!
 ///////////////////////////////////////////////////////////////////////////
 
 #include "widgets/text_ctrl_eval.h"
@@ -11,20 +11,6 @@
 
 ///////////////////////////////////////////////////////////////////////////
 
-BEGIN_EVENT_TABLE( DIALOG_COPPER_ZONE_BASE, DIALOG_SHIM )
-	EVT_CLOSE( DIALOG_COPPER_ZONE_BASE::_wxFB_OnClose )
-	EVT_UPDATE_UI( ID_NETNAME_SELECTION, DIALOG_COPPER_ZONE_BASE::_wxFB_OnUpdateUI )
-	EVT_CHOICE( ID_M_NETDISPLAYOPTION, DIALOG_COPPER_ZONE_BASE::_wxFB_OnNetSortingOptionSelected )
-	EVT_TEXT_ENTER( ID_TEXTCTRL_NETNAMES_FILTER, DIALOG_COPPER_ZONE_BASE::_wxFB_OnRunFiltersButtonClick )
-	EVT_TEXT_ENTER( ID_TEXTCTRL_NETNAMES_FILTER, DIALOG_COPPER_ZONE_BASE::_wxFB_OnRunFiltersButtonClick )
-	EVT_BUTTON( wxID_APPLY_FILTERS, DIALOG_COPPER_ZONE_BASE::_wxFB_OnRunFiltersButtonClick )
-	EVT_CHOICE( ID_CORNER_SMOOTHING, DIALOG_COPPER_ZONE_BASE::_wxFB_OnCornerSmoothingModeChoice )
-	EVT_CHOICE( ID_M_PADINZONEOPT, DIALOG_COPPER_ZONE_BASE::_wxFB_OnPadsInZoneClick )
-	EVT_BUTTON( wxID_BUTTON_EXPORT, DIALOG_COPPER_ZONE_BASE::_wxFB_ExportSetupToOtherCopperZones )
-	EVT_BUTTON( wxID_CANCEL, DIALOG_COPPER_ZONE_BASE::_wxFB_OnButtonCancelClick )
-	EVT_BUTTON( wxID_OK, DIALOG_COPPER_ZONE_BASE::_wxFB_OnButtonOkClick )
-END_EVENT_TABLE()
-
 DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
 {
 	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
@@ -196,16 +182,6 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i
 	m_PriorityLevelCtrl = new wxSpinCtrl( m_ExportableSetupSizer->GetStaticBox(), ID_M_PRIORITYLEVELCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 100, 0 );
 	m_MiddleBox->Add( m_PriorityLevelCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
 	
-	m_staticTextFillMode = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Fill mode:"), wxDefaultPosition, wxDefaultSize, 0 );
-	m_staticTextFillMode->Wrap( -1 );
-	m_MiddleBox->Add( m_staticTextFillMode, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
-	
-	wxString m_FillModeCtrlChoices[] = { _("Polygon"), _("Segment") };
-	int m_FillModeCtrlNChoices = sizeof( m_FillModeCtrlChoices ) / sizeof( wxString );
-	m_FillModeCtrl = new wxChoice( m_ExportableSetupSizer->GetStaticBox(), ID_M_FILLMODECTRL, wxDefaultPosition, wxDefaultSize, m_FillModeCtrlNChoices, m_FillModeCtrlChoices, 0 );
-	m_FillModeCtrl->SetSelection( 0 );
-	m_MiddleBox->Add( m_FillModeCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
-	
 	m_staticTextSegmCnt = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Segments / 360 deg:"), wxDefaultPosition, wxDefaultSize, 0 );
 	m_staticTextSegmCnt->Wrap( -1 );
 	m_MiddleBox->Add( m_staticTextSegmCnt, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
@@ -216,43 +192,67 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i
 	m_ArcApproximationOpt->SetSelection( 0 );
 	m_MiddleBox->Add( m_ArcApproximationOpt, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
 	
-	
-	m_ExportableSetupSizer->Add( m_MiddleBox, 0, wxEXPAND, 5 );
-	
-	wxBoxSizer* bSizerLowerRight;
-	bSizerLowerRight = new wxBoxSizer( wxVERTICAL );
-	
 	m_staticTextSlope = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Outline slope:"), wxDefaultPosition, wxDefaultSize, 0 );
 	m_staticTextSlope->Wrap( -1 );
-	bSizerLowerRight->Add( m_staticTextSlope, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
+	m_MiddleBox->Add( m_staticTextSlope, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
 	
 	wxString m_OrientEdgesOptChoices[] = { _("Arbitrary"), _("H, V, and 45 deg only") };
 	int m_OrientEdgesOptNChoices = sizeof( m_OrientEdgesOptChoices ) / sizeof( wxString );
 	m_OrientEdgesOpt = new wxChoice( m_ExportableSetupSizer->GetStaticBox(), ID_M_ORIENTEDGESOPT, wxDefaultPosition, wxDefaultSize, m_OrientEdgesOptNChoices, m_OrientEdgesOptChoices, 0 );
 	m_OrientEdgesOpt->SetSelection( 0 );
-	bSizerLowerRight->Add( m_OrientEdgesOpt, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
+	m_MiddleBox->Add( m_OrientEdgesOpt, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
 	
 	m_staticTextStyle = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Outline style:"), wxDefaultPosition, wxDefaultSize, 0 );
 	m_staticTextStyle->Wrap( -1 );
-	bSizerLowerRight->Add( m_staticTextStyle, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
+	m_MiddleBox->Add( m_staticTextStyle, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
 	
 	wxString m_OutlineAppearanceCtrlChoices[] = { _("Line"), _("Hatched"), _("Fully hatched") };
 	int m_OutlineAppearanceCtrlNChoices = sizeof( m_OutlineAppearanceCtrlChoices ) / sizeof( wxString );
 	m_OutlineAppearanceCtrl = new wxChoice( m_ExportableSetupSizer->GetStaticBox(), ID_M_OUTLINEAPPEARANCECTRL, wxDefaultPosition, wxDefaultSize, m_OutlineAppearanceCtrlNChoices, m_OutlineAppearanceCtrlChoices, 0 );
 	m_OutlineAppearanceCtrl->SetSelection( 0 );
-	bSizerLowerRight->Add( m_OutlineAppearanceCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
+	m_MiddleBox->Add( m_OutlineAppearanceCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
+	
+	
+	m_ExportableSetupSizer->Add( m_MiddleBox, 0, wxEXPAND, 5 );
+	
+	wxBoxSizer* bSizerLowerRight;
+	bSizerLowerRight = new wxBoxSizer( wxVERTICAL );
+	
+	m_staticTextGridStyle = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Fill style:"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_staticTextGridStyle->Wrap( -1 );
+	bSizerLowerRight->Add( m_staticTextGridStyle, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
+	
+	wxString m_GridStyleCtrlChoices[] = { _("Solid shape"), _("Grid pattern") };
+	int m_GridStyleCtrlNChoices = sizeof( m_GridStyleCtrlChoices ) / sizeof( wxString );
+	m_GridStyleCtrl = new wxChoice( m_ExportableSetupSizer->GetStaticBox(), ID_M_FILLMODECTRL, wxDefaultPosition, wxDefaultSize, m_GridStyleCtrlNChoices, m_GridStyleCtrlChoices, 0 );
+	m_GridStyleCtrl->SetSelection( 0 );
+	bSizerLowerRight->Add( m_GridStyleCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
+	
+	m_staticTextGrindThickness = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Grid style: thickness"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_staticTextGrindThickness->Wrap( -1 );
+	bSizerLowerRight->Add( m_staticTextGrindThickness, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
+	
+	m_tcGridStyleThickness = new wxTextCtrl( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
+	bSizerLowerRight->Add( m_tcGridStyleThickness, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
+	
+	m_staticTextStyleSize = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("Grid style: grid size"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_staticTextStyleSize->Wrap( -1 );
+	bSizerLowerRight->Add( m_staticTextStyleSize, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
+	
+	m_tcGridStyleSize = new wxTextCtrl( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
+	bSizerLowerRight->Add( m_tcGridStyleSize, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
 	
 	m_bNoNetWarning = new wxBoxSizer( wxHORIZONTAL );
 	
 	m_bitmapNoNetWarning = new wxStaticBitmap( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
-	m_bNoNetWarning->Add( m_bitmapNoNetWarning, 0, wxTOP|wxBOTTOM|wxLEFT, 8 );
+	m_bNoNetWarning->Add( m_bitmapNoNetWarning, 0, wxTOP, 5 );
 	
 	m_staticText18 = new wxStaticText( m_ExportableSetupSizer->GetStaticBox(), wxID_ANY, _("No net will result\nin an unconnected \ncopper island."), wxDefaultPosition, wxDefaultSize, 0 );
 	m_staticText18->Wrap( -1 );
 	m_bNoNetWarning->Add( m_staticText18, 0, wxALL, 5 );
 	
 	
-	bSizerLowerRight->Add( m_bNoNetWarning, 1, wxEXPAND|wxTOP, 25 );
+	bSizerLowerRight->Add( m_bNoNetWarning, 1, wxEXPAND, 5 );
 	
 	
 	m_ExportableSetupSizer->Add( bSizerLowerRight, 0, wxEXPAND, 5 );
@@ -283,9 +283,36 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i
 	
 	this->SetSizer( m_MainBoxSizer );
 	this->Layout();
-	m_MainBoxSizer->Fit( this );
+	
+	// Connect Events
+	this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_COPPER_ZONE_BASE::OnClose ) );
+	m_ListNetNameSelection->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_COPPER_ZONE_BASE::OnUpdateUI ), NULL, this );
+	m_NetDisplayOption->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnNetSortingOptionSelected ), NULL, this );
+	m_DoNotShowNetNameFilter->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnRunFiltersButtonClick ), NULL, this );
+	m_ShowNetNameFilter->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnRunFiltersButtonClick ), NULL, this );
+	m_buttonRunFilter->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnRunFiltersButtonClick ), NULL, this );
+	m_cornerSmoothingChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnCornerSmoothingModeChoice ), NULL, this );
+	m_PadInZoneOpt->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnPadsInZoneClick ), NULL, this );
+	m_GridStyleCtrl->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnStyleSelection ), NULL, this );
+	m_ExportSetupButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::ExportSetupToOtherCopperZones ), NULL, this );
+	m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnButtonCancelClick ), NULL, this );
+	m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnButtonOkClick ), NULL, this );
 }
 
 DIALOG_COPPER_ZONE_BASE::~DIALOG_COPPER_ZONE_BASE()
 {
+	// Disconnect Events
+	this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_COPPER_ZONE_BASE::OnClose ) );
+	m_ListNetNameSelection->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_COPPER_ZONE_BASE::OnUpdateUI ), NULL, this );
+	m_NetDisplayOption->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnNetSortingOptionSelected ), NULL, this );
+	m_DoNotShowNetNameFilter->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnRunFiltersButtonClick ), NULL, this );
+	m_ShowNetNameFilter->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnRunFiltersButtonClick ), NULL, this );
+	m_buttonRunFilter->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnRunFiltersButtonClick ), NULL, this );
+	m_cornerSmoothingChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnCornerSmoothingModeChoice ), NULL, this );
+	m_PadInZoneOpt->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnPadsInZoneClick ), NULL, this );
+	m_GridStyleCtrl->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnStyleSelection ), NULL, this );
+	m_ExportSetupButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::ExportSetupToOtherCopperZones ), NULL, this );
+	m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnButtonCancelClick ), NULL, this );
+	m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnButtonOkClick ), NULL, this );
+	
 }
diff --git a/pcbnew/dialogs/dialog_copper_zones_base.fbp b/pcbnew/dialogs/dialog_copper_zones_base.fbp
index 3871abd..ff6f8ed 100644
--- a/pcbnew/dialogs/dialog_copper_zones_base.fbp
+++ b/pcbnew/dialogs/dialog_copper_zones_base.fbp
@@ -10,7 +10,7 @@
         <property name="disconnect_python_events">0</property>
         <property name="embedded_files_path">res</property>
         <property name="encoding">UTF-8</property>
-        <property name="event_generation">table</property>
+        <property name="event_generation">connect</property>
         <property name="file">dialog_copper_zones_base</property>
         <property name="first_id">1000</property>
         <property name="help_provider">none</property>
@@ -24,7 +24,7 @@
         <property name="skip_php_events">1</property>
         <property name="skip_python_events">1</property>
         <property name="ui_table">UI</property>
-        <property name="use_enum">1</property>
+        <property name="use_enum">0</property>
         <property name="use_microsoft_bom">0</property>
         <object class="Dialog" expanded="1">
             <property name="aui_managed">0</property>
@@ -44,7 +44,7 @@
             <property name="minimum_size"></property>
             <property name="name">DIALOG_COPPER_ZONE_BASE</property>
             <property name="pos"></property>
-            <property name="size">-1,-1</property>
+            <property name="size">572,479</property>
             <property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
             <property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
             <property name="title">Copper Zone Properties</property>
@@ -2581,7 +2581,7 @@
                                         <property name="gripper">0</property>
                                         <property name="hidden">0</property>
                                         <property name="id">wxID_ANY</property>
-                                        <property name="label">Fill mode:</property>
+                                        <property name="label">Segments / 360 deg:</property>
                                         <property name="max_size"></property>
                                         <property name="maximize_button">0</property>
                                         <property name="maximum_size"></property>
@@ -2589,7 +2589,7 @@
                                         <property name="minimize_button">0</property>
                                         <property name="minimum_size"></property>
                                         <property name="moveable">1</property>
-                                        <property name="name">m_staticTextFillMode</property>
+                                        <property name="name">m_staticTextSegmCnt</property>
                                         <property name="pane_border">1</property>
                                         <property name="pane_position"></property>
                                         <property name="pane_size"></property>
@@ -2650,7 +2650,7 @@
                                         <property name="caption"></property>
                                         <property name="caption_visible">1</property>
                                         <property name="center_pane">0</property>
-                                        <property name="choices">&quot;Polygon&quot; &quot;Segment&quot;</property>
+                                        <property name="choices">&quot;16&quot; &quot;32&quot;</property>
                                         <property name="close_button">1</property>
                                         <property name="context_help"></property>
                                         <property name="context_menu">1</property>
@@ -2664,7 +2664,7 @@
                                         <property name="font"></property>
                                         <property name="gripper">0</property>
                                         <property name="hidden">0</property>
-                                        <property name="id">ID_M_FILLMODECTRL</property>
+                                        <property name="id">ID_M_ARCAPPROXIMATIONOPT</property>
                                         <property name="max_size"></property>
                                         <property name="maximize_button">0</property>
                                         <property name="maximum_size"></property>
@@ -2672,7 +2672,7 @@
                                         <property name="minimize_button">0</property>
                                         <property name="minimum_size"></property>
                                         <property name="moveable">1</property>
-                                        <property name="name">m_FillModeCtrl</property>
+                                        <property name="name">m_ArcApproximationOpt</property>
                                         <property name="pane_border">1</property>
                                         <property name="pane_position"></property>
                                         <property name="pane_size"></property>
@@ -2752,7 +2752,7 @@
                                         <property name="gripper">0</property>
                                         <property name="hidden">0</property>
                                         <property name="id">wxID_ANY</property>
-                                        <property name="label">Segments / 360 deg:</property>
+                                        <property name="label">Outline slope:</property>
                                         <property name="max_size"></property>
                                         <property name="maximize_button">0</property>
                                         <property name="maximum_size"></property>
@@ -2760,7 +2760,7 @@
                                         <property name="minimize_button">0</property>
                                         <property name="minimum_size"></property>
                                         <property name="moveable">1</property>
-                                        <property name="name">m_staticTextSegmCnt</property>
+                                        <property name="name">m_staticTextSlope</property>
                                         <property name="pane_border">1</property>
                                         <property name="pane_position"></property>
                                         <property name="pane_size"></property>
@@ -2821,7 +2821,7 @@
                                         <property name="caption"></property>
                                         <property name="caption_visible">1</property>
                                         <property name="center_pane">0</property>
-                                        <property name="choices">&quot;16&quot; &quot;32&quot;</property>
+                                        <property name="choices">&quot;Arbitrary&quot; &quot;H, V, and 45 deg only&quot;</property>
                                         <property name="close_button">1</property>
                                         <property name="context_help"></property>
                                         <property name="context_menu">1</property>
@@ -2835,7 +2835,7 @@
                                         <property name="font"></property>
                                         <property name="gripper">0</property>
                                         <property name="hidden">0</property>
-                                        <property name="id">ID_M_ARCAPPROXIMATIONOPT</property>
+                                        <property name="id">ID_M_ORIENTEDGESOPT</property>
                                         <property name="max_size"></property>
                                         <property name="maximize_button">0</property>
                                         <property name="maximum_size"></property>
@@ -2843,7 +2843,178 @@
                                         <property name="minimize_button">0</property>
                                         <property name="minimum_size"></property>
                                         <property name="moveable">1</property>
-                                        <property name="name">m_ArcApproximationOpt</property>
+                                        <property name="name">m_OrientEdgesOpt</property>
+                                        <property name="pane_border">1</property>
+                                        <property name="pane_position"></property>
+                                        <property name="pane_size"></property>
+                                        <property name="permission">protected</property>
+                                        <property name="pin_button">1</property>
+                                        <property name="pos"></property>
+                                        <property name="resize">Resizable</property>
+                                        <property name="selection">0</property>
+                                        <property name="show">1</property>
+                                        <property name="size"></property>
+                                        <property name="style"></property>
+                                        <property name="subclass"></property>
+                                        <property name="toolbar_pane">0</property>
+                                        <property name="tooltip"></property>
+                                        <property name="validator_data_type"></property>
+                                        <property name="validator_style">wxFILTER_NONE</property>
+                                        <property name="validator_type">wxDefaultValidator</property>
+                                        <property name="validator_variable"></property>
+                                        <property name="window_extra_style"></property>
+                                        <property name="window_name"></property>
+                                        <property name="window_style"></property>
+                                        <event name="OnChar"></event>
+                                        <event name="OnChoice"></event>
+                                        <event name="OnEnterWindow"></event>
+                                        <event name="OnEraseBackground"></event>
+                                        <event name="OnKeyDown"></event>
+                                        <event name="OnKeyUp"></event>
+                                        <event name="OnKillFocus"></event>
+                                        <event name="OnLeaveWindow"></event>
+                                        <event name="OnLeftDClick"></event>
+                                        <event name="OnLeftDown"></event>
+                                        <event name="OnLeftUp"></event>
+                                        <event name="OnMiddleDClick"></event>
+                                        <event name="OnMiddleDown"></event>
+                                        <event name="OnMiddleUp"></event>
+                                        <event name="OnMotion"></event>
+                                        <event name="OnMouseEvents"></event>
+                                        <event name="OnMouseWheel"></event>
+                                        <event name="OnPaint"></event>
+                                        <event name="OnRightDClick"></event>
+                                        <event name="OnRightDown"></event>
+                                        <event name="OnRightUp"></event>
+                                        <event name="OnSetFocus"></event>
+                                        <event name="OnSize"></event>
+                                        <event name="OnUpdateUI"></event>
+                                    </object>
+                                </object>
+                                <object class="sizeritem" expanded="0">
+                                    <property name="border">5</property>
+                                    <property name="flag">wxLEFT|wxRIGHT|wxTOP</property>
+                                    <property name="proportion">0</property>
+                                    <object class="wxStaticText" expanded="0">
+                                        <property name="BottomDockable">1</property>
+                                        <property name="LeftDockable">1</property>
+                                        <property name="RightDockable">1</property>
+                                        <property name="TopDockable">1</property>
+                                        <property name="aui_layer"></property>
+                                        <property name="aui_name"></property>
+                                        <property name="aui_position"></property>
+                                        <property name="aui_row"></property>
+                                        <property name="best_size"></property>
+                                        <property name="bg"></property>
+                                        <property name="caption"></property>
+                                        <property name="caption_visible">1</property>
+                                        <property name="center_pane">0</property>
+                                        <property name="close_button">1</property>
+                                        <property name="context_help"></property>
+                                        <property name="context_menu">1</property>
+                                        <property name="default_pane">0</property>
+                                        <property name="dock">Dock</property>
+                                        <property name="dock_fixed">0</property>
+                                        <property name="docking">Left</property>
+                                        <property name="enabled">1</property>
+                                        <property name="fg"></property>
+                                        <property name="floatable">1</property>
+                                        <property name="font"></property>
+                                        <property name="gripper">0</property>
+                                        <property name="hidden">0</property>
+                                        <property name="id">wxID_ANY</property>
+                                        <property name="label">Outline style:</property>
+                                        <property name="max_size"></property>
+                                        <property name="maximize_button">0</property>
+                                        <property name="maximum_size"></property>
+                                        <property name="min_size"></property>
+                                        <property name="minimize_button">0</property>
+                                        <property name="minimum_size"></property>
+                                        <property name="moveable">1</property>
+                                        <property name="name">m_staticTextStyle</property>
+                                        <property name="pane_border">1</property>
+                                        <property name="pane_position"></property>
+                                        <property name="pane_size"></property>
+                                        <property name="permission">protected</property>
+                                        <property name="pin_button">1</property>
+                                        <property name="pos"></property>
+                                        <property name="resize">Resizable</property>
+                                        <property name="show">1</property>
+                                        <property name="size"></property>
+                                        <property name="style"></property>
+                                        <property name="subclass"></property>
+                                        <property name="toolbar_pane">0</property>
+                                        <property name="tooltip"></property>
+                                        <property name="window_extra_style"></property>
+                                        <property name="window_name"></property>
+                                        <property name="window_style"></property>
+                                        <property name="wrap">-1</property>
+                                        <event name="OnChar"></event>
+                                        <event name="OnEnterWindow"></event>
+                                        <event name="OnEraseBackground"></event>
+                                        <event name="OnKeyDown"></event>
+                                        <event name="OnKeyUp"></event>
+                                        <event name="OnKillFocus"></event>
+                                        <event name="OnLeaveWindow"></event>
+                                        <event name="OnLeftDClick"></event>
+                                        <event name="OnLeftDown"></event>
+                                        <event name="OnLeftUp"></event>
+                                        <event name="OnMiddleDClick"></event>
+                                        <event name="OnMiddleDown"></event>
+                                        <event name="OnMiddleUp"></event>
+                                        <event name="OnMotion"></event>
+                                        <event name="OnMouseEvents"></event>
+                                        <event name="OnMouseWheel"></event>
+                                        <event name="OnPaint"></event>
+                                        <event name="OnRightDClick"></event>
+                                        <event name="OnRightDown"></event>
+                                        <event name="OnRightUp"></event>
+                                        <event name="OnSetFocus"></event>
+                                        <event name="OnSize"></event>
+                                        <event name="OnUpdateUI"></event>
+                                    </object>
+                                </object>
+                                <object class="sizeritem" expanded="0">
+                                    <property name="border">5</property>
+                                    <property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
+                                    <property name="proportion">0</property>
+                                    <object class="wxChoice" expanded="0">
+                                        <property name="BottomDockable">1</property>
+                                        <property name="LeftDockable">1</property>
+                                        <property name="RightDockable">1</property>
+                                        <property name="TopDockable">1</property>
+                                        <property name="aui_layer"></property>
+                                        <property name="aui_name"></property>
+                                        <property name="aui_position"></property>
+                                        <property name="aui_row"></property>
+                                        <property name="best_size"></property>
+                                        <property name="bg"></property>
+                                        <property name="caption"></property>
+                                        <property name="caption_visible">1</property>
+                                        <property name="center_pane">0</property>
+                                        <property name="choices">&quot;Line&quot; &quot;Hatched&quot; &quot;Fully hatched&quot;</property>
+                                        <property name="close_button">1</property>
+                                        <property name="context_help"></property>
+                                        <property name="context_menu">1</property>
+                                        <property name="default_pane">0</property>
+                                        <property name="dock">Dock</property>
+                                        <property name="dock_fixed">0</property>
+                                        <property name="docking">Left</property>
+                                        <property name="enabled">1</property>
+                                        <property name="fg"></property>
+                                        <property name="floatable">1</property>
+                                        <property name="font"></property>
+                                        <property name="gripper">0</property>
+                                        <property name="hidden">0</property>
+                                        <property name="id">ID_M_OUTLINEAPPEARANCECTRL</property>
+                                        <property name="max_size"></property>
+                                        <property name="maximize_button">0</property>
+                                        <property name="maximum_size"></property>
+                                        <property name="min_size"></property>
+                                        <property name="minimize_button">0</property>
+                                        <property name="minimum_size"></property>
+                                        <property name="moveable">1</property>
+                                        <property name="name">m_OutlineAppearanceCtrl</property>
                                         <property name="pane_border">1</property>
                                         <property name="pane_position"></property>
                                         <property name="pane_size"></property>
@@ -2934,7 +3105,7 @@
                                         <property name="gripper">0</property>
                                         <property name="hidden">0</property>
                                         <property name="id">wxID_ANY</property>
-                                        <property name="label">Outline slope:</property>
+                                        <property name="label">Fill style:</property>
                                         <property name="max_size"></property>
                                         <property name="maximize_button">0</property>
                                         <property name="maximum_size"></property>
@@ -2942,7 +3113,7 @@
                                         <property name="minimize_button">0</property>
                                         <property name="minimum_size"></property>
                                         <property name="moveable">1</property>
-                                        <property name="name">m_staticTextSlope</property>
+                                        <property name="name">m_staticTextGridStyle</property>
                                         <property name="pane_border">1</property>
                                         <property name="pane_position"></property>
                                         <property name="pane_size"></property>
@@ -3003,7 +3174,7 @@
                                         <property name="caption"></property>
                                         <property name="caption_visible">1</property>
                                         <property name="center_pane">0</property>
-                                        <property name="choices">&quot;Arbitrary&quot; &quot;H, V, and 45 deg only&quot;</property>
+                                        <property name="choices">&quot;Solid shape&quot; &quot;Grid pattern&quot;</property>
                                         <property name="close_button">1</property>
                                         <property name="context_help"></property>
                                         <property name="context_menu">1</property>
@@ -3017,7 +3188,7 @@
                                         <property name="font"></property>
                                         <property name="gripper">0</property>
                                         <property name="hidden">0</property>
-                                        <property name="id">ID_M_ORIENTEDGESOPT</property>
+                                        <property name="id">ID_M_FILLMODECTRL</property>
                                         <property name="max_size"></property>
                                         <property name="maximize_button">0</property>
                                         <property name="maximum_size"></property>
@@ -3025,7 +3196,7 @@
                                         <property name="minimize_button">0</property>
                                         <property name="minimum_size"></property>
                                         <property name="moveable">1</property>
-                                        <property name="name">m_OrientEdgesOpt</property>
+                                        <property name="name">m_GridStyleCtrl</property>
                                         <property name="pane_border">1</property>
                                         <property name="pane_position"></property>
                                         <property name="pane_size"></property>
@@ -3048,7 +3219,7 @@
                                         <property name="window_name"></property>
                                         <property name="window_style"></property>
                                         <event name="OnChar"></event>
-                                        <event name="OnChoice"></event>
+                                        <event name="OnChoice">OnStyleSelection</event>
                                         <event name="OnEnterWindow"></event>
                                         <event name="OnEraseBackground"></event>
                                         <event name="OnKeyDown"></event>
@@ -3073,11 +3244,11 @@
                                         <event name="OnUpdateUI"></event>
                                     </object>
                                 </object>
-                                <object class="sizeritem" expanded="0">
+                                <object class="sizeritem" expanded="1">
                                     <property name="border">5</property>
-                                    <property name="flag">wxLEFT|wxRIGHT|wxTOP</property>
+                                    <property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
                                     <property name="proportion">0</property>
-                                    <object class="wxStaticText" expanded="0">
+                                    <object class="wxStaticText" expanded="1">
                                         <property name="BottomDockable">1</property>
                                         <property name="LeftDockable">1</property>
                                         <property name="RightDockable">1</property>
@@ -3105,7 +3276,7 @@
                                         <property name="gripper">0</property>
                                         <property name="hidden">0</property>
                                         <property name="id">wxID_ANY</property>
-                                        <property name="label">Outline style:</property>
+                                        <property name="label">Grid style: thickness</property>
                                         <property name="max_size"></property>
                                         <property name="maximize_button">0</property>
                                         <property name="maximum_size"></property>
@@ -3113,7 +3284,7 @@
                                         <property name="minimize_button">0</property>
                                         <property name="minimum_size"></property>
                                         <property name="moveable">1</property>
-                                        <property name="name">m_staticTextStyle</property>
+                                        <property name="name">m_staticTextGrindThickness</property>
                                         <property name="pane_border">1</property>
                                         <property name="pane_position"></property>
                                         <property name="pane_size"></property>
@@ -3156,11 +3327,11 @@
                                         <event name="OnUpdateUI"></event>
                                     </object>
                                 </object>
-                                <object class="sizeritem" expanded="0">
+                                <object class="sizeritem" expanded="1">
                                     <property name="border">5</property>
-                                    <property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
+                                    <property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
                                     <property name="proportion">0</property>
-                                    <object class="wxChoice" expanded="0">
+                                    <object class="wxTextCtrl" expanded="1">
                                         <property name="BottomDockable">1</property>
                                         <property name="LeftDockable">1</property>
                                         <property name="RightDockable">1</property>
@@ -3174,7 +3345,6 @@
                                         <property name="caption"></property>
                                         <property name="caption_visible">1</property>
                                         <property name="center_pane">0</property>
-                                        <property name="choices">&quot;Line&quot; &quot;Hatched&quot; &quot;Fully hatched&quot;</property>
                                         <property name="close_button">1</property>
                                         <property name="context_help"></property>
                                         <property name="context_menu">1</property>
@@ -3188,15 +3358,16 @@
                                         <property name="font"></property>
                                         <property name="gripper">0</property>
                                         <property name="hidden">0</property>
-                                        <property name="id">ID_M_OUTLINEAPPEARANCECTRL</property>
+                                        <property name="id">wxID_ANY</property>
                                         <property name="max_size"></property>
                                         <property name="maximize_button">0</property>
                                         <property name="maximum_size"></property>
+                                        <property name="maxlength"></property>
                                         <property name="min_size"></property>
                                         <property name="minimize_button">0</property>
                                         <property name="minimum_size"></property>
                                         <property name="moveable">1</property>
-                                        <property name="name">m_OutlineAppearanceCtrl</property>
+                                        <property name="name">m_tcGridStyleThickness</property>
                                         <property name="pane_border">1</property>
                                         <property name="pane_position"></property>
                                         <property name="pane_size"></property>
@@ -3204,7 +3375,6 @@
                                         <property name="pin_button">1</property>
                                         <property name="pos"></property>
                                         <property name="resize">Resizable</property>
-                                        <property name="selection">0</property>
                                         <property name="show">1</property>
                                         <property name="size"></property>
                                         <property name="style"></property>
@@ -3215,11 +3385,185 @@
                                         <property name="validator_style">wxFILTER_NONE</property>
                                         <property name="validator_type">wxDefaultValidator</property>
                                         <property name="validator_variable"></property>
+                                        <property name="value"></property>
+                                        <property name="window_extra_style"></property>
+                                        <property name="window_name"></property>
+                                        <property name="window_style"></property>
+                                        <event name="OnChar"></event>
+                                        <event name="OnEnterWindow"></event>
+                                        <event name="OnEraseBackground"></event>
+                                        <event name="OnKeyDown"></event>
+                                        <event name="OnKeyUp"></event>
+                                        <event name="OnKillFocus"></event>
+                                        <event name="OnLeaveWindow"></event>
+                                        <event name="OnLeftDClick"></event>
+                                        <event name="OnLeftDown"></event>
+                                        <event name="OnLeftUp"></event>
+                                        <event name="OnMiddleDClick"></event>
+                                        <event name="OnMiddleDown"></event>
+                                        <event name="OnMiddleUp"></event>
+                                        <event name="OnMotion"></event>
+                                        <event name="OnMouseEvents"></event>
+                                        <event name="OnMouseWheel"></event>
+                                        <event name="OnPaint"></event>
+                                        <event name="OnRightDClick"></event>
+                                        <event name="OnRightDown"></event>
+                                        <event name="OnRightUp"></event>
+                                        <event name="OnSetFocus"></event>
+                                        <event name="OnSize"></event>
+                                        <event name="OnText"></event>
+                                        <event name="OnTextEnter"></event>
+                                        <event name="OnTextMaxLen"></event>
+                                        <event name="OnTextURL"></event>
+                                        <event name="OnUpdateUI"></event>
+                                    </object>
+                                </object>
+                                <object class="sizeritem" expanded="1">
+                                    <property name="border">5</property>
+                                    <property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
+                                    <property name="proportion">0</property>
+                                    <object class="wxStaticText" expanded="1">
+                                        <property name="BottomDockable">1</property>
+                                        <property name="LeftDockable">1</property>
+                                        <property name="RightDockable">1</property>
+                                        <property name="TopDockable">1</property>
+                                        <property name="aui_layer"></property>
+                                        <property name="aui_name"></property>
+                                        <property name="aui_position"></property>
+                                        <property name="aui_row"></property>
+                                        <property name="best_size"></property>
+                                        <property name="bg"></property>
+                                        <property name="caption"></property>
+                                        <property name="caption_visible">1</property>
+                                        <property name="center_pane">0</property>
+                                        <property name="close_button">1</property>
+                                        <property name="context_help"></property>
+                                        <property name="context_menu">1</property>
+                                        <property name="default_pane">0</property>
+                                        <property name="dock">Dock</property>
+                                        <property name="dock_fixed">0</property>
+                                        <property name="docking">Left</property>
+                                        <property name="enabled">1</property>
+                                        <property name="fg"></property>
+                                        <property name="floatable">1</property>
+                                        <property name="font"></property>
+                                        <property name="gripper">0</property>
+                                        <property name="hidden">0</property>
+                                        <property name="id">wxID_ANY</property>
+                                        <property name="label">Grid style: grid size</property>
+                                        <property name="max_size"></property>
+                                        <property name="maximize_button">0</property>
+                                        <property name="maximum_size"></property>
+                                        <property name="min_size"></property>
+                                        <property name="minimize_button">0</property>
+                                        <property name="minimum_size"></property>
+                                        <property name="moveable">1</property>
+                                        <property name="name">m_staticTextStyleSize</property>
+                                        <property name="pane_border">1</property>
+                                        <property name="pane_position"></property>
+                                        <property name="pane_size"></property>
+                                        <property name="permission">protected</property>
+                                        <property name="pin_button">1</property>
+                                        <property name="pos"></property>
+                                        <property name="resize">Resizable</property>
+                                        <property name="show">1</property>
+                                        <property name="size"></property>
+                                        <property name="style"></property>
+                                        <property name="subclass"></property>
+                                        <property name="toolbar_pane">0</property>
+                                        <property name="tooltip"></property>
+                                        <property name="window_extra_style"></property>
+                                        <property name="window_name"></property>
+                                        <property name="window_style"></property>
+                                        <property name="wrap">-1</property>
+                                        <event name="OnChar"></event>
+                                        <event name="OnEnterWindow"></event>
+                                        <event name="OnEraseBackground"></event>
+                                        <event name="OnKeyDown"></event>
+                                        <event name="OnKeyUp"></event>
+                                        <event name="OnKillFocus"></event>
+                                        <event name="OnLeaveWindow"></event>
+                                        <event name="OnLeftDClick"></event>
+                                        <event name="OnLeftDown"></event>
+                                        <event name="OnLeftUp"></event>
+                                        <event name="OnMiddleDClick"></event>
+                                        <event name="OnMiddleDown"></event>
+                                        <event name="OnMiddleUp"></event>
+                                        <event name="OnMotion"></event>
+                                        <event name="OnMouseEvents"></event>
+                                        <event name="OnMouseWheel"></event>
+                                        <event name="OnPaint"></event>
+                                        <event name="OnRightDClick"></event>
+                                        <event name="OnRightDown"></event>
+                                        <event name="OnRightUp"></event>
+                                        <event name="OnSetFocus"></event>
+                                        <event name="OnSize"></event>
+                                        <event name="OnUpdateUI"></event>
+                                    </object>
+                                </object>
+                                <object class="sizeritem" expanded="1">
+                                    <property name="border">5</property>
+                                    <property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
+                                    <property name="proportion">0</property>
+                                    <object class="wxTextCtrl" expanded="1">
+                                        <property name="BottomDockable">1</property>
+                                        <property name="LeftDockable">1</property>
+                                        <property name="RightDockable">1</property>
+                                        <property name="TopDockable">1</property>
+                                        <property name="aui_layer"></property>
+                                        <property name="aui_name"></property>
+                                        <property name="aui_position"></property>
+                                        <property name="aui_row"></property>
+                                        <property name="best_size"></property>
+                                        <property name="bg"></property>
+                                        <property name="caption"></property>
+                                        <property name="caption_visible">1</property>
+                                        <property name="center_pane">0</property>
+                                        <property name="close_button">1</property>
+                                        <property name="context_help"></property>
+                                        <property name="context_menu">1</property>
+                                        <property name="default_pane">0</property>
+                                        <property name="dock">Dock</property>
+                                        <property name="dock_fixed">0</property>
+                                        <property name="docking">Left</property>
+                                        <property name="enabled">1</property>
+                                        <property name="fg"></property>
+                                        <property name="floatable">1</property>
+                                        <property name="font"></property>
+                                        <property name="gripper">0</property>
+                                        <property name="hidden">0</property>
+                                        <property name="id">wxID_ANY</property>
+                                        <property name="max_size"></property>
+                                        <property name="maximize_button">0</property>
+                                        <property name="maximum_size"></property>
+                                        <property name="maxlength"></property>
+                                        <property name="min_size"></property>
+                                        <property name="minimize_button">0</property>
+                                        <property name="minimum_size"></property>
+                                        <property name="moveable">1</property>
+                                        <property name="name">m_tcGridStyleSize</property>
+                                        <property name="pane_border">1</property>
+                                        <property name="pane_position"></property>
+                                        <property name="pane_size"></property>
+                                        <property name="permission">protected</property>
+                                        <property name="pin_button">1</property>
+                                        <property name="pos"></property>
+                                        <property name="resize">Resizable</property>
+                                        <property name="show">1</property>
+                                        <property name="size"></property>
+                                        <property name="style"></property>
+                                        <property name="subclass"></property>
+                                        <property name="toolbar_pane">0</property>
+                                        <property name="tooltip"></property>
+                                        <property name="validator_data_type"></property>
+                                        <property name="validator_style">wxFILTER_NONE</property>
+                                        <property name="validator_type">wxDefaultValidator</property>
+                                        <property name="validator_variable"></property>
+                                        <property name="value"></property>
                                         <property name="window_extra_style"></property>
                                         <property name="window_name"></property>
                                         <property name="window_style"></property>
                                         <event name="OnChar"></event>
-                                        <event name="OnChoice"></event>
                                         <event name="OnEnterWindow"></event>
                                         <event name="OnEraseBackground"></event>
                                         <event name="OnKeyDown"></event>
@@ -3241,12 +3585,16 @@
                                         <event name="OnRightUp"></event>
                                         <event name="OnSetFocus"></event>
                                         <event name="OnSize"></event>
+                                        <event name="OnText"></event>
+                                        <event name="OnTextEnter"></event>
+                                        <event name="OnTextMaxLen"></event>
+                                        <event name="OnTextURL"></event>
                                         <event name="OnUpdateUI"></event>
                                     </object>
                                 </object>
                                 <object class="sizeritem" expanded="1">
-                                    <property name="border">25</property>
-                                    <property name="flag">wxEXPAND|wxTOP</property>
+                                    <property name="border">5</property>
+                                    <property name="flag">wxEXPAND</property>
                                     <property name="proportion">1</property>
                                     <object class="wxBoxSizer" expanded="1">
                                         <property name="minimum_size"></property>
@@ -3254,8 +3602,8 @@
                                         <property name="orient">wxHORIZONTAL</property>
                                         <property name="permission">protected</property>
                                         <object class="sizeritem" expanded="1">
-                                            <property name="border">8</property>
-                                            <property name="flag">wxTOP|wxBOTTOM|wxLEFT</property>
+                                            <property name="border">5</property>
+                                            <property name="flag">wxTOP</property>
                                             <property name="proportion">0</property>
                                             <object class="wxStaticBitmap" expanded="1">
                                                 <property name="BottomDockable">1</property>
diff --git a/pcbnew/dialogs/dialog_copper_zones_base.h b/pcbnew/dialogs/dialog_copper_zones_base.h
index ed761d7..cf18b87 100644
--- a/pcbnew/dialogs/dialog_copper_zones_base.h
+++ b/pcbnew/dialogs/dialog_copper_zones_base.h
@@ -1,8 +1,8 @@
 ///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Dec 30 2017)
+// C++ code generated with wxFormBuilder (version Aug  4 2017)
 // http://www.wxformbuilder.org/
 //
-// PLEASE DO *NOT* EDIT THIS FILE!
+// PLEASE DO "NOT" EDIT THIS FILE!
 ///////////////////////////////////////////////////////////////////////////
 
 #ifndef __DIALOG_COPPER_ZONES_BASE_H__
@@ -11,7 +11,9 @@
 #include <wx/artprov.h>
 #include <wx/xrc/xmlres.h>
 #include <wx/intl.h>
+class DIALOG_SHIM;
 class TEXT_CTRL_EVAL;
+class wxListView;
 
 #include "dialog_shim.h"
 #include <wx/string.h>
@@ -36,47 +38,31 @@ class TEXT_CTRL_EVAL;
 
 ///////////////////////////////////////////////////////////////////////////
 
+#define ID_DIALOG_COPPER_ZONE_BASE 1000
+#define ID_NETNAME_SELECTION 1001
+#define ID_M_NETDISPLAYOPTION 1002
+#define ID_TEXTCTRL_NETNAMES_FILTER 1003
+#define wxID_APPLY_FILTERS 1004
+#define ID_CORNER_SMOOTHING 1005
+#define ID_M_CORNERSMOOTHINGCTRL 1006
+#define ID_M_PADINZONEOPT 1007
+#define wxID_ANTIPAD_SIZE 1008
+#define wxID_COPPER_BRIDGE_VALUE 1009
+#define ID_M_PRIORITYLEVELCTRL 1010
+#define ID_M_ARCAPPROXIMATIONOPT 1011
+#define ID_M_ORIENTEDGESOPT 1012
+#define ID_M_OUTLINEAPPEARANCECTRL 1013
+#define ID_M_FILLMODECTRL 1014
+#define wxID_BUTTON_EXPORT 1015
+
 ///////////////////////////////////////////////////////////////////////////////
 /// Class DIALOG_COPPER_ZONE_BASE
 ///////////////////////////////////////////////////////////////////////////////
 class DIALOG_COPPER_ZONE_BASE : public DIALOG_SHIM
 {
-	DECLARE_EVENT_TABLE()
 	private:
-		
-		// Private event handlers
-		void _wxFB_OnClose( wxCloseEvent& event ){ OnClose( event ); }
-		void _wxFB_OnUpdateUI( wxUpdateUIEvent& event ){ OnUpdateUI( event ); }
-		void _wxFB_OnNetSortingOptionSelected( wxCommandEvent& event ){ OnNetSortingOptionSelected( event ); }
-		void _wxFB_OnRunFiltersButtonClick( wxCommandEvent& event ){ OnRunFiltersButtonClick( event ); }
-		void _wxFB_OnCornerSmoothingModeChoice( wxCommandEvent& event ){ OnCornerSmoothingModeChoice( event ); }
-		void _wxFB_OnPadsInZoneClick( wxCommandEvent& event ){ OnPadsInZoneClick( event ); }
-		void _wxFB_ExportSetupToOtherCopperZones( wxCommandEvent& event ){ ExportSetupToOtherCopperZones( event ); }
-		void _wxFB_OnButtonCancelClick( wxCommandEvent& event ){ OnButtonCancelClick( event ); }
-		void _wxFB_OnButtonOkClick( wxCommandEvent& event ){ OnButtonOkClick( event ); }
-		
 	
 	protected:
-		enum
-		{
-			ID_DIALOG_COPPER_ZONE_BASE = 1000,
-			ID_NETNAME_SELECTION,
-			ID_M_NETDISPLAYOPTION,
-			ID_TEXTCTRL_NETNAMES_FILTER,
-			wxID_APPLY_FILTERS,
-			ID_CORNER_SMOOTHING,
-			ID_M_CORNERSMOOTHINGCTRL,
-			ID_M_PADINZONEOPT,
-			wxID_ANTIPAD_SIZE,
-			wxID_COPPER_BRIDGE_VALUE,
-			ID_M_PRIORITYLEVELCTRL,
-			ID_M_FILLMODECTRL,
-			ID_M_ARCAPPROXIMATIONOPT,
-			ID_M_ORIENTEDGESOPT,
-			ID_M_OUTLINEAPPEARANCECTRL,
-			wxID_BUTTON_EXPORT
-		};
-		
 		wxBoxSizer* m_MainBoxSizer;
 		wxStaticText* m_staticTextLayers;
 		wxListView* m_LayerSelectionCtrl;
@@ -105,14 +91,18 @@ class DIALOG_COPPER_ZONE_BASE : public DIALOG_SHIM
 		TEXT_CTRL_EVAL* m_CopperWidthValue;
 		wxStaticText* m_staticTextPriorityLevel;
 		wxSpinCtrl* m_PriorityLevelCtrl;
-		wxStaticText* m_staticTextFillMode;
-		wxChoice* m_FillModeCtrl;
 		wxStaticText* m_staticTextSegmCnt;
 		wxChoice* m_ArcApproximationOpt;
 		wxStaticText* m_staticTextSlope;
 		wxChoice* m_OrientEdgesOpt;
 		wxStaticText* m_staticTextStyle;
 		wxChoice* m_OutlineAppearanceCtrl;
+		wxStaticText* m_staticTextGridStyle;
+		wxChoice* m_GridStyleCtrl;
+		wxStaticText* m_staticTextGrindThickness;
+		wxTextCtrl* m_tcGridStyleThickness;
+		wxStaticText* m_staticTextStyleSize;
+		wxTextCtrl* m_tcGridStyleSize;
 		wxBoxSizer* m_bNoNetWarning;
 		wxStaticBitmap* m_bitmapNoNetWarning;
 		wxStaticText* m_staticText18;
@@ -128,6 +118,7 @@ class DIALOG_COPPER_ZONE_BASE : public DIALOG_SHIM
 		virtual void OnRunFiltersButtonClick( wxCommandEvent& event ) { event.Skip(); }
 		virtual void OnCornerSmoothingModeChoice( wxCommandEvent& event ) { event.Skip(); }
 		virtual void OnPadsInZoneClick( wxCommandEvent& event ) { event.Skip(); }
+		virtual void OnStyleSelection( wxCommandEvent& event ) { event.Skip(); }
 		virtual void ExportSetupToOtherCopperZones( wxCommandEvent& event ) { event.Skip(); }
 		virtual void OnButtonCancelClick( wxCommandEvent& event ) { event.Skip(); }
 		virtual void OnButtonOkClick( wxCommandEvent& event ) { event.Skip(); }
@@ -135,7 +126,7 @@ class DIALOG_COPPER_ZONE_BASE : public DIALOG_SHIM
 	
 	public:
 		
-		DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID id = ID_DIALOG_COPPER_ZONE_BASE, const wxString& title = _("Copper Zone Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); 
+		DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID id = ID_DIALOG_COPPER_ZONE_BASE, const wxString& title = _("Copper Zone Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 572,479 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); 
 		~DIALOG_COPPER_ZONE_BASE();
 	
 };
diff --git a/pcbnew/dialogs/dialog_non_copper_zones_properties.cpp b/pcbnew/dialogs/dialog_non_copper_zones_properties.cpp
index 2f28693..bbc1482 100644
--- a/pcbnew/dialogs/dialog_non_copper_zones_properties.cpp
+++ b/pcbnew/dialogs/dialog_non_copper_zones_properties.cpp
@@ -59,6 +59,7 @@ private:
     ZONE_SETTINGS*  m_ptr;
     ZONE_SETTINGS   m_settings;     // working copy of zone settings
 
+    void OnStyleSelection( wxCommandEvent& event ) override;
     void OnOkClick( wxCommandEvent& event ) override;
     void OnCancelClick( wxCommandEvent& event ) override;
     void Init();
@@ -81,7 +82,6 @@ ZONE_EDIT_T InvokeNonCopperZonesEditor( PCB_BASE_FRAME* aParent,
                                         ZONE_CONTAINER* aZone, ZONE_SETTINGS* aSettings )
 {
     DIALOG_NON_COPPER_ZONES_EDITOR  dlg( aParent, aZone, aSettings );
-
     ZONE_EDIT_T result = ZONE_EDIT_T( dlg.ShowModal() );
 
     return result;
@@ -119,6 +119,12 @@ void DIALOG_NON_COPPER_ZONES_EDITOR::Init()
     if( m_settings.m_Zone_45_Only )
         m_OrientEdgesOpt->SetSelection( 1 );
 
+    m_GridStyleCtrl->SetSelection( m_settings.m_FillMode == ZFM_GRID_PATTERN ? 1 : 0 );
+    msg = StringFromValue( g_UserUnit, m_settings.m_ZoneGridPatternThickness );
+    m_tcGridStyleThickness->SetValue( msg );
+    msg = StringFromValue( g_UserUnit, m_settings.m_ZoneGridPatternGap );
+    m_tcGridStyleSize->SetValue( msg );
+
     switch( m_settings.m_Zone_HatchingStyle )
     {
     case ZONE_CONTAINER::NO_HATCH:
@@ -172,6 +178,10 @@ void DIALOG_NON_COPPER_ZONES_EDITOR::Init()
         ctrlWidth = std::max( ctrlWidth, tsize.x );
     }
 
+    // Enable/Disable some widgets
+    wxCommandEvent event;
+    OnStyleSelection( event );
+
     // The most easy way to ensure the right size is to use wxLIST_AUTOSIZE
     // unfortunately this option does not work well both on
     // wxWidgets 2.8 ( column witdth too small), and
@@ -185,6 +195,14 @@ void DIALOG_NON_COPPER_ZONES_EDITOR::Init()
 }
 
 
+void DIALOG_NON_COPPER_ZONES_EDITOR::OnStyleSelection( wxCommandEvent& event )
+{
+    bool enable = m_GridStyleCtrl->GetSelection() == 1;
+    m_tcGridStyleThickness->Enable( enable );
+    m_tcGridStyleSize->Enable( enable );
+}
+
+
 void DIALOG_NON_COPPER_ZONES_EDITOR::OnOkClick( wxCommandEvent& event )
 {
     wxString txtvalue = m_ZoneMinThicknessCtrl->GetValue();
@@ -198,7 +216,13 @@ void DIALOG_NON_COPPER_ZONES_EDITOR::OnOkClick( wxCommandEvent& event )
         return;
     }
 
-    m_settings.m_FillMode = ZFM_POLYGONS;  // Use always polygon fill mode
+    m_settings.m_FillMode = (m_GridStyleCtrl->GetSelection() == 0) ? ZFM_POLYGONS : ZFM_GRID_PATTERN;
+
+    txtvalue = m_tcGridStyleThickness->GetValue();
+    m_settings.m_ZoneGridPatternThickness = ValueFromString( g_UserUnit, txtvalue );
+
+    txtvalue = m_tcGridStyleSize->GetValue();
+    m_settings.m_ZoneGridPatternGap = ValueFromString( g_UserUnit, txtvalue );
 
     switch( m_OutlineAppearanceCtrl->GetSelection() )
     {
diff --git a/pcbnew/dialogs/dialog_non_copper_zones_properties_base.cpp b/pcbnew/dialogs/dialog_non_copper_zones_properties_base.cpp
index e73b760..929f433 100644
--- a/pcbnew/dialogs/dialog_non_copper_zones_properties_base.cpp
+++ b/pcbnew/dialogs/dialog_non_copper_zones_properties_base.cpp
@@ -2,7 +2,7 @@
 // C++ code generated with wxFormBuilder (version Oct 30 2017)
 // http://www.wxformbuilder.org/
 //
-// PLEASE DO *NOT* EDIT THIS FILE!
+// PLEASE DO "NOT" EDIT THIS FILE!
 ///////////////////////////////////////////////////////////////////////////
 
 #include "dialog_non_copper_zones_properties_base.h"
@@ -10,6 +10,7 @@
 ///////////////////////////////////////////////////////////////////////////
 
 BEGIN_EVENT_TABLE( DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE, DIALOG_SHIM )
+	EVT_CHOICE( wxID_ANY, DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE::_wxFB_OnStyleSelection )
 	EVT_BUTTON( wxID_CANCEL, DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE::_wxFB_OnCancelClick )
 	EVT_BUTTON( wxID_OK, DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE::_wxFB_OnOkClick )
 END_EVENT_TABLE()
@@ -37,8 +38,8 @@ DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE::DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE(
 	
 	m_UpperSizer->Add( bSizerLeft, 1, wxEXPAND, 5 );
 	
-	wxBoxSizer* bSizerRight;
-	bSizerRight = new wxBoxSizer( wxVERTICAL );
+	wxBoxSizer* bSizerMiddle;
+	bSizerMiddle = new wxBoxSizer( wxVERTICAL );
 	
 	wxStaticBoxSizer* m_OutilinesBoxOpt;
 	m_OutilinesBoxOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Outlines Options") ), wxVERTICAL );
@@ -56,7 +57,37 @@ DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE::DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE(
 	m_OutilinesBoxOpt->Add( m_OutlineAppearanceCtrl, 0, wxALL|wxEXPAND, 5 );
 	
 	
-	bSizerRight->Add( m_OutilinesBoxOpt, 0, wxEXPAND|wxALL, 5 );
+	bSizerMiddle->Add( m_OutilinesBoxOpt, 0, wxEXPAND|wxALL, 5 );
+	
+	
+	m_UpperSizer->Add( bSizerMiddle, 0, wxEXPAND, 5 );
+	
+	wxBoxSizer* bSizerRight;
+	bSizerRight = new wxBoxSizer( wxVERTICAL );
+	
+	m_staticTextGridStyle = new wxStaticText( this, wxID_ANY, _("Fill style:"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_staticTextGridStyle->Wrap( -1 );
+	bSizerRight->Add( m_staticTextGridStyle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
+	
+	wxString m_GridStyleCtrlChoices[] = { _("Solid shape"), _("Grid pattern") };
+	int m_GridStyleCtrlNChoices = sizeof( m_GridStyleCtrlChoices ) / sizeof( wxString );
+	m_GridStyleCtrl = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_GridStyleCtrlNChoices, m_GridStyleCtrlChoices, 0 );
+	m_GridStyleCtrl->SetSelection( 0 );
+	bSizerRight->Add( m_GridStyleCtrl, 0, wxALL|wxEXPAND, 5 );
+	
+	m_staticTextGrindThickness = new wxStaticText( this, wxID_ANY, _("Grid style: thickness"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_staticTextGrindThickness->Wrap( -1 );
+	bSizerRight->Add( m_staticTextGrindThickness, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
+	
+	m_tcGridStyleThickness = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
+	bSizerRight->Add( m_tcGridStyleThickness, 0, wxALL|wxEXPAND, 5 );
+	
+	m_staticTextStyleSize = new wxStaticText( this, wxID_ANY, _("Grid style: grid size"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_staticTextStyleSize->Wrap( -1 );
+	bSizerRight->Add( m_staticTextStyleSize, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
+	
+	m_tcGridStyleSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
+	bSizerRight->Add( m_tcGridStyleSize, 0, wxALL|wxEXPAND, 5 );
 	
 	m_MinThicknessValueTitle = new wxStaticText( this, wxID_ANY, _("Zone min thickness value:"), wxDefaultPosition, wxDefaultSize, 0 );
 	m_MinThicknessValueTitle->Wrap( -1 );
@@ -86,7 +117,6 @@ DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE::DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE(
 	
 	this->SetSizer( m_MainSizer );
 	this->Layout();
-	m_MainSizer->Fit( this );
 	
 	this->Centre( wxBOTH );
 }
diff --git a/pcbnew/dialogs/dialog_non_copper_zones_properties_base.fbp b/pcbnew/dialogs/dialog_non_copper_zones_properties_base.fbp
index 3532707..e89c3f7 100644
--- a/pcbnew/dialogs/dialog_non_copper_zones_properties_base.fbp
+++ b/pcbnew/dialogs/dialog_non_copper_zones_properties_base.fbp
@@ -44,7 +44,7 @@
             <property name="minimum_size"></property>
             <property name="name">DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE</property>
             <property name="pos"></property>
-            <property name="size">-1,-1</property>
+            <property name="size">571,299</property>
             <property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
             <property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
             <property name="title">Non Copper Zones Properties</property>
@@ -307,7 +307,7 @@
                             <property name="proportion">0</property>
                             <object class="wxBoxSizer" expanded="1">
                                 <property name="minimum_size"></property>
-                                <property name="name">bSizerRight</property>
+                                <property name="name">bSizerMiddle</property>
                                 <property name="orient">wxVERTICAL</property>
                                 <property name="permission">none</property>
                                 <object class="sizeritem" expanded="1">
@@ -505,6 +505,536 @@
                                         </object>
                                     </object>
                                 </object>
+                            </object>
+                        </object>
+                        <object class="sizeritem" expanded="1">
+                            <property name="border">5</property>
+                            <property name="flag">wxEXPAND</property>
+                            <property name="proportion">0</property>
+                            <object class="wxBoxSizer" expanded="1">
+                                <property name="minimum_size"></property>
+                                <property name="name">bSizerRight</property>
+                                <property name="orient">wxVERTICAL</property>
+                                <property name="permission">none</property>
+                                <object class="sizeritem" expanded="1">
+                                    <property name="border">5</property>
+                                    <property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
+                                    <property name="proportion">0</property>
+                                    <object class="wxStaticText" expanded="1">
+                                        <property name="BottomDockable">1</property>
+                                        <property name="LeftDockable">1</property>
+                                        <property name="RightDockable">1</property>
+                                        <property name="TopDockable">1</property>
+                                        <property name="aui_layer"></property>
+                                        <property name="aui_name"></property>
+                                        <property name="aui_position"></property>
+                                        <property name="aui_row"></property>
+                                        <property name="best_size"></property>
+                                        <property name="bg"></property>
+                                        <property name="caption"></property>
+                                        <property name="caption_visible">1</property>
+                                        <property name="center_pane">0</property>
+                                        <property name="close_button">1</property>
+                                        <property name="context_help"></property>
+                                        <property name="context_menu">1</property>
+                                        <property name="default_pane">0</property>
+                                        <property name="dock">Dock</property>
+                                        <property name="dock_fixed">0</property>
+                                        <property name="docking">Left</property>
+                                        <property name="enabled">1</property>
+                                        <property name="fg"></property>
+                                        <property name="floatable">1</property>
+                                        <property name="font"></property>
+                                        <property name="gripper">0</property>
+                                        <property name="hidden">0</property>
+                                        <property name="id">wxID_ANY</property>
+                                        <property name="label">Fill style:</property>
+                                        <property name="max_size"></property>
+                                        <property name="maximize_button">0</property>
+                                        <property name="maximum_size"></property>
+                                        <property name="min_size"></property>
+                                        <property name="minimize_button">0</property>
+                                        <property name="minimum_size"></property>
+                                        <property name="moveable">1</property>
+                                        <property name="name">m_staticTextGridStyle</property>
+                                        <property name="pane_border">1</property>
+                                        <property name="pane_position"></property>
+                                        <property name="pane_size"></property>
+                                        <property name="permission">protected</property>
+                                        <property name="pin_button">1</property>
+                                        <property name="pos"></property>
+                                        <property name="resize">Resizable</property>
+                                        <property name="show">1</property>
+                                        <property name="size"></property>
+                                        <property name="style"></property>
+                                        <property name="subclass"></property>
+                                        <property name="toolbar_pane">0</property>
+                                        <property name="tooltip"></property>
+                                        <property name="window_extra_style"></property>
+                                        <property name="window_name"></property>
+                                        <property name="window_style"></property>
+                                        <property name="wrap">-1</property>
+                                        <event name="OnChar"></event>
+                                        <event name="OnEnterWindow"></event>
+                                        <event name="OnEraseBackground"></event>
+                                        <event name="OnKeyDown"></event>
+                                        <event name="OnKeyUp"></event>
+                                        <event name="OnKillFocus"></event>
+                                        <event name="OnLeaveWindow"></event>
+                                        <event name="OnLeftDClick"></event>
+                                        <event name="OnLeftDown"></event>
+                                        <event name="OnLeftUp"></event>
+                                        <event name="OnMiddleDClick"></event>
+                                        <event name="OnMiddleDown"></event>
+                                        <event name="OnMiddleUp"></event>
+                                        <event name="OnMotion"></event>
+                                        <event name="OnMouseEvents"></event>
+                                        <event name="OnMouseWheel"></event>
+                                        <event name="OnPaint"></event>
+                                        <event name="OnRightDClick"></event>
+                                        <event name="OnRightDown"></event>
+                                        <event name="OnRightUp"></event>
+                                        <event name="OnSetFocus"></event>
+                                        <event name="OnSize"></event>
+                                        <event name="OnUpdateUI"></event>
+                                    </object>
+                                </object>
+                                <object class="sizeritem" expanded="1">
+                                    <property name="border">5</property>
+                                    <property name="flag">wxALL|wxEXPAND</property>
+                                    <property name="proportion">0</property>
+                                    <object class="wxChoice" expanded="1">
+                                        <property name="BottomDockable">1</property>
+                                        <property name="LeftDockable">1</property>
+                                        <property name="RightDockable">1</property>
+                                        <property name="TopDockable">1</property>
+                                        <property name="aui_layer"></property>
+                                        <property name="aui_name"></property>
+                                        <property name="aui_position"></property>
+                                        <property name="aui_row"></property>
+                                        <property name="best_size"></property>
+                                        <property name="bg"></property>
+                                        <property name="caption"></property>
+                                        <property name="caption_visible">1</property>
+                                        <property name="center_pane">0</property>
+                                        <property name="choices">&quot;Solid shape&quot; &quot;Grid pattern&quot;</property>
+                                        <property name="close_button">1</property>
+                                        <property name="context_help"></property>
+                                        <property name="context_menu">1</property>
+                                        <property name="default_pane">0</property>
+                                        <property name="dock">Dock</property>
+                                        <property name="dock_fixed">0</property>
+                                        <property name="docking">Left</property>
+                                        <property name="enabled">1</property>
+                                        <property name="fg"></property>
+                                        <property name="floatable">1</property>
+                                        <property name="font"></property>
+                                        <property name="gripper">0</property>
+                                        <property name="hidden">0</property>
+                                        <property name="id">wxID_ANY</property>
+                                        <property name="max_size"></property>
+                                        <property name="maximize_button">0</property>
+                                        <property name="maximum_size"></property>
+                                        <property name="min_size"></property>
+                                        <property name="minimize_button">0</property>
+                                        <property name="minimum_size"></property>
+                                        <property name="moveable">1</property>
+                                        <property name="name">m_GridStyleCtrl</property>
+                                        <property name="pane_border">1</property>
+                                        <property name="pane_position"></property>
+                                        <property name="pane_size"></property>
+                                        <property name="permission">protected</property>
+                                        <property name="pin_button">1</property>
+                                        <property name="pos"></property>
+                                        <property name="resize">Resizable</property>
+                                        <property name="selection">0</property>
+                                        <property name="show">1</property>
+                                        <property name="size"></property>
+                                        <property name="style"></property>
+                                        <property name="subclass"></property>
+                                        <property name="toolbar_pane">0</property>
+                                        <property name="tooltip"></property>
+                                        <property name="validator_data_type"></property>
+                                        <property name="validator_style">wxFILTER_NONE</property>
+                                        <property name="validator_type">wxDefaultValidator</property>
+                                        <property name="validator_variable"></property>
+                                        <property name="window_extra_style"></property>
+                                        <property name="window_name"></property>
+                                        <property name="window_style"></property>
+                                        <event name="OnChar"></event>
+                                        <event name="OnChoice">OnStyleSelection</event>
+                                        <event name="OnEnterWindow"></event>
+                                        <event name="OnEraseBackground"></event>
+                                        <event name="OnKeyDown"></event>
+                                        <event name="OnKeyUp"></event>
+                                        <event name="OnKillFocus"></event>
+                                        <event name="OnLeaveWindow"></event>
+                                        <event name="OnLeftDClick"></event>
+                                        <event name="OnLeftDown"></event>
+                                        <event name="OnLeftUp"></event>
+                                        <event name="OnMiddleDClick"></event>
+                                        <event name="OnMiddleDown"></event>
+                                        <event name="OnMiddleUp"></event>
+                                        <event name="OnMotion"></event>
+                                        <event name="OnMouseEvents"></event>
+                                        <event name="OnMouseWheel"></event>
+                                        <event name="OnPaint"></event>
+                                        <event name="OnRightDClick"></event>
+                                        <event name="OnRightDown"></event>
+                                        <event name="OnRightUp"></event>
+                                        <event name="OnSetFocus"></event>
+                                        <event name="OnSize"></event>
+                                        <event name="OnUpdateUI"></event>
+                                    </object>
+                                </object>
+                                <object class="sizeritem" expanded="1">
+                                    <property name="border">5</property>
+                                    <property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
+                                    <property name="proportion">0</property>
+                                    <object class="wxStaticText" expanded="1">
+                                        <property name="BottomDockable">1</property>
+                                        <property name="LeftDockable">1</property>
+                                        <property name="RightDockable">1</property>
+                                        <property name="TopDockable">1</property>
+                                        <property name="aui_layer"></property>
+                                        <property name="aui_name"></property>
+                                        <property name="aui_position"></property>
+                                        <property name="aui_row"></property>
+                                        <property name="best_size"></property>
+                                        <property name="bg"></property>
+                                        <property name="caption"></property>
+                                        <property name="caption_visible">1</property>
+                                        <property name="center_pane">0</property>
+                                        <property name="close_button">1</property>
+                                        <property name="context_help"></property>
+                                        <property name="context_menu">1</property>
+                                        <property name="default_pane">0</property>
+                                        <property name="dock">Dock</property>
+                                        <property name="dock_fixed">0</property>
+                                        <property name="docking">Left</property>
+                                        <property name="enabled">1</property>
+                                        <property name="fg"></property>
+                                        <property name="floatable">1</property>
+                                        <property name="font"></property>
+                                        <property name="gripper">0</property>
+                                        <property name="hidden">0</property>
+                                        <property name="id">wxID_ANY</property>
+                                        <property name="label">Grid style: thickness</property>
+                                        <property name="max_size"></property>
+                                        <property name="maximize_button">0</property>
+                                        <property name="maximum_size"></property>
+                                        <property name="min_size"></property>
+                                        <property name="minimize_button">0</property>
+                                        <property name="minimum_size"></property>
+                                        <property name="moveable">1</property>
+                                        <property name="name">m_staticTextGrindThickness</property>
+                                        <property name="pane_border">1</property>
+                                        <property name="pane_position"></property>
+                                        <property name="pane_size"></property>
+                                        <property name="permission">protected</property>
+                                        <property name="pin_button">1</property>
+                                        <property name="pos"></property>
+                                        <property name="resize">Resizable</property>
+                                        <property name="show">1</property>
+                                        <property name="size"></property>
+                                        <property name="style"></property>
+                                        <property name="subclass"></property>
+                                        <property name="toolbar_pane">0</property>
+                                        <property name="tooltip"></property>
+                                        <property name="window_extra_style"></property>
+                                        <property name="window_name"></property>
+                                        <property name="window_style"></property>
+                                        <property name="wrap">-1</property>
+                                        <event name="OnChar"></event>
+                                        <event name="OnEnterWindow"></event>
+                                        <event name="OnEraseBackground"></event>
+                                        <event name="OnKeyDown"></event>
+                                        <event name="OnKeyUp"></event>
+                                        <event name="OnKillFocus"></event>
+                                        <event name="OnLeaveWindow"></event>
+                                        <event name="OnLeftDClick"></event>
+                                        <event name="OnLeftDown"></event>
+                                        <event name="OnLeftUp"></event>
+                                        <event name="OnMiddleDClick"></event>
+                                        <event name="OnMiddleDown"></event>
+                                        <event name="OnMiddleUp"></event>
+                                        <event name="OnMotion"></event>
+                                        <event name="OnMouseEvents"></event>
+                                        <event name="OnMouseWheel"></event>
+                                        <event name="OnPaint"></event>
+                                        <event name="OnRightDClick"></event>
+                                        <event name="OnRightDown"></event>
+                                        <event name="OnRightUp"></event>
+                                        <event name="OnSetFocus"></event>
+                                        <event name="OnSize"></event>
+                                        <event name="OnUpdateUI"></event>
+                                    </object>
+                                </object>
+                                <object class="sizeritem" expanded="1">
+                                    <property name="border">5</property>
+                                    <property name="flag">wxALL|wxEXPAND</property>
+                                    <property name="proportion">0</property>
+                                    <object class="wxTextCtrl" expanded="1">
+                                        <property name="BottomDockable">1</property>
+                                        <property name="LeftDockable">1</property>
+                                        <property name="RightDockable">1</property>
+                                        <property name="TopDockable">1</property>
+                                        <property name="aui_layer"></property>
+                                        <property name="aui_name"></property>
+                                        <property name="aui_position"></property>
+                                        <property name="aui_row"></property>
+                                        <property name="best_size"></property>
+                                        <property name="bg"></property>
+                                        <property name="caption"></property>
+                                        <property name="caption_visible">1</property>
+                                        <property name="center_pane">0</property>
+                                        <property name="close_button">1</property>
+                                        <property name="context_help"></property>
+                                        <property name="context_menu">1</property>
+                                        <property name="default_pane">0</property>
+                                        <property name="dock">Dock</property>
+                                        <property name="dock_fixed">0</property>
+                                        <property name="docking">Left</property>
+                                        <property name="enabled">1</property>
+                                        <property name="fg"></property>
+                                        <property name="floatable">1</property>
+                                        <property name="font"></property>
+                                        <property name="gripper">0</property>
+                                        <property name="hidden">0</property>
+                                        <property name="id">wxID_ANY</property>
+                                        <property name="max_size"></property>
+                                        <property name="maximize_button">0</property>
+                                        <property name="maximum_size"></property>
+                                        <property name="maxlength"></property>
+                                        <property name="min_size"></property>
+                                        <property name="minimize_button">0</property>
+                                        <property name="minimum_size"></property>
+                                        <property name="moveable">1</property>
+                                        <property name="name">m_tcGridStyleThickness</property>
+                                        <property name="pane_border">1</property>
+                                        <property name="pane_position"></property>
+                                        <property name="pane_size"></property>
+                                        <property name="permission">protected</property>
+                                        <property name="pin_button">1</property>
+                                        <property name="pos"></property>
+                                        <property name="resize">Resizable</property>
+                                        <property name="show">1</property>
+                                        <property name="size"></property>
+                                        <property name="style"></property>
+                                        <property name="subclass"></property>
+                                        <property name="toolbar_pane">0</property>
+                                        <property name="tooltip"></property>
+                                        <property name="validator_data_type"></property>
+                                        <property name="validator_style">wxFILTER_NONE</property>
+                                        <property name="validator_type">wxDefaultValidator</property>
+                                        <property name="validator_variable"></property>
+                                        <property name="value"></property>
+                                        <property name="window_extra_style"></property>
+                                        <property name="window_name"></property>
+                                        <property name="window_style"></property>
+                                        <event name="OnChar"></event>
+                                        <event name="OnEnterWindow"></event>
+                                        <event name="OnEraseBackground"></event>
+                                        <event name="OnKeyDown"></event>
+                                        <event name="OnKeyUp"></event>
+                                        <event name="OnKillFocus"></event>
+                                        <event name="OnLeaveWindow"></event>
+                                        <event name="OnLeftDClick"></event>
+                                        <event name="OnLeftDown"></event>
+                                        <event name="OnLeftUp"></event>
+                                        <event name="OnMiddleDClick"></event>
+                                        <event name="OnMiddleDown"></event>
+                                        <event name="OnMiddleUp"></event>
+                                        <event name="OnMotion"></event>
+                                        <event name="OnMouseEvents"></event>
+                                        <event name="OnMouseWheel"></event>
+                                        <event name="OnPaint"></event>
+                                        <event name="OnRightDClick"></event>
+                                        <event name="OnRightDown"></event>
+                                        <event name="OnRightUp"></event>
+                                        <event name="OnSetFocus"></event>
+                                        <event name="OnSize"></event>
+                                        <event name="OnText"></event>
+                                        <event name="OnTextEnter"></event>
+                                        <event name="OnTextMaxLen"></event>
+                                        <event name="OnTextURL"></event>
+                                        <event name="OnUpdateUI"></event>
+                                    </object>
+                                </object>
+                                <object class="sizeritem" expanded="1">
+                                    <property name="border">5</property>
+                                    <property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
+                                    <property name="proportion">0</property>
+                                    <object class="wxStaticText" expanded="1">
+                                        <property name="BottomDockable">1</property>
+                                        <property name="LeftDockable">1</property>
+                                        <property name="RightDockable">1</property>
+                                        <property name="TopDockable">1</property>
+                                        <property name="aui_layer"></property>
+                                        <property name="aui_name"></property>
+                                        <property name="aui_position"></property>
+                                        <property name="aui_row"></property>
+                                        <property name="best_size"></property>
+                                        <property name="bg"></property>
+                                        <property name="caption"></property>
+                                        <property name="caption_visible">1</property>
+                                        <property name="center_pane">0</property>
+                                        <property name="close_button">1</property>
+                                        <property name="context_help"></property>
+                                        <property name="context_menu">1</property>
+                                        <property name="default_pane">0</property>
+                                        <property name="dock">Dock</property>
+                                        <property name="dock_fixed">0</property>
+                                        <property name="docking">Left</property>
+                                        <property name="enabled">1</property>
+                                        <property name="fg"></property>
+                                        <property name="floatable">1</property>
+                                        <property name="font"></property>
+                                        <property name="gripper">0</property>
+                                        <property name="hidden">0</property>
+                                        <property name="id">wxID_ANY</property>
+                                        <property name="label">Grid style: grid size</property>
+                                        <property name="max_size"></property>
+                                        <property name="maximize_button">0</property>
+                                        <property name="maximum_size"></property>
+                                        <property name="min_size"></property>
+                                        <property name="minimize_button">0</property>
+                                        <property name="minimum_size"></property>
+                                        <property name="moveable">1</property>
+                                        <property name="name">m_staticTextStyleSize</property>
+                                        <property name="pane_border">1</property>
+                                        <property name="pane_position"></property>
+                                        <property name="pane_size"></property>
+                                        <property name="permission">protected</property>
+                                        <property name="pin_button">1</property>
+                                        <property name="pos"></property>
+                                        <property name="resize">Resizable</property>
+                                        <property name="show">1</property>
+                                        <property name="size"></property>
+                                        <property name="style"></property>
+                                        <property name="subclass"></property>
+                                        <property name="toolbar_pane">0</property>
+                                        <property name="tooltip"></property>
+                                        <property name="window_extra_style"></property>
+                                        <property name="window_name"></property>
+                                        <property name="window_style"></property>
+                                        <property name="wrap">-1</property>
+                                        <event name="OnChar"></event>
+                                        <event name="OnEnterWindow"></event>
+                                        <event name="OnEraseBackground"></event>
+                                        <event name="OnKeyDown"></event>
+                                        <event name="OnKeyUp"></event>
+                                        <event name="OnKillFocus"></event>
+                                        <event name="OnLeaveWindow"></event>
+                                        <event name="OnLeftDClick"></event>
+                                        <event name="OnLeftDown"></event>
+                                        <event name="OnLeftUp"></event>
+                                        <event name="OnMiddleDClick"></event>
+                                        <event name="OnMiddleDown"></event>
+                                        <event name="OnMiddleUp"></event>
+                                        <event name="OnMotion"></event>
+                                        <event name="OnMouseEvents"></event>
+                                        <event name="OnMouseWheel"></event>
+                                        <event name="OnPaint"></event>
+                                        <event name="OnRightDClick"></event>
+                                        <event name="OnRightDown"></event>
+                                        <event name="OnRightUp"></event>
+                                        <event name="OnSetFocus"></event>
+                                        <event name="OnSize"></event>
+                                        <event name="OnUpdateUI"></event>
+                                    </object>
+                                </object>
+                                <object class="sizeritem" expanded="1">
+                                    <property name="border">5</property>
+                                    <property name="flag">wxALL|wxEXPAND</property>
+                                    <property name="proportion">0</property>
+                                    <object class="wxTextCtrl" expanded="1">
+                                        <property name="BottomDockable">1</property>
+                                        <property name="LeftDockable">1</property>
+                                        <property name="RightDockable">1</property>
+                                        <property name="TopDockable">1</property>
+                                        <property name="aui_layer"></property>
+                                        <property name="aui_name"></property>
+                                        <property name="aui_position"></property>
+                                        <property name="aui_row"></property>
+                                        <property name="best_size"></property>
+                                        <property name="bg"></property>
+                                        <property name="caption"></property>
+                                        <property name="caption_visible">1</property>
+                                        <property name="center_pane">0</property>
+                                        <property name="close_button">1</property>
+                                        <property name="context_help"></property>
+                                        <property name="context_menu">1</property>
+                                        <property name="default_pane">0</property>
+                                        <property name="dock">Dock</property>
+                                        <property name="dock_fixed">0</property>
+                                        <property name="docking">Left</property>
+                                        <property name="enabled">1</property>
+                                        <property name="fg"></property>
+                                        <property name="floatable">1</property>
+                                        <property name="font"></property>
+                                        <property name="gripper">0</property>
+                                        <property name="hidden">0</property>
+                                        <property name="id">wxID_ANY</property>
+                                        <property name="max_size"></property>
+                                        <property name="maximize_button">0</property>
+                                        <property name="maximum_size"></property>
+                                        <property name="maxlength"></property>
+                                        <property name="min_size"></property>
+                                        <property name="minimize_button">0</property>
+                                        <property name="minimum_size"></property>
+                                        <property name="moveable">1</property>
+                                        <property name="name">m_tcGridStyleSize</property>
+                                        <property name="pane_border">1</property>
+                                        <property name="pane_position"></property>
+                                        <property name="pane_size"></property>
+                                        <property name="permission">protected</property>
+                                        <property name="pin_button">1</property>
+                                        <property name="pos"></property>
+                                        <property name="resize">Resizable</property>
+                                        <property name="show">1</property>
+                                        <property name="size"></property>
+                                        <property name="style"></property>
+                                        <property name="subclass"></property>
+                                        <property name="toolbar_pane">0</property>
+                                        <property name="tooltip"></property>
+                                        <property name="validator_data_type"></property>
+                                        <property name="validator_style">wxFILTER_NONE</property>
+                                        <property name="validator_type">wxDefaultValidator</property>
+                                        <property name="validator_variable"></property>
+                                        <property name="value"></property>
+                                        <property name="window_extra_style"></property>
+                                        <property name="window_name"></property>
+                                        <property name="window_style"></property>
+                                        <event name="OnChar"></event>
+                                        <event name="OnEnterWindow"></event>
+                                        <event name="OnEraseBackground"></event>
+                                        <event name="OnKeyDown"></event>
+                                        <event name="OnKeyUp"></event>
+                                        <event name="OnKillFocus"></event>
+                                        <event name="OnLeaveWindow"></event>
+                                        <event name="OnLeftDClick"></event>
+                                        <event name="OnLeftDown"></event>
+                                        <event name="OnLeftUp"></event>
+                                        <event name="OnMiddleDClick"></event>
+                                        <event name="OnMiddleDown"></event>
+                                        <event name="OnMiddleUp"></event>
+                                        <event name="OnMotion"></event>
+                                        <event name="OnMouseEvents"></event>
+                                        <event name="OnMouseWheel"></event>
+                                        <event name="OnPaint"></event>
+                                        <event name="OnRightDClick"></event>
+                                        <event name="OnRightDown"></event>
+                                        <event name="OnRightUp"></event>
+                                        <event name="OnSetFocus"></event>
+                                        <event name="OnSize"></event>
+                                        <event name="OnText"></event>
+                                        <event name="OnTextEnter"></event>
+                                        <event name="OnTextMaxLen"></event>
+                                        <event name="OnTextURL"></event>
+                                        <event name="OnUpdateUI"></event>
+                                    </object>
+                                </object>
                                 <object class="sizeritem" expanded="1">
                                     <property name="border">5</property>
                                     <property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
diff --git a/pcbnew/dialogs/dialog_non_copper_zones_properties_base.h b/pcbnew/dialogs/dialog_non_copper_zones_properties_base.h
index dd42509..0db7073 100644
--- a/pcbnew/dialogs/dialog_non_copper_zones_properties_base.h
+++ b/pcbnew/dialogs/dialog_non_copper_zones_properties_base.h
@@ -2,7 +2,7 @@
 // C++ code generated with wxFormBuilder (version Oct 30 2017)
 // http://www.wxformbuilder.org/
 //
-// PLEASE DO *NOT* EDIT THIS FILE!
+// PLEASE DO "NOT" EDIT THIS FILE!
 ///////////////////////////////////////////////////////////////////////////
 
 #ifndef __DIALOG_NON_COPPER_ZONES_PROPERTIES_BASE_H__
@@ -11,6 +11,9 @@
 #include <wx/artprov.h>
 #include <wx/xrc/xmlres.h>
 #include <wx/intl.h>
+class DIALOG_SHIM;
+class wxListView;
+
 #include "dialog_shim.h"
 #include <wx/string.h>
 #include <wx/stattext.h>
@@ -22,6 +25,7 @@
 #include <wx/sizer.h>
 #include <wx/radiobox.h>
 #include <wx/statbox.h>
+#include <wx/choice.h>
 #include <wx/textctrl.h>
 #include <wx/statline.h>
 #include <wx/button.h>
@@ -38,6 +42,7 @@ class DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE : public DIALOG_SHIM
 	private:
 		
 		// Private event handlers
+		void _wxFB_OnStyleSelection( wxCommandEvent& event ){ OnStyleSelection( event ); }
 		void _wxFB_OnCancelClick( wxCommandEvent& event ){ OnCancelClick( event ); }
 		void _wxFB_OnOkClick( wxCommandEvent& event ){ OnOkClick( event ); }
 		
@@ -47,6 +52,12 @@ class DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE : public DIALOG_SHIM
 		wxListView* m_LayerSelectionCtrl;
 		wxRadioBox* m_OrientEdgesOpt;
 		wxRadioBox* m_OutlineAppearanceCtrl;
+		wxStaticText* m_staticTextGridStyle;
+		wxChoice* m_GridStyleCtrl;
+		wxStaticText* m_staticTextGrindThickness;
+		wxTextCtrl* m_tcGridStyleThickness;
+		wxStaticText* m_staticTextStyleSize;
+		wxTextCtrl* m_tcGridStyleSize;
 		wxStaticText* m_MinThicknessValueTitle;
 		wxTextCtrl* m_ZoneMinThicknessCtrl;
 		wxStaticLine* m_staticline1;
@@ -55,13 +66,14 @@ class DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE : public DIALOG_SHIM
 		wxButton* m_sdbSizerButtonsCancel;
 		
 		// Virtual event handlers, overide them in your derived class
+		virtual void OnStyleSelection( wxCommandEvent& event ) { event.Skip(); }
 		virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
 		virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
 		
 	
 	public:
 		
-		DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Non Copper Zones Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER ); 
+		DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Non Copper Zones Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 571,299 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER ); 
 		~DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE();
 	
 };
diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp
index eef47d7..a7b1e8e 100644
--- a/pcbnew/kicad_plugin.cpp
+++ b/pcbnew/kicad_plugin.cpp
@@ -1692,9 +1692,18 @@ void PCB_IO::format( ZONE_CONTAINER* aZone, int aNestLevel ) const
     m_out->Print( 0, " (clearance %s))\n",
                   FMT_IU( aZone->GetZoneClearance() ).c_str() );
 
-    m_out->Print( aNestLevel+1, "(min_thickness %s)\n",
+    m_out->Print( aNestLevel+1, "(min_thickness %s)",
                   FMT_IU( aZone->GetMinThickness() ).c_str() );
 
+    if( aZone->GetFillMode() == ZFM_GRID_PATTERN )
+    {
+        m_out->Print( 0, " (pattern_thickness %s) (pattern_gap %s)",
+                         FMT_IU( aZone->GetGridPatternThickness() ).c_str(),
+                         FMT_IU( aZone->GetGridPatternGap() ).c_str() );
+    }
+
+    m_out->Print( 0, "\n" );
+
     if( aZone->GetIsKeepout() )
     {
         m_out->Print( aNestLevel+1, "(keepout (tracks %s) (vias %s) (copperpour %s))\n",
@@ -1710,8 +1719,10 @@ void PCB_IO::format( ZONE_CONTAINER* aZone, int aNestLevel ) const
         m_out->Print( 0, " yes" );
 
     // Default is polygon filled.
-    if( aZone->GetFillMode() )
+    if( aZone->GetFillMode() == ZFM_SEGMENTS )
         m_out->Print( 0, " (mode segment)" );
+    else if( aZone->GetFillMode() == ZFM_GRID_PATTERN )
+        m_out->Print( 0, " (mode grid_pattern)" );
 
     m_out->Print( 0, " (arc_segments %d) (thermal_gap %s) (thermal_bridge_width %s)",
                   aZone->GetArcSegmentCount(),
diff --git a/pcbnew/pcb_parser.cpp b/pcbnew/pcb_parser.cpp
index 1de9777..d1176d9 100644
--- a/pcbnew/pcb_parser.cpp
+++ b/pcbnew/pcb_parser.cpp
@@ -2944,6 +2944,16 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER()
             NeedRIGHT();
             break;
 
+        case T_pattern_thickness:
+            zone->SetGridPatternThickness( parseBoardUnits( T_min_thickness ) );
+            NeedRIGHT();
+            break;
+
+        case T_pattern_gap:
+            zone->SetGridPatternGap( parseBoardUnits( T_min_thickness ) );
+            NeedRIGHT();
+            break;
+
         case T_fill:
             for( token = NextTok();  token != T_RIGHT;  token = NextTok() )
             {
@@ -2959,11 +2969,15 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER()
                 case T_mode:
                     token = NextTok();
 
-                    if( token != T_segment && token != T_polygon )
-                        Expecting( "segment or polygon" );
+                    if( token != T_segment && token != T_grid_pattern && token != T_polygon )
+                        Expecting( "segment, grid_pattern or polygon" );
 
-                    // @todo Create an enum for fill modes.
-                    zone->SetFillMode( token == T_polygon ? ZFM_POLYGONS : ZFM_SEGMENTS );
+                    if( token == T_segment )    // deprecated
+                        zone->SetFillMode( ZFM_SEGMENTS );
+                    else if( token == T_grid_pattern )
+                        zone->SetFillMode( ZFM_GRID_PATTERN );
+                    else
+                        zone->SetFillMode( ZFM_POLYGONS );
                     NeedRIGHT();
                     break;
 
@@ -3138,7 +3152,7 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER()
     {
         if( !zone->IsOnCopperLayer() )
         {
-            zone->SetFillMode( ZFM_POLYGONS );
+            //zone->SetFillMode( ZFM_POLYGONS );
             zone->SetNetCode( NETINFO_LIST::UNCONNECTED );
         }
 
diff --git a/pcbnew/zone_filler.cpp b/pcbnew/zone_filler.cpp
index 32a98fd..4f25ffb 100644
--- a/pcbnew/zone_filler.cpp
+++ b/pcbnew/zone_filler.cpp
@@ -61,7 +61,7 @@ extern void CreateThermalReliefPadPolygon( SHAPE_POLY_SET& aCornerBuffer,
         double aCorrectionFactor,
         double aThermalRot );
 
-static double s_thermalRot = 450;    // angle of stubs in thermal reliefs for round pads
+static double s_thermalRot = 450;   // angle of stubs in thermal reliefs for round pads
 static const bool s_DumpZonesWhenFilling = false;
 
 ZONE_FILLER::ZONE_FILLER(  BOARD* aBoard, COMMIT* aCommit ) :
@@ -717,6 +717,9 @@ void ZONE_FILLER::computeRawFilledAreas( const ZONE_CONTAINER* aZone,
     // needed by Gerber files and Fracture()
     solidAreas.BooleanSubtract( holes, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
 
+    if( aZone->GetFillMode() == ZFM_GRID_PATTERN )
+        addGridPatternOnZone( aZone, solidAreas );
+
     if( s_DumpZonesWhenFilling )
         dumper->Write( &solidAreas, "solid-areas-minus-holes" );
 
@@ -728,6 +731,16 @@ void ZONE_FILLER::computeRawFilledAreas( const ZONE_CONTAINER* aZone,
 
     aFinalPolys = areas_fractured;
 
+    if( !aZone->IsOnCopperLayer() )
+    {
+        aRawPolys = aFinalPolys;
+
+        if( s_DumpZonesWhenFilling )
+            dumper->EndGroup();
+
+        return;
+    }
+
     SHAPE_POLY_SET thermalHoles;
 
     // Test thermal stubs connections and add polygons to remove unconnected stubs.
@@ -783,6 +796,7 @@ bool ZONE_FILLER::fillSingleZone( const ZONE_CONTAINER* aZone, SHAPE_POLY_SET& a
     if ( !aZone->BuildSmoothedPoly( smoothedPoly ) )
         return false;
 
+#if 0
     if( aZone->IsOnCopperLayer() )
     {
         computeRawFilledAreas( aZone, smoothedPoly, aRawPolys, aFinalPolys );
@@ -794,7 +808,9 @@ bool ZONE_FILLER::fillSingleZone( const ZONE_CONTAINER* aZone, SHAPE_POLY_SET& a
         aFinalPolys.Inflate( -aZone->GetMinThickness() / 2, 16 );
         aFinalPolys.Fracture( SHAPE_POLY_SET::PM_FAST );
     }
-
+#else
+    computeRawFilledAreas( aZone, smoothedPoly, aRawPolys, aFinalPolys );
+#endif
     return true;
 }
 
@@ -1134,3 +1150,60 @@ void ZONE_FILLER::buildUnconnectedThermalStubsPolygonList( SHAPE_POLY_SET& aCorn
         }
     }
 }
+
+
+void ZONE_FILLER::addGridPatternOnZone( const ZONE_CONTAINER* aZone, SHAPE_POLY_SET& aRawPolys ) const
+{
+    // Build grid:
+
+    // obvously line thickness must be > zone min thickness. However, it should be
+    // the case because the zonz dialog setup ensure that. However, it can happens
+    // if a board file was edited by hand by a python script
+    int thickness = std::max( aZone->GetGridPatternThickness(), aZone->GetMinThickness()+2 );
+    int linethickness = thickness - aZone->GetMinThickness();
+    int gridsize = thickness + aZone->GetGridPatternGap();
+
+    SHAPE_POLY_SET filledPolys = aRawPolys;
+    BOX2I bbox = aRawPolys.BBox( 0 );
+
+    // Build holes
+    SHAPE_POLY_SET holes;
+
+    for( int xx = 0; ; xx++ )
+    {
+        int xpos = xx * gridsize;
+
+        if( xpos > bbox.GetWidth() )
+            break;
+
+        for( int yy = 0; ; yy++ )
+        {
+            int ypos = yy * gridsize;
+
+            if( ypos > bbox.GetHeight() )
+                break;
+
+            // Generate hole
+            holes.NewOutline();
+            VECTOR2I corner( xpos, ypos );;
+            holes.Append( corner );
+            corner.x += gridsize - linethickness;
+            holes.Append( corner );
+            corner.y += gridsize - linethickness;
+            holes.Append( corner );
+            corner.x = xpos;
+            holes.Append( corner );
+        }
+    }
+
+    holes.Move( bbox.GetPosition() );
+
+    // Clamp holes to the area of filled zones with a outline thickness
+    // > aZone->GetMinThickness() to be sure the thermal pads can be built
+    int outline_margin = std::max( (aZone->GetMinThickness()*10)/9, linethickness/2 );
+    filledPolys.Inflate( -outline_margin, 16 );
+    holes.BooleanIntersection( filledPolys, SHAPE_POLY_SET::PM_FAST );
+
+    // create grid
+    aRawPolys.BooleanSubtract( aRawPolys, holes, SHAPE_POLY_SET::PM_FAST );
+}
diff --git a/pcbnew/zone_filler.h b/pcbnew/zone_filler.h
index 2bd4b5d..b3150f1 100644
--- a/pcbnew/zone_filler.h
+++ b/pcbnew/zone_filler.h
@@ -116,6 +116,15 @@ private:
             SHAPE_POLY_SET& aRawPolys,
             SHAPE_POLY_SET& aFinalPolys ) const;
 
+    /**
+     * for zones having the ZONE_FILL_MODE::ZFM_GRID_PATTERN, create a grid pattern
+     * in filled areas of aZone, giving to the filled polygons a fill style like a grid
+     * @param aZone is the zone to modify
+     * @param aRawPolys: A reference to a SHAPE_POLY_SET buffer containing the initial
+     * filled areas, and after adding the grid pattern, the modified filled areas with holes
+     */
+    void addGridPatternOnZone( const ZONE_CONTAINER* aZone, SHAPE_POLY_SET& aRawPolys ) const;
+
     BOARD* m_board;
     COMMIT* m_commit;
     PROGRESS_REPORTER* m_progressReporter;
diff --git a/pcbnew/zone_settings.cpp b/pcbnew/zone_settings.cpp
index 3f2db00..f8986c5 100644
--- a/pcbnew/zone_settings.cpp
+++ b/pcbnew/zone_settings.cpp
@@ -43,6 +43,8 @@ ZONE_SETTINGS::ZONE_SETTINGS()
     m_ZoneClearance      = Mils2iu( ZONE_CLEARANCE_MIL );
     // Min thickness value in filled areas (this is the minimum width of copper to fill solid areas) :
     m_ZoneMinThickness   = Mils2iu( ZONE_THICKNESS_MIL );
+    m_ZoneGridPatternThickness = 0;   // good value if m_FillMode = ZFM_POLYGONS
+    m_ZoneGridPatternGap = 0;           // good value if m_FillMode = ZFM_POLYGONS
     m_NetcodeSelection   = 0;                                   // Net code selection for the current zone
     m_CurrentZone_Layer  = F_Cu;                                // Layer used to create the current zone
     m_Zone_HatchingStyle = ZONE_CONTAINER::DIAGONAL_EDGE;       // Option to show the zone area (outlines only, short hatches or full hatches
@@ -76,6 +78,8 @@ ZONE_SETTINGS& ZONE_SETTINGS::operator << ( const ZONE_CONTAINER& aSource )
     m_FillMode           = aSource.GetFillMode();
     m_ZoneClearance      = aSource.GetZoneClearance();
     m_ZoneMinThickness   = aSource.GetMinThickness();
+    m_ZoneGridPatternThickness = aSource.GetGridPatternThickness();
+    m_ZoneGridPatternGap  = aSource.GetGridPatternGap();
     m_NetcodeSelection   = aSource.GetNetCode();
     m_Zone_HatchingStyle = aSource.GetHatchStyle();
     m_ArcToSegmentsCount = aSource.GetArcSegmentCount();
@@ -102,6 +106,8 @@ void ZONE_SETTINGS::ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport ) c
     aTarget.SetFillMode( m_FillMode );
     aTarget.SetZoneClearance( m_ZoneClearance );
     aTarget.SetMinThickness( m_ZoneMinThickness );
+    aTarget.SetGridPatternThickness( m_ZoneGridPatternThickness );
+    aTarget.SetGridPatternGap( m_ZoneGridPatternGap );
     aTarget.SetArcSegmentCount( m_ArcToSegmentsCount );
     aTarget.SetThermalReliefGap( m_ThermalReliefGap );
     aTarget.SetThermalReliefCopperBridge( m_ThermalReliefCopperBridge );
diff --git a/pcbnew/zone_settings.h b/pcbnew/zone_settings.h
index 4fbe985..47dfd11 100644
--- a/pcbnew/zone_settings.h
+++ b/pcbnew/zone_settings.h
@@ -36,8 +36,9 @@
 
 enum ZONE_FILL_MODE
 {
-    ZFM_POLYGONS = 0, // fill zone with polygons
-    ZFM_SEGMENTS = 1  // fill zone with segments (legacy)
+    ZFM_POLYGONS = 0,       // fill zone with polygons
+    ZFM_SEGMENTS = 1,       // fill zone with segments (legacy)
+    ZFM_GRID_PATTERN = 2,   // fill zone using a grid pattern
 };
 
 /**
@@ -62,6 +63,9 @@ public:
 
     int  m_ZoneClearance;               ///< Clearance value
     int  m_ZoneMinThickness;            ///< Min thickness value in filled areas
+    int  m_ZoneGridPatternThickness;    ///< Grid style shape: thickness of lines (if 0 -> solid shape)
+    int  m_ZoneGridPatternGap;         ///< Grid style shape: clearance between lines (0 -> solid shape)
+
     int  m_NetcodeSelection;            ///< Net code selection for the current zone
 
     LSET m_Layers;
diff --git a/pcbnew/zones_by_polygon.cpp b/pcbnew/zones_by_polygon.cpp
index 6ee19f6..af3f3ad 100644
--- a/pcbnew/zones_by_polygon.cpp
+++ b/pcbnew/zones_by_polygon.cpp
@@ -894,13 +894,12 @@ void PCB_EDIT_FRAME::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* aZone )
     else if( IsCopperLayer( aZone->GetLayer() ) )
     {
         // edit a zone on a copper layer
-
         zoneInfo << *aZone;
-
         edited = InvokeCopperZonesEditor( this, &zoneInfo );
     }
     else
     {
+        zoneInfo << *aZone;
         edited = InvokeNonCopperZonesEditor( this, aZone, &zoneInfo );
     }
 
-- 
1.9.5.msysgit.1


Follow ups