From e0351b4e4c2b09c4bbf6ca0c71a439412c592a03 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 13 Aug 2020 10:01:23 +0200 Subject: [PATCH] Zone filler: make new algo (no thickness for filled outlines) the default Add also a message info to the pcbnew constraints panel for arc to segment approx min error value. --- pcbnew/board_design_settings.cpp | 4 +- .../panel_setup_feature_constraints.cpp | 5 + .../panel_setup_feature_constraints_base.cpp | 21 ++- .../panel_setup_feature_constraints_base.fbp | 138 +++++++++++++++++- .../panel_setup_feature_constraints_base.h | 4 +- 5 files changed, 163 insertions(+), 9 deletions(-) diff --git a/pcbnew/board_design_settings.cpp b/pcbnew/board_design_settings.cpp index 3b5ac565ed..ff30df4c96 100644 --- a/pcbnew/board_design_settings.cpp +++ b/pcbnew/board_design_settings.cpp @@ -157,7 +157,7 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS( JSON_SETTINGS* aParent, const std: m_DRCSeverities[ DRCE_EXTRA_FOOTPRINT ] = RPT_SEVERITY_WARNING; m_MaxError = ARC_HIGH_DEF; - m_ZoneUseNoOutlineInFill = false; // Use compatibility mode by default + m_ZoneUseNoOutlineInFill = true; // Use new algo by default ti fill zones // Global mask margins: m_SolderMaskMargin = Millimeter2iu( DEFAULT_SOLDERMASK_CLEARANCE ); @@ -554,7 +554,7 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS( JSON_SETTINGS* aParent, const std: Millimeter2iu( 0.0001 ), Millimeter2iu( 1.0 ), MM_PER_IU ) ); m_params.emplace_back( - new PARAM( "zones_use_no_outline", &m_ZoneUseNoOutlineInFill, false ) ); + new PARAM( "zones_use_no_outline", &m_ZoneUseNoOutlineInFill, true ) ); } diff --git a/pcbnew/dialogs/panel_setup_feature_constraints.cpp b/pcbnew/dialogs/panel_setup_feature_constraints.cpp index 13a72c7365..e9ec535a42 100644 --- a/pcbnew/dialogs/panel_setup_feature_constraints.cpp +++ b/pcbnew/dialogs/panel_setup_feature_constraints.cpp @@ -54,6 +54,11 @@ PANEL_SETUP_FEATURE_CONSTRAINTS::PANEL_SETUP_FEATURE_CONSTRAINTS( PAGED_DIALOG* bool PANEL_SETUP_FEATURE_CONSTRAINTS::TransferDataToWindow() { + wxString fmt = m_stCircleToPolyWarning->GetLabel(); + m_stCircleToPolyWarning->SetLabel( wxString::Format( fmt, + StringFromValue( m_Frame->GetUserUnits(), + ARC_HIGH_DEF, true, true ) ) ); + m_OptAllowBlindBuriedVias->SetValue( m_BrdSettings->m_BlindBuriedViaAllowed ); m_OptAllowMicroVias->SetValue( m_BrdSettings->m_MicroViasAllowed ); diff --git a/pcbnew/dialogs/panel_setup_feature_constraints_base.cpp b/pcbnew/dialogs/panel_setup_feature_constraints_base.cpp index 73d191260d..9618f29914 100644 --- a/pcbnew/dialogs/panel_setup_feature_constraints_base.cpp +++ b/pcbnew/dialogs/panel_setup_feature_constraints_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version Jul 10 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -50,7 +50,7 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bSizerArcToPoly->Add( m_staticline2, 0, wxEXPAND | wxALL, 2 ); - m_stCircleToPolyOpt = new wxStaticText( this, wxID_ANY, _("Arc/circle drawing"), wxDefaultPosition, wxDefaultSize, 0 ); + m_stCircleToPolyOpt = new wxStaticText( this, wxID_ANY, _("Arc/circle approximated by segments"), wxDefaultPosition, wxDefaultSize, 0 ); m_stCircleToPolyOpt->Wrap( -1 ); m_stCircleToPolyOpt->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); @@ -63,7 +63,7 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - fgSizer2->Add( 15, 0, 1, wxEXPAND, 5 ); + fgSizer2->Add( 15, 0, 0, 0, 5 ); m_maxErrorTitle = new wxStaticText( this, wxID_ANY, _("Maximum deviation:"), wxDefaultPosition, wxDefaultSize, 0 ); m_maxErrorTitle->Wrap( -1 ); @@ -81,6 +81,21 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi bSizerArcToPoly->Add( fgSizer2, 0, wxEXPAND|wxBOTTOM, 5 ); + wxBoxSizer* bSizer8; + bSizer8 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapInfo = new wxStaticBitmap( this, wxID_ANY, wxArtProvider::GetBitmap( wxART_INFORMATION, wxART_OTHER ), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer8->Add( m_bitmapInfo, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + m_stCircleToPolyWarning = new wxStaticText( this, wxID_ANY, _("Value < %s can be time consumming\nwhen filling zones."), wxDefaultPosition, wxDefaultSize, 0 ); + m_stCircleToPolyWarning->Wrap( -1 ); + m_stCircleToPolyWarning->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); + + bSizer8->Add( m_stCircleToPolyWarning, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerArcToPoly->Add( bSizer8, 1, wxEXPAND, 5 ); + sbFeatureRules->Add( bSizerArcToPoly, 0, wxEXPAND|wxTOP, 5 ); diff --git a/pcbnew/dialogs/panel_setup_feature_constraints_base.fbp b/pcbnew/dialogs/panel_setup_feature_constraints_base.fbp index 8717110d68..7cc2aca27c 100644 --- a/pcbnew/dialogs/panel_setup_feature_constraints_base.fbp +++ b/pcbnew/dialogs/panel_setup_feature_constraints_base.fbp @@ -14,6 +14,7 @@ panel_setup_feature_constraints_base 1000 none + 1 panel_setup_feature_constraints_base @@ -25,6 +26,7 @@ 1 1 UI + 0 1 0 @@ -495,7 +497,7 @@ 0 0 wxID_ANY - Arc/circle drawing + Arc/circle approximated by segments 0 0 @@ -542,8 +544,8 @@ 3 5 - wxEXPAND - 1 + + 0 0 protected @@ -738,6 +740,136 @@ + + 5 + wxEXPAND + 1 + + + bSizer8 + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + Load From Art Provider; wxART_INFORMATION; wxART_OTHER + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_bitmapInfo + 1 + + + protected + 1 + + Resizable + 1 + + ; ; forward_declare + 0 + + + + + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + ,90,90,-1,70,0 + 0 + 0 + wxID_ANY + Value < %s can be time consumming when filling zones. + 0 + + 0 + + + 0 + + 1 + m_stCircleToPolyWarning + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + diff --git a/pcbnew/dialogs/panel_setup_feature_constraints_base.h b/pcbnew/dialogs/panel_setup_feature_constraints_base.h index 37c70b6c03..a19a68663d 100644 --- a/pcbnew/dialogs/panel_setup_feature_constraints_base.h +++ b/pcbnew/dialogs/panel_setup_feature_constraints_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version Jul 10 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -48,6 +48,8 @@ class PANEL_SETUP_FEATURE_CONSTRAINTS_BASE : public wxPanel wxStaticText* m_maxErrorTitle; wxTextCtrl* m_maxErrorCtrl; wxStaticText* m_maxErrorUnits; + wxStaticBitmap* m_bitmapInfo; + wxStaticText* m_stCircleToPolyWarning; wxBoxSizer* m_bSizerPolygonFillOption; wxStaticLine* m_staticline1; wxStaticText* m_stZoneFilledPolysOpt;