From ef10b36948fd859dd11ad077696c26750b26e4ca Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 22 Aug 2021 23:05:47 +0100 Subject: [PATCH] Add mask-to-copper clearance parameter and rename mask margin. --- .../3d_canvas/create_3Dgraphic_brd_items.cpp | 4 +- cvpcb/display_footprints_frame.cpp | 6 +- include/board_design_settings.h | 41 ++- pcbnew/board.h | 3 + pcbnew/board_design_settings.cpp | 28 +- .../dialogs/dialog_footprint_properties.cpp | 2 - .../dialog_footprint_properties_base.cpp | 18 +- .../dialog_footprint_properties_base.fbp | 132 +------- .../dialog_footprint_properties_base.h | 2 - .../dialog_footprint_properties_fp_editor.cpp | 2 - ...og_footprint_properties_fp_editor_base.cpp | 18 +- ...og_footprint_properties_fp_editor_base.fbp | 132 +------- ...alog_footprint_properties_fp_editor_base.h | 2 - pcbnew/dialogs/dialog_pad_properties.cpp | 2 - pcbnew/dialogs/dialog_pad_properties_base.cpp | 12 +- pcbnew/dialogs/dialog_pad_properties_base.fbp | 4 +- pcbnew/dialogs/dialog_pad_properties_base.h | 2 - pcbnew/dialogs/dialog_plot.cpp | 4 +- pcbnew/dialogs/panel_setup_mask_and_paste.cpp | 14 +- pcbnew/dialogs/panel_setup_mask_and_paste.h | 3 +- .../panel_setup_mask_and_paste_base.cpp | 36 ++- .../panel_setup_mask_and_paste_base.fbp | 287 +++++++++++++++++- .../dialogs/panel_setup_mask_and_paste_base.h | 4 + pcbnew/drc/drc_test_provider_solder_mask.cpp | 75 +++-- pcbnew/footprint.cpp | 4 +- pcbnew/footprint_edit_frame.cpp | 6 +- pcbnew/footprint_viewer_frame.cpp | 2 +- pcbnew/pad.cpp | 8 +- pcbnew/pad.h | 4 +- pcbnew/pcb_painter.cpp | 2 +- pcbnew/pcb_track.cpp | 50 ++- pcbnew/pcb_track.h | 3 + pcbnew/plot_board_layers.cpp | 16 +- pcbnew/plugins/kicad/pcb_parser.cpp | 2 +- pcbnew/plugins/kicad/pcb_plugin.cpp | 2 +- pcbnew/plugins/legacy/legacy_plugin.cpp | 2 +- 36 files changed, 492 insertions(+), 442 deletions(-) diff --git a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp index cca7d15664..261a8a3cdd 100644 --- a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp +++ b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp @@ -540,8 +540,8 @@ void BOARD_ADAPTER::addPadsWithClearance( const FOOTPRINT* aFootprint, { case F_Mask: case B_Mask: - margin.x += pad->GetSolderMaskMargin(); - margin.y += pad->GetSolderMaskMargin(); + margin.x += pad->GetSolderMaskExpansion(); + margin.y += pad->GetSolderMaskExpansion(); break; case F_Paste: diff --git a/cvpcb/display_footprints_frame.cpp b/cvpcb/display_footprints_frame.cpp index 541f15d86b..9b957c9859 100644 --- a/cvpcb/display_footprints_frame.cpp +++ b/cvpcb/display_footprints_frame.cpp @@ -88,9 +88,9 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aPa EDA_DRAW_PANEL_GAL::GAL_FALLBACK ); SetCanvas( gal_drawPanel ); - // Don't show the default board solder mask clearance. Only the - // footprint or pad clearance setting should be shown if it is not 0. - GetBoard()->GetDesignSettings().m_SolderMaskMargin = 0; + // Don't show the default board solder mask expansion. Only the footprint or pad expansion + // settings should be shown. + GetBoard()->GetDesignSettings().m_SolderMaskExpansion = 0; LoadSettings( config() ); diff --git a/include/board_design_settings.h b/include/board_design_settings.h index 37ca720770..f1da3763ca 100644 --- a/include/board_design_settings.h +++ b/include/board_design_settings.h @@ -50,28 +50,24 @@ #define DEFAULT_COPPER_TEXT_WIDTH 0.30 #define DEFAULT_TEXT_WIDTH 0.15 -#define DEFAULT_DIMENSION_ARROW_LENGTH 50 // mils, for legacy purposes -#define DEFAULT_DIMENSION_EXTENSION_OFFSET 0.5 +#define DEFAULT_DIMENSION_ARROW_LENGTH 50 // mils, for legacy purposes +#define DEFAULT_DIMENSION_EXTENSION_OFFSET 0.5 // Board thickness, mainly for 3D view: -#define DEFAULT_BOARD_THICKNESS_MM 1.6 +#define DEFAULT_BOARD_THICKNESS_MM 1.6 -#define DEFAULT_PCB_EDGE_THICKNESS 0.15 +#define DEFAULT_PCB_EDGE_THICKNESS 0.15 // soldermask to pad clearance. The default is 0 because usually board houses -// create a clearance depending on their fab process: -// mask material, color, price ... -#define DEFAULT_SOLDERMASK_CLEARANCE 0.0 +// create a clearance depending on their fab process: mask material, color, price, etc. +#define DEFAULT_SOLDERMASK_EXPANSION 0.0 -// DEFAULT_SOLDERMASK_MIN_WIDTH is only used in Gerber files: soldermask minimum size. -// Set to 0, because using non 0 value creates an annoying issue in Gerber files: -// pads are no longer identified as pads (Flashed items or regions) -// Therefore solder mask min width must be used only in specific cases -// for instance for home made boards -#define DEFAULT_SOLDERMASK_MIN_WIDTH 0.0 +#define DEFAULT_SOLDERMASK_TO_COPPER_CLEARANCE 0.0 -#define DEFAULT_SOLDERPASTE_CLEARANCE 0.0 -#define DEFAULT_SOLDERPASTE_RATIO 0.0 +#define DEFAULT_SOLDERMASK_MIN_WIDTH 0.0 + +#define DEFAULT_SOLDERPASTE_CLEARANCE 0.0 +#define DEFAULT_SOLDERPASTE_RATIO 0.0 #define DEFAULT_CUSTOMTRACKWIDTH 0.2 #define DEFAULT_CUSTOMDPAIRWIDTH 0.125 @@ -713,12 +709,15 @@ public: int m_MaxError; // Global mask margins: - int m_SolderMaskMargin; // Solder mask margin - int m_SolderMaskMinWidth; // Solder mask min width (2 areas closer than this - // width are merged) - int m_SolderPasteMargin; // Solder paste margin absolute value - double m_SolderPasteMarginRatio; // Solder mask margin ratio value of pad size - // The final margin is the sum of these 2 values + int m_SolderMaskExpansion; // Solder mask inflation around the pad or via + int m_SolderMaskMinWidth; // Solder mask min width (2 areas closer than this + // width are merged) + int m_SolderMaskToCopperClearance; // Min distance allowed from copper to a mask + // aperture of another net + + int m_SolderPasteMargin; // Solder paste margin absolute value + double m_SolderPasteMarginRatio; // Solder mask margin ratio value of pad size + // The final margin is the sum of these 2 values // Variables used in footprint editing (default value in item/footprint creation) std::vector m_DefaultFPTextItems; diff --git a/pcbnew/board.h b/pcbnew/board.h index d82ce2b0c2..1080bc9b2c 100644 --- a/pcbnew/board.h +++ b/pcbnew/board.h @@ -533,6 +533,9 @@ public: void SetZoneSettings( const ZONE_SETTINGS& aSettings ) override; + bool GetTentVias() const { return !m_plotOptions.GetPlotViaOnMaskLayer(); } + void SetTentVias( bool aFlag ) { m_plotOptions.SetPlotViaOnMaskLayer( !aFlag ); } + const PAGE_INFO& GetPageSettings() const { return m_paper; } void SetPageSettings( const PAGE_INFO& aPageSettings ) { m_paper = aPageSettings; } diff --git a/pcbnew/board_design_settings.cpp b/pcbnew/board_design_settings.cpp index d5e78d4a06..d93753166f 100644 --- a/pcbnew/board_design_settings.cpp +++ b/pcbnew/board_design_settings.cpp @@ -186,8 +186,9 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS( JSON_SETTINGS* aParent, const std: m_UseHeightForLengthCalcs = true; // Global mask margins: - m_SolderMaskMargin = Millimeter2iu( DEFAULT_SOLDERMASK_CLEARANCE ); + m_SolderMaskExpansion = Millimeter2iu( DEFAULT_SOLDERMASK_EXPANSION ); m_SolderMaskMinWidth = Millimeter2iu( DEFAULT_SOLDERMASK_MIN_WIDTH ); + m_SolderMaskToCopperClearance = Millimeter2iu( DEFAULT_SOLDERMASK_TO_COPPER_CLEARANCE ); // Solder paste margin absolute value m_SolderPasteMargin = Millimeter2iu( DEFAULT_SOLDERPASTE_CLEARANCE ); @@ -609,8 +610,12 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS( JSON_SETTINGS* aParent, const std: } }, {} ) ); - m_params.emplace_back( new PARAM_SCALED( "rules.max_error", &m_MaxError, ARC_HIGH_DEF, - Millimeter2iu( 0.0001 ), Millimeter2iu( 1.0 ), MM_PER_IU ) ); + m_params.emplace_back( new PARAM_SCALED( "rules.max_error", + &m_MaxError, ARC_HIGH_DEF, Millimeter2iu( 0.0001 ), Millimeter2iu( 1.0 ), MM_PER_IU ) ); + + m_params.emplace_back( new PARAM_SCALED( "rules.solder_mask_to_copper_clearance", + &m_SolderMaskToCopperClearance, Millimeter2iu( DEFAULT_SOLDERMASK_TO_COPPER_CLEARANCE ), + Millimeter2iu( 0.0 ), Millimeter2iu( 25.0 ), MM_PER_IU ) ); // TODO: replace with zones_fill_version parameter and migrate zones_use_no_outline? m_params.emplace_back( new PARAM_LAMBDA( "zones_use_no_outline", @@ -636,7 +641,7 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS( JSON_SETTINGS* aParent, const std: // The parameters are removed, so we just have to manually load them here and // they will get saved with the board if( OPT optval = Get( "rules.solder_mask_clearance" ) ) - m_SolderMaskMargin = static_cast( *optval * IU_PER_MM ); + m_SolderMaskExpansion = static_cast( *optval * IU_PER_MM ); if( OPT optval = Get( "rules.solder_mask_min_width" ) ) m_SolderMaskMinWidth = static_cast( *optval * IU_PER_MM ); @@ -714,13 +719,14 @@ void BOARD_DESIGN_SETTINGS::initFromOther( const BOARD_DESIGN_SETTINGS& aOther ) m_DRCSeverities = aOther.m_DRCSeverities; m_DrcExclusions = aOther.m_DrcExclusions; m_ZoneFillVersion = aOther.m_ZoneFillVersion; - m_ZoneKeepExternalFillets= aOther.m_ZoneKeepExternalFillets; - m_MaxError = aOther.m_MaxError; - m_SolderMaskMargin = aOther.m_SolderMaskMargin; - m_SolderMaskMinWidth = aOther.m_SolderMaskMinWidth; - m_SolderPasteMargin = aOther.m_SolderPasteMargin; - m_SolderPasteMarginRatio = aOther.m_SolderPasteMarginRatio; - m_DefaultFPTextItems = aOther.m_DefaultFPTextItems; + m_ZoneKeepExternalFillets = aOther.m_ZoneKeepExternalFillets; + m_MaxError = aOther.m_MaxError; + m_SolderMaskExpansion = aOther.m_SolderMaskExpansion; + m_SolderMaskMinWidth = aOther.m_SolderMaskMinWidth; + m_SolderMaskToCopperClearance = aOther.m_SolderMaskToCopperClearance; + m_SolderPasteMargin = aOther.m_SolderPasteMargin; + m_SolderPasteMarginRatio = aOther.m_SolderPasteMarginRatio; + m_DefaultFPTextItems = aOther.m_DefaultFPTextItems; std::copy( std::begin( aOther.m_LineThickness ), std::end( aOther.m_LineThickness ), std::begin( m_LineThickness ) ); diff --git a/pcbnew/dialogs/dialog_footprint_properties.cpp b/pcbnew/dialogs/dialog_footprint_properties.cpp index 7967fdfc8d..08d6933b30 100644 --- a/pcbnew/dialogs/dialog_footprint_properties.cpp +++ b/pcbnew/dialogs/dialog_footprint_properties.cpp @@ -119,8 +119,6 @@ DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParen m_tcLibraryID->SetFont( infoFont ); infoFont.SetStyle( wxFONTSTYLE_ITALIC ); - m_staticTextInfoValNeg->SetFont( infoFont ); - m_staticTextInfoValPos->SetFont( infoFont ); m_staticTextInfoCopper->SetFont( infoFont ); m_staticTextInfoPaste->SetFont( infoFont ); diff --git a/pcbnew/dialogs/dialog_footprint_properties_base.cpp b/pcbnew/dialogs/dialog_footprint_properties_base.cpp index b871e3b785..b242057a48 100644 --- a/pcbnew/dialogs/dialog_footprint_properties_base.cpp +++ b/pcbnew/dialogs/dialog_footprint_properties_base.cpp @@ -314,15 +314,7 @@ DIALOG_FOOTPRINT_PROPERTIES_BASE::DIALOG_FOOTPRINT_PROPERTIES_BASE( wxWindow* pa m_staticTextInfo = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("Set values to 0 to use Board Setup values."), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextInfo->Wrap( -1 ); - sbSizerLocalProperties->Add( m_staticTextInfo, 0, wxLEFT|wxRIGHT, 5 ); - - m_staticTextInfoValPos = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("Positive clearance means area bigger than the pad (usual for mask clearance)."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextInfoValPos->Wrap( -1 ); - sbSizerLocalProperties->Add( m_staticTextInfoValPos, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); - - m_staticTextInfoValNeg = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("Negative clearance means area smaller than the pad (usual for paste clearance)."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextInfoValNeg->Wrap( -1 ); - sbSizerLocalProperties->Add( m_staticTextInfoValNeg, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + sbSizerLocalProperties->Add( m_staticTextInfo, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); wxGridBagSizer* gbSizer2; gbSizer2 = new wxGridBagSizer( 4, 0 ); @@ -343,7 +335,7 @@ DIALOG_FOOTPRINT_PROPERTIES_BASE::DIALOG_FOOTPRINT_PROPERTIES_BASE( wxWindow* pa m_NetClearanceUnits->Wrap( -1 ); gbSizer2->Add( m_NetClearanceUnits, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - m_SolderMaskMarginLabel = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("Solder mask clearance:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_SolderMaskMarginLabel = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("Solder mask expansion:"), wxDefaultPosition, wxDefaultSize, 0 ); m_SolderMaskMarginLabel->Wrap( -1 ); m_SolderMaskMarginLabel->SetToolTip( _("This is the local clearance between pads and the solder mask for this footprint.\nThis value can be superseded by a pad local value.\nIf 0, the global value is used.") ); @@ -376,14 +368,14 @@ DIALOG_FOOTPRINT_PROPERTIES_BASE::DIALOG_FOOTPRINT_PROPERTIES_BASE( wxWindow* pa m_PasteMarginRatioLabel->Wrap( -1 ); m_PasteMarginRatioLabel->SetToolTip( _("This is the local clearance ratio in percent between pads and the solder paste for this footprint.\nA value of 10 means the clearance value is 10 percent of the pad size.\nThis value can be superseded by a pad local value.\nThe final clearance value is the sum of this value and the clearance value.\nA negative value means a smaller mask size than pad size.") ); - gbSizer2->Add( m_PasteMarginRatioLabel, wxGBPosition( 6, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + gbSizer2->Add( m_PasteMarginRatioLabel, wxGBPosition( 6, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_PasteMarginRatioCtrl = new TEXT_CTRL_EVAL( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - gbSizer2->Add( m_PasteMarginRatioCtrl, wxGBPosition( 6, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); + gbSizer2->Add( m_PasteMarginRatioCtrl, wxGBPosition( 6, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); m_PasteMarginRatioUnits = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 ); m_PasteMarginRatioUnits->Wrap( -1 ); - gbSizer2->Add( m_PasteMarginRatioUnits, wxGBPosition( 6, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + gbSizer2->Add( m_PasteMarginRatioUnits, wxGBPosition( 6, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); sbSizerLocalProperties->Add( gbSizer2, 1, wxEXPAND|wxTOP|wxBOTTOM, 10 ); diff --git a/pcbnew/dialogs/dialog_footprint_properties_base.fbp b/pcbnew/dialogs/dialog_footprint_properties_base.fbp index 178cb7d29e..f89b487c7e 100644 --- a/pcbnew/dialogs/dialog_footprint_properties_base.fbp +++ b/pcbnew/dialogs/dialog_footprint_properties_base.fbp @@ -2586,7 +2586,7 @@ none 5 - wxLEFT|wxRIGHT + wxBOTTOM|wxRIGHT|wxLEFT 0 1 @@ -2645,128 +2645,6 @@ -1 - - 5 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Positive clearance means area bigger than the pad (usual for mask clearance). - 0 - - 0 - - - 0 - - 1 - m_staticTextInfoValPos - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxBOTTOM|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Negative clearance means area smaller than the pad (usual for paste clearance). - 0 - - 0 - - - 0 - - 1 - m_staticTextInfoValNeg - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - 10 wxEXPAND|wxTOP|wxBOTTOM @@ -3012,7 +2890,7 @@ 0 0 wxID_ANY - Solder mask clearance: + Solder mask expansion: 0 0 @@ -3438,7 +3316,7 @@ 5 1 0 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT 6 1 @@ -3502,7 +3380,7 @@ 5 1 1 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxBOTTOM 6 1 @@ -3569,7 +3447,7 @@ 5 1 2 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT 6 1 diff --git a/pcbnew/dialogs/dialog_footprint_properties_base.h b/pcbnew/dialogs/dialog_footprint_properties_base.h index 0121d575df..be21cc9b4f 100644 --- a/pcbnew/dialogs/dialog_footprint_properties_base.h +++ b/pcbnew/dialogs/dialog_footprint_properties_base.h @@ -91,8 +91,6 @@ class DIALOG_FOOTPRINT_PROPERTIES_BASE : public DIALOG_SHIM wxCheckBox* m_excludeFromBOM; wxPanel* m_PanelClearances; wxStaticText* m_staticTextInfo; - wxStaticText* m_staticTextInfoValPos; - wxStaticText* m_staticTextInfoValNeg; wxStaticText* m_NetClearanceLabel; wxTextCtrl* m_NetClearanceCtrl; wxStaticText* m_NetClearanceUnits; diff --git a/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp b/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp index 3e7813690b..e798fc3ea9 100644 --- a/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp +++ b/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp @@ -108,8 +108,6 @@ DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR( #endif infoFont.SetStyle( wxFONTSTYLE_ITALIC ); - m_staticTextInfoValNeg->SetFont( infoFont ); - m_staticTextInfoValPos->SetFont( infoFont ); m_staticTextInfoCopper->SetFont( infoFont ); m_staticTextInfoPaste->SetFont( infoFont ); diff --git a/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.cpp b/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.cpp index d9f38ce089..5aee6a4fee 100644 --- a/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.cpp +++ b/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.cpp @@ -214,15 +214,7 @@ DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR_BASE::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITO m_staticTextInfo = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("Set values to 0 to use netclass values."), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextInfo->Wrap( -1 ); - sbSizerLocalProperties->Add( m_staticTextInfo, 0, wxLEFT|wxRIGHT, 5 ); - - m_staticTextInfoValPos = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("Positive clearance means area bigger than the pad (usual for mask clearance)."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextInfoValPos->Wrap( -1 ); - sbSizerLocalProperties->Add( m_staticTextInfoValPos, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); - - m_staticTextInfoValNeg = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("Negative clearance means area smaller than the pad (usual for paste clearance)."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextInfoValNeg->Wrap( -1 ); - sbSizerLocalProperties->Add( m_staticTextInfoValNeg, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + sbSizerLocalProperties->Add( m_staticTextInfo, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); wxGridBagSizer* gbSizer1; gbSizer1 = new wxGridBagSizer( 4, 0 ); @@ -243,7 +235,7 @@ DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR_BASE::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITO m_NetClearanceUnits->Wrap( -1 ); gbSizer1->Add( m_NetClearanceUnits, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - m_SolderMaskMarginLabel = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("Solder mask clearance:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_SolderMaskMarginLabel = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("Solder mask expansion:"), wxDefaultPosition, wxDefaultSize, 0 ); m_SolderMaskMarginLabel->Wrap( -1 ); m_SolderMaskMarginLabel->SetToolTip( _("This is the local clearance between pads and the solder mask for \nthis footprint.\nIf 0, the global value is used.\nThis value can be overridden on a pad-by-pad basis in the Local\nClearance and Settings tab of Pad Properties.") ); @@ -276,14 +268,14 @@ DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR_BASE::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITO m_PasteMarginRatioLabel->Wrap( -1 ); m_PasteMarginRatioLabel->SetToolTip( _("This is the local clearance ratio in percent between pads and the\nsolder paste for this footprint.\nA value of 10 means the clearance value is 10 percent of the pad size.\nThe final clearance value is the sum of this value and the clearance value.\nA negative value means a smaller mask size than pad size.\nThis value can be overridden on a pad-by-pad basis in the Local\nClearance and Settings tab of Pad Properties.") ); - gbSizer1->Add( m_PasteMarginRatioLabel, wxGBPosition( 6, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + gbSizer1->Add( m_PasteMarginRatioLabel, wxGBPosition( 6, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_PasteMarginRatioCtrl = new TEXT_CTRL_EVAL( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - gbSizer1->Add( m_PasteMarginRatioCtrl, wxGBPosition( 6, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); + gbSizer1->Add( m_PasteMarginRatioCtrl, wxGBPosition( 6, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); m_PasteMarginRatioUnits = new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 ); m_PasteMarginRatioUnits->Wrap( -1 ); - gbSizer1->Add( m_PasteMarginRatioUnits, wxGBPosition( 6, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + gbSizer1->Add( m_PasteMarginRatioUnits, wxGBPosition( 6, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); sbSizerLocalProperties->Add( gbSizer1, 0, wxEXPAND|wxTOP|wxBOTTOM, 10 ); diff --git a/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.fbp b/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.fbp index 6b83893394..72b435f539 100644 --- a/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.fbp +++ b/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.fbp @@ -1584,7 +1584,7 @@ none 5 - wxLEFT|wxRIGHT + wxBOTTOM|wxRIGHT|wxLEFT 0 1 @@ -1643,128 +1643,6 @@ -1 - - 5 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Positive clearance means area bigger than the pad (usual for mask clearance). - 0 - - 0 - - - 0 - - 1 - m_staticTextInfoValPos - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxBOTTOM|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Negative clearance means area smaller than the pad (usual for paste clearance). - 0 - - 0 - - - 0 - - 1 - m_staticTextInfoValNeg - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - 10 wxEXPAND|wxTOP|wxBOTTOM @@ -2010,7 +1888,7 @@ 0 0 wxID_ANY - Solder mask clearance: + Solder mask expansion: 0 0 @@ -2436,7 +2314,7 @@ 5 1 0 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT 6 1 @@ -2500,7 +2378,7 @@ 5 1 1 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxBOTTOM 6 1 @@ -2567,7 +2445,7 @@ 5 1 2 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT 6 1 diff --git a/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.h b/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.h index 8cc9d5f44a..7c6ed23e63 100644 --- a/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.h +++ b/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.h @@ -73,8 +73,6 @@ class DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR_BASE : public DIALOG_SHIM wxCheckBox* m_excludeFromBOM; wxPanel* m_PanelClearances; wxStaticText* m_staticTextInfo; - wxStaticText* m_staticTextInfoValPos; - wxStaticText* m_staticTextInfoValNeg; wxStaticText* m_NetClearanceLabel; wxTextCtrl* m_NetClearanceCtrl; wxStaticText* m_NetClearanceUnits; diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index 5786d3f48c..022a5edb16 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -212,8 +212,6 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, PAD* aPad infoFont.SetStyle( wxFONTSTYLE_ITALIC ); m_nonCopperNote->SetFont( infoFont ); m_staticTextInfoPaste->SetFont( infoFont ); - m_staticTextInfoNegVal->SetFont( infoFont ); - m_staticTextInfoPosValue->SetFont( infoFont ); m_staticTextPrimitiveListWarning->SetFont( infoFont ); // Do not allow locking items in the footprint editor diff --git a/pcbnew/dialogs/dialog_pad_properties_base.cpp b/pcbnew/dialogs/dialog_pad_properties_base.cpp index b7fe7ce5bb..cb395626c8 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.cpp +++ b/pcbnew/dialogs/dialog_pad_properties_base.cpp @@ -584,15 +584,7 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind wxStaticText* m_staticTextHint; m_staticTextHint = new wxStaticText( sbClearancesSizer->GetStaticBox(), wxID_ANY, _("Set values to 0 to use parent footprint or netclass values."), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextHint->Wrap( -1 ); - sbClearancesSizer->Add( m_staticTextHint, 0, wxRIGHT, 10 ); - - m_staticTextInfoPosValue = new wxStaticText( sbClearancesSizer->GetStaticBox(), wxID_ANY, _("Positive clearance means area bigger than the pad (usual for mask clearance)."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextInfoPosValue->Wrap( -1 ); - sbClearancesSizer->Add( m_staticTextInfoPosValue, 0, wxTOP|wxRIGHT, 10 ); - - m_staticTextInfoNegVal = new wxStaticText( sbClearancesSizer->GetStaticBox(), wxID_ANY, _("Negative clearance means area smaller than the pad (usual for paste clearance)."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextInfoNegVal->Wrap( -1 ); - sbClearancesSizer->Add( m_staticTextInfoNegVal, 0, wxBOTTOM|wxRIGHT, 10 ); + sbClearancesSizer->Add( m_staticTextHint, 0, wxBOTTOM|wxRIGHT, 10 ); wxFlexGridSizer* fgClearancesGridSizer; fgClearancesGridSizer = new wxFlexGridSizer( 4, 3, 4, 0 ); @@ -613,7 +605,7 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind m_clearanceUnits->Wrap( -1 ); fgClearancesGridSizer->Add( m_clearanceUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - m_maskMarginLabel = new wxStaticText( sbClearancesSizer->GetStaticBox(), wxID_ANY, _("Solder mask clearance:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_maskMarginLabel = new wxStaticText( sbClearancesSizer->GetStaticBox(), wxID_ANY, _("Solder mask expansion:"), wxDefaultPosition, wxDefaultSize, 0 ); m_maskMarginLabel->Wrap( -1 ); m_maskMarginLabel->SetToolTip( _("This is the local clearance between this pad and the solder mask.\nIf 0, the footprint local value or the global value is used.") ); diff --git a/pcbnew/dialogs/dialog_pad_properties_base.fbp b/pcbnew/dialogs/dialog_pad_properties_base.fbp index 98d0a258cb..e087f3fe36 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.fbp +++ b/pcbnew/dialogs/dialog_pad_properties_base.fbp @@ -6967,7 +6967,7 @@ none 10 - wxRIGHT + wxBOTTOM|wxRIGHT 0 1 @@ -7383,7 +7383,7 @@ 0 0 wxID_ANY - Solder mask clearance: + Solder mask expansion: 0 0 diff --git a/pcbnew/dialogs/dialog_pad_properties_base.h b/pcbnew/dialogs/dialog_pad_properties_base.h index 2be017dafd..716822cce5 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.h +++ b/pcbnew/dialogs/dialog_pad_properties_base.h @@ -170,8 +170,6 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM wxStaticText* m_staticTextFabProperty; wxChoice* m_choiceFabProperty; wxPanel* m_localSettingsPanel; - wxStaticText* m_staticTextInfoPosValue; - wxStaticText* m_staticTextInfoNegVal; wxStaticText* m_clearanceLabel; wxTextCtrl* m_clearanceCtrl; wxStaticText* m_clearanceUnits; diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp index 348d62ca4e..262c6b7f54 100644 --- a/pcbnew/dialogs/dialog_plot.cpp +++ b/pcbnew/dialogs/dialog_plot.cpp @@ -261,7 +261,7 @@ void DIALOG_PLOT::reInitDialog() const BOARD_DESIGN_SETTINGS& brd_settings = board->GetDesignSettings(); if( getPlotFormat() == PLOT_FORMAT::GERBER && - ( brd_settings.m_SolderMaskMargin || brd_settings.m_SolderMaskMinWidth ) ) + ( brd_settings.m_SolderMaskExpansion || brd_settings.m_SolderMaskMinWidth ) ) { m_PlotOptionsSizer->Show( m_SizerSolderMaskAlert ); } @@ -434,7 +434,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) const BOARD_DESIGN_SETTINGS& brd_settings = board->GetDesignSettings(); if( getPlotFormat() == PLOT_FORMAT::GERBER - && ( brd_settings.m_SolderMaskMargin || brd_settings.m_SolderMaskMinWidth ) ) + && ( brd_settings.m_SolderMaskExpansion || brd_settings.m_SolderMaskMinWidth ) ) { m_PlotOptionsSizer->Show( m_SizerSolderMaskAlert ); } diff --git a/pcbnew/dialogs/panel_setup_mask_and_paste.cpp b/pcbnew/dialogs/panel_setup_mask_and_paste.cpp index ec555b0e37..b6403ab482 100644 --- a/pcbnew/dialogs/panel_setup_mask_and_paste.cpp +++ b/pcbnew/dialogs/panel_setup_mask_and_paste.cpp @@ -32,8 +32,10 @@ PANEL_SETUP_MASK_AND_PASTE::PANEL_SETUP_MASK_AND_PASTE( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFrame ) : PANEL_SETUP_MASK_AND_PASTE_BASE( aParent->GetTreebook() ), - m_maskMargin( aFrame, m_maskMarginLabel, m_maskMarginCtrl, m_maskMarginUnits ), + m_maskExpansion( aFrame, m_maskMarginLabel, m_maskMarginCtrl, m_maskMarginUnits ), m_maskMinWidth( aFrame, m_maskMinWidthLabel, m_maskMinWidthCtrl, m_maskMinWidthUnits ), + m_maskToCopperClearance( aFrame, m_maskToCopperClearanceLabel, m_maskToCopperClearanceCtrl, + m_maskToCopperClearanceUnits ), m_pasteMargin( aFrame, m_pasteMarginLabel, m_pasteMarginCtrl, m_pasteMarginUnits ), m_pasteMarginRatio( aFrame, m_pasteMarginRatioLabel, m_pasteMarginRatioCtrl, m_pasteMarginRatioUnits ) @@ -52,8 +54,11 @@ PANEL_SETUP_MASK_AND_PASTE::PANEL_SETUP_MASK_AND_PASTE( PAGED_DIALOG* aParent, bool PANEL_SETUP_MASK_AND_PASTE::TransferDataToWindow() { - m_maskMargin.SetValue( m_BrdSettings->m_SolderMaskMargin ); + m_maskExpansion.SetValue( m_BrdSettings->m_SolderMaskExpansion ); m_maskMinWidth.SetValue( m_BrdSettings->m_SolderMaskMinWidth ); + m_maskToCopperClearance.SetValue( m_BrdSettings->m_SolderMaskToCopperClearance ); + m_tentVias->SetValue( m_Frame->GetBoard()->GetTentVias() ); + m_pasteMargin.SetValue( m_BrdSettings->m_SolderPasteMargin ); m_pasteMarginRatio.SetDoubleValue( m_BrdSettings->m_SolderPasteMarginRatio * 100.0 ); @@ -64,8 +69,11 @@ bool PANEL_SETUP_MASK_AND_PASTE::TransferDataToWindow() bool PANEL_SETUP_MASK_AND_PASTE::TransferDataFromWindow() { // These are all stored in project file, not board, so no need for OnModify() - m_BrdSettings->m_SolderMaskMargin = m_maskMargin.GetValue(); + m_BrdSettings->m_SolderMaskExpansion = m_maskExpansion.GetValue(); m_BrdSettings->m_SolderMaskMinWidth = m_maskMinWidth.GetValue(); + m_BrdSettings->m_SolderMaskToCopperClearance = m_maskToCopperClearance.GetValue(); + m_Frame->GetBoard()->SetTentVias( m_tentVias->GetValue() ); + m_BrdSettings->m_SolderPasteMargin = m_pasteMargin.GetValue(); m_BrdSettings->m_SolderPasteMarginRatio = m_pasteMarginRatio.GetDoubleValue() / 100.0; diff --git a/pcbnew/dialogs/panel_setup_mask_and_paste.h b/pcbnew/dialogs/panel_setup_mask_and_paste.h index 6f78ed0109..2319cddd79 100644 --- a/pcbnew/dialogs/panel_setup_mask_and_paste.h +++ b/pcbnew/dialogs/panel_setup_mask_and_paste.h @@ -41,8 +41,9 @@ private: PCB_EDIT_FRAME* m_Frame; BOARD_DESIGN_SETTINGS* m_BrdSettings; - UNIT_BINDER m_maskMargin; + UNIT_BINDER m_maskExpansion; UNIT_BINDER m_maskMinWidth; + UNIT_BINDER m_maskToCopperClearance; UNIT_BINDER m_pasteMargin; UNIT_BINDER m_pasteMarginRatio; diff --git a/pcbnew/dialogs/panel_setup_mask_and_paste_base.cpp b/pcbnew/dialogs/panel_setup_mask_and_paste_base.cpp index 0b565046e0..f38fadc53d 100644 --- a/pcbnew/dialogs/panel_setup_mask_and_paste_base.cpp +++ b/pcbnew/dialogs/panel_setup_mask_and_paste_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -29,7 +29,7 @@ PANEL_SETUP_MASK_AND_PASTE_BASE::PANEL_SETUP_MASK_AND_PASTE_BASE( wxWindow* pare wxBoxSizer* bSizer4; bSizer4 = new wxBoxSizer( wxVERTICAL ); - m_staticTextInfoMaskMinWidth = new wxStaticText( this, wxID_ANY, _("Use your board manufacturer's recommendations for solder mask clearance and minimum web width."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextInfoMaskMinWidth = new wxStaticText( this, wxID_ANY, _("Use your board manufacturer's recommendations for solder mask expansion and minimum web width."), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextInfoMaskMinWidth->Wrap( -1 ); bSizer4->Add( m_staticTextInfoMaskMinWidth, 0, wxEXPAND, 1 ); @@ -51,7 +51,7 @@ PANEL_SETUP_MASK_AND_PASTE_BASE::PANEL_SETUP_MASK_AND_PASTE_BASE( wxWindow* pare gbSizer1->SetFlexibleDirection( wxBOTH ); gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_maskMarginLabel = new wxStaticText( this, wxID_ANY, _("Solder mask clearance:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_maskMarginLabel = new wxStaticText( this, wxID_ANY, _("Solder mask expansion:"), wxDefaultPosition, wxDefaultSize, 0 ); m_maskMarginLabel->Wrap( -1 ); m_maskMarginLabel->SetToolTip( _("Global clearance between pads and the solder mask.\nThis value can be superseded by local values for a footprint or a pad.") ); @@ -81,38 +81,52 @@ PANEL_SETUP_MASK_AND_PASTE_BASE::PANEL_SETUP_MASK_AND_PASTE_BASE( wxWindow* pare m_maskMinWidthUnits->Wrap( -1 ); gbSizer1->Add( m_maskMinWidthUnits, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - m_allowBridges = new wxCheckBox( this, wxID_ANY, _("Allow bridged solder mask apertures between pads within a footprint"), wxDefaultPosition, wxDefaultSize, 0 ); - gbSizer1->Add( m_allowBridges, wxGBPosition( 2, 0 ), wxGBSpan( 1, 3 ), wxALL, 5 ); + m_maskToCopperClearanceLabel = new wxStaticText( this, wxID_ANY, _("Solder mask to copper clearance:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_maskToCopperClearanceLabel->Wrap( -1 ); + gbSizer1->Add( m_maskToCopperClearanceLabel, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + m_maskToCopperClearanceCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer1->Add( m_maskToCopperClearanceCtrl, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); + + m_maskToCopperClearanceUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_maskToCopperClearanceUnits->Wrap( -1 ); + gbSizer1->Add( m_maskToCopperClearanceUnits, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + m_allowBridges = new wxCheckBox( this, wxID_ANY, _("Allow bridged solder mask apertures between pads within footprints"), wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer1->Add( m_allowBridges, wxGBPosition( 3, 0 ), wxGBSpan( 1, 3 ), wxALL, 5 ); + + m_tentVias = new wxCheckBox( this, wxID_ANY, _("Tent vias"), wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer1->Add( m_tentVias, wxGBPosition( 4, 0 ), wxGBSpan( 1, 3 ), wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_pasteMarginLabel = new wxStaticText( this, wxID_ANY, _("Solder paste absolute clearance:"), wxDefaultPosition, wxDefaultSize, 0 ); m_pasteMarginLabel->Wrap( -1 ); m_pasteMarginLabel->SetToolTip( _("Global clearance between pads and the solder paste.\nThis value can be superseded by local values for a footprint or a pad.\nFinal clearance value is the sum of this value and the clearance value ratio.") ); - gbSizer1->Add( m_pasteMarginLabel, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + gbSizer1->Add( m_pasteMarginLabel, wxGBPosition( 6, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_pasteMarginCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_pasteMarginCtrl->SetToolTip( _("Negative clearance means area smaller than the pad (usual for solder paste clearance).") ); - gbSizer1->Add( m_pasteMarginCtrl, wxGBPosition( 4, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); + gbSizer1->Add( m_pasteMarginCtrl, wxGBPosition( 6, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); m_pasteMarginUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_pasteMarginUnits->Wrap( -1 ); - gbSizer1->Add( m_pasteMarginUnits, wxGBPosition( 4, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + gbSizer1->Add( m_pasteMarginUnits, wxGBPosition( 6, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_pasteMarginRatioLabel = new wxStaticText( this, wxID_ANY, _("Solder paste relative clearance:"), wxDefaultPosition, wxDefaultSize, 0 ); m_pasteMarginRatioLabel->Wrap( -1 ); m_pasteMarginRatioLabel->SetToolTip( _("Global clearance ratio in percent between pads and the solder paste.\nA value of 10 means the clearance value is 10 percent of the pad size.\nThis value can be superseded by local values for a footprint or a pad.\nFinal clearance value is the sum of this value and the clearance value.") ); - gbSizer1->Add( m_pasteMarginRatioLabel, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + gbSizer1->Add( m_pasteMarginRatioLabel, wxGBPosition( 7, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_pasteMarginRatioCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_pasteMarginRatioCtrl->SetToolTip( _("Additional clearance as a percentage of the pad size.") ); - gbSizer1->Add( m_pasteMarginRatioCtrl, wxGBPosition( 5, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); + gbSizer1->Add( m_pasteMarginRatioCtrl, wxGBPosition( 7, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); m_pasteMarginRatioUnits = new wxStaticText( this, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 ); m_pasteMarginRatioUnits->Wrap( -1 ); - gbSizer1->Add( m_pasteMarginRatioUnits, wxGBPosition( 5, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + gbSizer1->Add( m_pasteMarginRatioUnits, wxGBPosition( 7, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); bSizer3->Add( gbSizer1, 1, wxEXPAND|wxTOP, 5 ); diff --git a/pcbnew/dialogs/panel_setup_mask_and_paste_base.fbp b/pcbnew/dialogs/panel_setup_mask_and_paste_base.fbp index 3ae4eb6303..2b275f4235 100644 --- a/pcbnew/dialogs/panel_setup_mask_and_paste_base.fbp +++ b/pcbnew/dialogs/panel_setup_mask_and_paste_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,7 +14,6 @@ panel_setup_mask_and_paste_base 1000 none - 1 panel_setup_mask_and_paste_base @@ -26,7 +25,6 @@ 1 1 UI - 0 1 0 @@ -48,7 +46,6 @@ -1,-1 ; forward_declare - 0 wxTAB_TRAVERSAL @@ -184,7 +181,7 @@ 0 0 wxID_ANY - Use your board manufacturer's recommendations for solder mask clearance and minimum web width. + Use your board manufacturer's recommendations for solder mask expansion and minimum web width. 0 0 @@ -386,7 +383,7 @@ 0 0 wxID_ANY - Solder mask clearance: + Solder mask expansion: 0 0 @@ -741,12 +738,207 @@ -1 + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Solder mask to copper clearance: + 0 + + 0 + + + 0 + + 1 + m_maskToCopperClearanceLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + 1 + 1 + wxALIGN_CENTER_VERTICAL + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_maskToCopperClearanceCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + 1 + 2 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + 0 + + 0 + + + 0 + + 1 + m_maskToCopperClearanceUnits + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + 5 3 0 wxALL - 2 + 3 1 1 @@ -777,7 +969,7 @@ 0 0 wxID_ANY - Allow bridged solder mask apertures between pads within a footprint + Allow bridged solder mask apertures between pads within footprints 0 @@ -808,12 +1000,79 @@ + + 5 + 3 + 0 + wxBOTTOM|wxRIGHT|wxLEFT + 4 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Tent vias + + 0 + + + 0 + + 1 + m_tentVias + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + 5 1 0 wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 4 + 6 1 1 @@ -877,7 +1136,7 @@ 1 1 wxALIGN_CENTER_VERTICAL - 4 + 6 1 1 @@ -944,7 +1203,7 @@ 1 2 wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 4 + 6 1 1 @@ -1008,7 +1267,7 @@ 1 0 wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 5 + 7 1 1 @@ -1072,7 +1331,7 @@ 1 1 wxALIGN_CENTER_VERTICAL - 5 + 7 1 1 @@ -1139,7 +1398,7 @@ 1 2 wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 5 + 7 1 1 diff --git a/pcbnew/dialogs/panel_setup_mask_and_paste_base.h b/pcbnew/dialogs/panel_setup_mask_and_paste_base.h index 596d3a8d20..9365b878a8 100644 --- a/pcbnew/dialogs/panel_setup_mask_and_paste_base.h +++ b/pcbnew/dialogs/panel_setup_mask_and_paste_base.h @@ -47,7 +47,11 @@ class PANEL_SETUP_MASK_AND_PASTE_BASE : public wxPanel wxStaticText* m_maskMinWidthLabel; wxTextCtrl* m_maskMinWidthCtrl; wxStaticText* m_maskMinWidthUnits; + wxStaticText* m_maskToCopperClearanceLabel; + wxTextCtrl* m_maskToCopperClearanceCtrl; + wxStaticText* m_maskToCopperClearanceUnits; wxCheckBox* m_allowBridges; + wxCheckBox* m_tentVias; wxStaticText* m_pasteMarginLabel; wxTextCtrl* m_pasteMarginCtrl; wxStaticText* m_pasteMarginUnits; diff --git a/pcbnew/drc/drc_test_provider_solder_mask.cpp b/pcbnew/drc/drc_test_provider_solder_mask.cpp index 6a51968306..8b17511cbd 100644 --- a/pcbnew/drc/drc_test_provider_solder_mask.cpp +++ b/pcbnew/drc/drc_test_provider_solder_mask.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -125,9 +126,9 @@ void DRC_TEST_PROVIDER_SOLDER_MASK::addItemToRTrees( BOARD_ITEM* item ) if( item->IsOnLayer( layer ) ) { PAD* pad = static_cast( item ); - int clearance = ( m_webWidth / 2 ) + pad->GetSolderMaskMargin(); + int clearance = ( m_webWidth / 2 ) + pad->GetSolderMaskExpansion(); - item->TransformShapeWithClearanceToPolygon( *solderMask->GetFill( layer ), F_Cu, + item->TransformShapeWithClearanceToPolygon( *solderMask->GetFill( layer ), layer, clearance, m_maxError, ERROR_OUTSIDE ); m_itemTree->Insert( item, layer, m_largestClearance ); @@ -136,26 +137,18 @@ void DRC_TEST_PROVIDER_SOLDER_MASK::addItemToRTrees( BOARD_ITEM* item ) } else if( item->Type() == PCB_VIA_T ) { - // JEY TODO: if( !aPlotOpt.GetPlotViaOnMaskLayer() - // continue; - - // Use the global mask clearance for vias - int clearance = ( m_webWidth / 2 ) + m_board->GetDesignSettings().m_SolderMaskMargin; - - if( item->IsOnLayer( F_Cu ) ) + for( PCB_LAYER_ID layer : { F_Mask, B_Mask } ) { - item->TransformShapeWithClearanceToPolygon( *solderMask->GetFill( F_Mask ), F_Cu, - clearance, m_maxError, ERROR_OUTSIDE ); + if( item->IsOnLayer( layer ) ) + { + PCB_VIA* via = static_cast( item ); + int clearance = ( m_webWidth / 2 ) + via->GetSolderMaskExpansion(); - m_itemTree->Insert( item, F_Mask, F_Cu, m_largestClearance ); - } + item->TransformShapeWithClearanceToPolygon( *solderMask->GetFill( layer ), layer, + clearance, m_maxError, ERROR_OUTSIDE ); - if( item->IsOnLayer( B_Cu ) ) - { - item->TransformShapeWithClearanceToPolygon( *solderMask->GetFill( B_Mask ), B_Cu, - clearance, m_maxError, ERROR_OUTSIDE ); - - m_itemTree->Insert( item, B_Mask, B_Cu, m_largestClearance ); + m_itemTree->Insert( item, layer, m_largestClearance ); + } } } else @@ -240,14 +233,14 @@ void DRC_TEST_PROVIDER_SOLDER_MASK::testSilkToMaskClearance() int itemIdx = 0; forEachGeometryItem( s_allBasicItems, silkLayers, - [&]( BOARD_ITEM* item ) -> bool + [&]( BOARD_ITEM* item ) -> bool { ++itemCount; return true; } ); forEachGeometryItem( s_allBasicItems, silkLayers, - [&]( BOARD_ITEM* item ) -> bool + [&]( BOARD_ITEM* item ) -> bool { if( m_drcEngine->IsErrorLimitExceeded( DRCE_SILK_CLEARANCE ) ) return false; @@ -309,6 +302,7 @@ void DRC_TEST_PROVIDER_SOLDER_MASK::testItemAgainstItems( BOARD_ITEM* aItem, itemNet = static_cast( aItem )->GetNetCode(); PAD* pad = dynamic_cast( aItem ); + PCB_VIA* via = dynamic_cast( aItem ); std::shared_ptr itemShape = aItem->GetEffectiveShape( aRefLayer ); m_itemTree->QueryColliding( aItem, aRefLayer, aTargetLayer, @@ -348,23 +342,38 @@ void DRC_TEST_PROVIDER_SOLDER_MASK::testItemAgainstItems( BOARD_ITEM* aItem, { m_checkedPairs[ { a, b, aTargetLayer } ] = 1; return true; - // return aItemBBox.Intersects( other->GetBoundingBox() ); } }, // Visitor: [&]( BOARD_ITEM* other ) -> bool { PAD* otherPad = dynamic_cast( other ); + PCB_VIA* otherVia = dynamic_cast( other ); auto otherShape = other->GetEffectiveShape( aTargetLayer ); int actual; VECTOR2I pos; - int clearance = 0; // JEY TODO: probably need a board setting for mask registration? + int clearance = 0; + + if( aRefLayer == F_Mask || aRefLayer == B_Mask ) + { + // Aperture-to-aperture must enforce web-min-width + clearance = m_webWidth; + } + else + { + // Copper-to-aperture uses the solder-mask-to-copper-clearance + clearance = m_board->GetDesignSettings().m_SolderMaskToCopperClearance; + } if( pad ) - clearance += m_webWidth / 2 + pad->GetSolderMaskMargin(); + clearance += pad->GetSolderMaskExpansion(); + else if( via ) + clearance += via->GetSolderMaskExpansion(); if( otherPad ) - clearance += m_webWidth / 2 + otherPad->GetSolderMaskMargin(); + clearance += otherPad->GetSolderMaskExpansion(); + else if( otherVia ) + clearance += otherVia->GetSolderMaskExpansion(); if( itemShape->Collide( otherShape.get(), clearance, &actual, &pos ) ) { @@ -411,7 +420,7 @@ void DRC_TEST_PROVIDER_SOLDER_MASK::testMaskItemAgainstZones( BOARD_ITEM* aItem, if( aItem->GetBoundingBox().Intersects( zone->GetCachedBoundingBox() ) ) { DRC_RTREE* zoneTree = m_board->m_CopperZoneRTrees[ zone ].get(); - int clearance = 0; // JEY TODO: probably need a board setting for mask registration? + int clearance = m_board->GetDesignSettings().m_SolderMaskToCopperClearance; int actual; VECTOR2I pos; @@ -421,7 +430,13 @@ void DRC_TEST_PROVIDER_SOLDER_MASK::testMaskItemAgainstZones( BOARD_ITEM* aItem, { PAD* pad = static_cast( aItem ); - clearance += pad->GetSolderMaskMargin(); + clearance += pad->GetSolderMaskExpansion(); + } + else if( aItem->Type() == PCB_VIA_T ) + { + PCB_VIA* via = static_cast( aItem ); + + clearance += via->GetSolderMaskExpansion(); } if( zoneTree && zoneTree->QueryColliding( aItemBBox, itemShape.get(), aTargetLayer, @@ -458,14 +473,14 @@ void DRC_TEST_PROVIDER_SOLDER_MASK::testMaskBridges() int itemIdx = 0; forEachGeometryItem( s_allBasicItemsButZones, copperAndMaskLayers, - [&]( BOARD_ITEM* item ) -> bool + [&]( BOARD_ITEM* item ) -> bool { ++itemCount; return true; } ); forEachGeometryItem( s_allBasicItemsButZones, copperAndMaskLayers, - [&]( BOARD_ITEM* item ) -> bool + [&]( BOARD_ITEM* item ) -> bool { if( m_drcEngine->IsErrorLimitExceeded( DRCE_SOLDERMASK_BRIDGE ) ) return false; @@ -525,7 +540,7 @@ bool DRC_TEST_PROVIDER_SOLDER_MASK::Run() for( FOOTPRINT* footprint : m_board->Footprints() ) { for( PAD* pad : footprint->Pads() ) - m_largestClearance = std::max( m_largestClearance, pad->GetSolderMaskMargin() ); + m_largestClearance = std::max( m_largestClearance, pad->GetSolderMaskExpansion() ); } // Order is important here: m_webWidth must be added in before m_largestClearance is maxed diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index bee9a056d9..8298080a69 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -2295,8 +2295,8 @@ void FOOTPRINT::TransformPadsWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuff { case F_Mask: case B_Mask: - clearance.x += pad->GetSolderMaskMargin(); - clearance.y += pad->GetSolderMaskMargin(); + clearance.x += pad->GetSolderMaskExpansion(); + clearance.y += pad->GetSolderMaskExpansion(); break; case F_Paste: diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 859b884e1c..96973e84e8 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -148,9 +148,9 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : // pad specific clearance will be shown. GetBoard()->GetDesignSettings().GetDefault()->SetClearance( 0 ); - // Don't show the default board solder mask clearance in the footprint editor. Only the - // footprint or pad clearance setting should be shown if it is not 0. - GetBoard()->GetDesignSettings().m_SolderMaskMargin = 0; + // Don't show the default board solder mask expansion in the footprint editor. Only the + // footprint or pad mask expansions settings should be shown. + GetBoard()->GetDesignSettings().m_SolderMaskExpansion = 0; // restore the last footprint from the project, if any restoreLastFootprint(); diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index 2ae112a876..2837b49bc8 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -196,7 +196,7 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent // Don't show the default board solder mask clearance in the footprint viewer. Only the // footprint or pad clearance setting should be shown if it is not 0. - GetBoard()->GetDesignSettings().m_SolderMaskMargin = 0; + GetBoard()->GetDesignSettings().m_SolderMaskExpansion = 0; // Ensure all layers and items are visible: GetBoard()->SetVisibleAlls(); diff --git a/pcbnew/pad.cpp b/pcbnew/pad.cpp index 252aabbf50..8f55e2f400 100644 --- a/pcbnew/pad.cpp +++ b/pcbnew/pad.cpp @@ -725,7 +725,7 @@ int PAD::GetLocalClearance( wxString* aSource ) const } -int PAD::GetSolderMaskMargin() const +int PAD::GetSolderMaskExpansion() const { // The pad inherits the margin only to calculate a default shape, // therefore only if it is also a copper layer @@ -736,7 +736,7 @@ int PAD::GetSolderMaskMargin() const if( !isOnCopperLayer ) return 0; - int margin = m_localSolderMaskMargin; + int margin = m_localSolderMaskMargin; FOOTPRINT* parentFootprint = GetParent(); @@ -753,7 +753,7 @@ int PAD::GetSolderMaskMargin() const const BOARD* brd = GetBoard(); if( brd ) - margin = brd->GetDesignSettings().m_SolderMaskMargin; + margin = brd->GetDesignSettings().m_SolderMaskExpansion; } } @@ -1362,7 +1362,7 @@ const BOX2I PAD::ViewBBox() const { // Bounding box includes soldermask too. Remember mask and/or paste // margins can be < 0 - int solderMaskMargin = std::max( GetSolderMaskMargin(), 0 ); + int solderMaskMargin = std::max( GetSolderMaskExpansion(), 0 ); VECTOR2I solderPasteMargin = VECTOR2D( GetSolderPasteMargin() ); EDA_RECT bbox = GetBoundingBox(); diff --git a/pcbnew/pad.h b/pcbnew/pad.h index cc2b2c37d2..f795c2754b 100644 --- a/pcbnew/pad.h +++ b/pcbnew/pad.h @@ -448,7 +448,7 @@ public: int GetLocalClearanceOverrides( wxString* aSource ) const override; /** - * @return the margin for the solder mask layer + * @return the expansion for the solder mask layer * * Usually > 0 (mask shape bigger than pad). For pads **not** on copper layers, the value * is the local value because there is no default shape to build. For pads also on copper @@ -457,7 +457,7 @@ public: * 2 if 0, the parent footprint value * 3 if 0, the global value */ - int GetSolderMaskMargin() const; + int GetSolderMaskExpansion() const; /** * Usually < 0 (mask shape smaller than pad)because the margin can be dependent on the pad diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index fb69bcf4cb..f293ec2ce0 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -1079,7 +1079,7 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer ) { case F_Mask: case B_Mask: - margin.x = margin.y = aPad->GetSolderMaskMargin(); + margin.x = margin.y = aPad->GetSolderMaskExpansion(); break; case F_Paste: diff --git a/pcbnew/pcb_track.cpp b/pcbnew/pcb_track.cpp index 7c72add8b3..7698891563 100644 --- a/pcbnew/pcb_track.cpp +++ b/pcbnew/pcb_track.cpp @@ -357,36 +357,56 @@ SEARCH_RESULT PCB_TRACK::Visit( INSPECTOR inspector, void* testData, const KICAD } -bool PCB_VIA::IsOnLayer( PCB_LAYER_ID layer_number ) const +bool PCB_VIA::IsTented() const { - PCB_LAYER_ID bottom_layer, top_layer; + const BOARD* board = GetBoard(); - LayerPair( &top_layer, &bottom_layer ); - - wxASSERT( top_layer <= bottom_layer ); - - if( top_layer <= layer_number && layer_number <= bottom_layer ) - return true; + if( board ) + return board->GetTentVias(); else - return false; + return true; +} + + +int PCB_VIA::GetSolderMaskExpansion() const +{ + const BOARD* board = GetBoard(); + + if( board ) + return board->GetDesignSettings().m_SolderMaskExpansion; + else + return 0; +} + + +bool PCB_VIA::IsOnLayer( PCB_LAYER_ID aLayer ) const +{ + return GetLayerSet().test( aLayer ); } LSET PCB_VIA::GetLayerSet() const { - if( GetViaType() == VIATYPE::THROUGH ) - return LSET::AllCuMask(); - - // VIA_BLIND_BURIED or VIA_MICRVIA: - LSET layermask; - wxASSERT( m_layer <= m_bottomLayer ); + if( GetViaType() == VIATYPE::THROUGH ) + layermask = LSET::AllCuMask(); + else + wxASSERT( m_layer <= m_bottomLayer ); // PCB_LAYER_IDs are numbered from front to back, this is top to bottom. for( int id = m_layer; id <= m_bottomLayer; ++id ) layermask.set( id ); + if( !IsTented() ) + { + if( layermask.test( F_Cu ) ) + layermask.set( F_Mask ); + + if( layermask.test( B_Cu ) ) + layermask.set( B_Mask ); + } + return layermask; } diff --git a/pcbnew/pcb_track.h b/pcbnew/pcb_track.h index 1ca7629e28..03252cd423 100644 --- a/pcbnew/pcb_track.h +++ b/pcbnew/pcb_track.h @@ -352,6 +352,9 @@ public: VIATYPE GetViaType() const { return m_viaType; } void SetViaType( VIATYPE aViaType ) { m_viaType = aViaType; } + bool IsTented() const; + int GetSolderMaskExpansion() const; + bool IsOnLayer( PCB_LAYER_ID aLayer ) const override; virtual LSET GetLayerSet() const override; diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index 50f8a4f454..1c83be5c07 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -288,7 +288,7 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask, width_adj = itemplotter.getFineWidthAdj(); if( onSolderMaskLayer ) - margin.x = margin.y = pad->GetSolderMaskMargin(); + margin.x = margin.y = pad->GetSolderMaskExpansion(); if( onSolderPasteLayer ) margin = pad->GetSolderPasteMargin(); @@ -524,9 +524,8 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask, int via_margin = 0; double width_adj = 0; - // If the current layer is a solder mask, use the global mask clearance for vias if( aLayerMask[B_Mask] || aLayerMask[F_Mask] ) - via_margin = aBoard->GetDesignSettings().m_SolderMaskMargin; + via_margin = via->GetSolderMaskExpansion(); if( ( aLayerMask & LSET::AllCuMask() ).any() ) width_adj = itemplotter.getFineWidthAdj(); @@ -880,13 +879,12 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask, // Plot vias on solder masks, if aPlotOpt.GetPlotViaOnMaskLayer() is true, if( aPlotOpt.GetPlotViaOnMaskLayer() ) { - // The current layer is a solder mask, use the global mask clearance for vias - int via_clearance = aBoard->GetDesignSettings().m_SolderMaskMargin; - int via_margin = via_clearance + inflate; - for( PCB_TRACK* track : aBoard->Tracks() ) { const PCB_VIA* via = dyn_cast( track ); + int via_clearance = via->GetSolderMaskExpansion(); + int via_margin = via_clearance + inflate; + if( !via ) continue; @@ -913,8 +911,8 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask, } // Add filled zone areas. -#if 0 // Set to 1 if a solder mask margin must be applied to zones on solder mask - int zone_margin = aBoard->GetDesignSettings().m_SolderMaskMargin; +#if 0 // Set to 1 if a solder mask expansion must be applied to zones on solder mask + int zone_margin = aBoard->GetDesignSettings().m_SolderMaskExpansion; #else int zone_margin = 0; #endif diff --git a/pcbnew/plugins/kicad/pcb_parser.cpp b/pcbnew/plugins/kicad/pcb_parser.cpp index 65e8812081..de4b494f97 100644 --- a/pcbnew/plugins/kicad/pcb_parser.cpp +++ b/pcbnew/plugins/kicad/pcb_parser.cpp @@ -2024,7 +2024,7 @@ void PCB_PARSER::parseSetup() } case T_pad_to_mask_clearance: - designSettings.m_SolderMaskMargin = parseBoardUnits( T_pad_to_mask_clearance ); + designSettings.m_SolderMaskExpansion = parseBoardUnits( T_pad_to_mask_clearance ); NeedRIGHT(); break; diff --git a/pcbnew/plugins/kicad/pcb_plugin.cpp b/pcbnew/plugins/kicad/pcb_plugin.cpp index 9e31be1810..f9c5c89b09 100644 --- a/pcbnew/plugins/kicad/pcb_plugin.cpp +++ b/pcbnew/plugins/kicad/pcb_plugin.cpp @@ -486,7 +486,7 @@ void PCB_PLUGIN::formatSetup( const BOARD* aBoard, int aNestLevel ) const BOARD_DESIGN_SETTINGS& dsnSettings = aBoard->GetDesignSettings(); m_out->Print( aNestLevel+1, "(pad_to_mask_clearance %s)\n", - FormatInternalUnits( dsnSettings.m_SolderMaskMargin ).c_str() ); + FormatInternalUnits( dsnSettings.m_SolderMaskExpansion ).c_str() ); if( dsnSettings.m_SolderMaskMinWidth ) m_out->Print( aNestLevel+1, "(solder_mask_min_width %s)\n", diff --git a/pcbnew/plugins/legacy/legacy_plugin.cpp b/pcbnew/plugins/legacy/legacy_plugin.cpp index 9f1a45047d..ba40a691cb 100644 --- a/pcbnew/plugins/legacy/legacy_plugin.cpp +++ b/pcbnew/plugins/legacy/legacy_plugin.cpp @@ -1039,7 +1039,7 @@ void LEGACY_PLUGIN::loadSETUP() else if( TESTLINE( "Pad2MaskClearance" ) ) { BIU tmp = biuParse( line + SZ( "Pad2MaskClearance" ) ); - bds.m_SolderMaskMargin = tmp; + bds.m_SolderMaskExpansion = tmp; } else if( TESTLINE( "SolderMaskMinWidth" ) ) {