Commit 9dc9cc1f authored by Marco Mattila's avatar Marco Mattila Committed by Dick Hollenbeck

Board manufacturers typically do not print silkscreen on areas without

soldermask. Nevertheless, it would be nice to have proper gerbers to
begin with, i.e., gerbers with no silkscreen in soldermaskless areas.
Of course, most of the problem can be taken care of by drawing the
footprints properly. However, sometimes the silkscreen of one
footprint ends up on the pads of another one (think components under a
so-dimm card, for example). The attached patch adds an option to
subtract the soldermask from the silkscreen when doing gerber output.

marco
parent 249267ed
......@@ -504,3 +504,11 @@ void GERBER_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size,
set_current_line_width( -1 );
poly( 5, &polygon[0].x, aTrace_Mode==FILLED ? FILLED_SHAPE : NO_FILL );
}
void GERBER_PLOTTER::SetLayerPolarity( bool aPositive )
{
if( aPositive )
fprintf( output_file, "%%LPD*%%\n" );
else
fprintf( output_file, "%%LPC*%%\n" );
}
......@@ -169,6 +169,13 @@ public:
bool aBold );
void marker( const wxPoint& position, int diametre, int aShapeId );
/** Function SetLayerPolarity
* sets current Gerber layer polarity to positive or negative
* by writing \%LPD*\% or \%LPC*\% to the Gerber file, respectively.
* param @aPositive = layer polarity, true for positive
*/
virtual void SetLayerPolarity( bool aPositive ) = 0;
protected:
/* These are marker subcomponents */
void center_square( const wxPoint& position, int diametre, FILL_T fill );
......@@ -272,6 +279,8 @@ public:
virtual void flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
int aPadOrient, GRTraceMode aTrace_Mode );
virtual void SetLayerPolarity( bool aPositive ) {};
protected:
void pen_control( int plume );
......@@ -321,6 +330,8 @@ public:
virtual void flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
int aPadOrient, GRTraceMode aTrace_Mode );
virtual void SetLayerPolarity( bool aPositive ) {};
protected:
double plot_scale_adjX, plot_scale_adjY;
};
......@@ -379,6 +390,8 @@ public:
virtual void flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
int aPadOrient, GRTraceMode aTrace_Mode );
virtual void SetLayerPolarity( bool aPositive );
protected:
void select_aperture( const wxSize& size,
APERTURE::Aperture_Type type );
......@@ -439,6 +452,8 @@ public:
virtual void flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
int aPadOrient, GRTraceMode aTrace_Mode );
virtual void SetLayerPolarity( bool aPositive ) {};
protected:
int current_color;
};
......
This diff is collapsed.
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_plot_base__
#define __dialog_plot_base__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/gdicmn.h>
#include <wx/checkbox.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/radiobox.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_PLOT_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_PLOT_BASE : public wxDialog
{
private:
protected:
enum
{
ID_USE_GERBER_EXTENSIONS = 1000,
ID_ALLOW_PRINT_PAD_ON_SILKSCREEN,
ID_PRINT_VALUE,
ID_PRINT_REF,
ID_PRINT_MODULE_TEXTS,
ID_FORCE_PRINT_INVISIBLE_TEXT,
ID_DRILL_SHAPE_OPT,
ID_BROWSE_OUTPUT_DIRECTORY,
ID_MIROR_OPT,
ID_MASKVIA_OPT,
ID_EXEC_PLOT,
ID_SAVE_OPT_PLOT,
ID_CREATE_DRILL_FILE,
};
wxStaticBoxSizer* m_CopperLayersBoxSizer;
wxStaticBoxSizer* m_TechnicalLayersBoxSizer;
wxCheckBox* m_Use_Gerber_Extensions;
wxCheckBox* m_Exclude_Edges_Pcb;
wxCheckBox* m_Plot_Sheet_Ref;
wxCheckBox* m_Plot_Pads_on_Silkscreen;
wxCheckBox* m_Plot_Text_Value;
wxCheckBox* m_Plot_Text_Ref;
wxCheckBox* m_Plot_Text_Div;
wxCheckBox* m_Plot_Invisible_Text;
wxRadioBox* m_Drill_Shape_Opt;
wxRadioBox* m_Scale_Opt;
wxRadioBox* m_PlotModeOpt;
wxRadioBox* m_Choice_Plot_Offset;
wxRadioBox* m_PlotFormatOpt;
wxStaticText* m_textPenSize;
wxTextCtrl* m_HPGLPenSizeOpt;
wxStaticText* m_staticText3;
wxTextCtrl* m_HPGLPenSpeedOpt;
wxStaticText* m_textPenOvr;
wxTextCtrl* m_HPGLPenOverlayOpt;
wxCheckBox* m_Plot_PS_Negative;
wxTextCtrl* m_OutputDirectory;
wxButton* m_BrowseButton;
wxCheckBox* m_PlotMirorOpt;
wxCheckBox* m_PlotNoViaOnMaskOpt;
wxStaticText* m_staticText6;
wxTextCtrl* m_LinesWidth;
wxStaticText* m_staticText7;
wxTextCtrl* m_FineAdjustXscaleOpt;
wxStaticText* m_staticText8;
wxTextCtrl* m_FineAdjustYscaleOpt;
wxButton* m_PlotButton;
wxButton* m_buttonSaveOpt;
wxButton* m_buttonDrill;
wxButton* m_buttonQuit;
wxStaticText* m_staticText2;
wxTextCtrl* m_MessagesBox;
// Virtual event handlers, overide them in your derived class
virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); }
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
virtual void SetPlotFormat( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void Plot( wxCommandEvent& event ) { event.Skip(); }
virtual void SaveOptPlot( wxCommandEvent& event ) { event.Skip(); }
virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); }
virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plot"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 575,590 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PLOT_BASE();
};
#endif //__dialog_plot_base__
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_plot_base__
#define __dialog_plot_base__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/gdicmn.h>
#include <wx/checkbox.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/radiobox.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_PLOT_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_PLOT_BASE : public wxDialog
{
private:
protected:
enum
{
ID_USE_GERBER_EXTENSIONS = 1000,
ID_ALLOW_PRINT_PAD_ON_SILKSCREEN,
ID_PRINT_VALUE,
ID_PRINT_REF,
ID_PRINT_MODULE_TEXTS,
ID_FORCE_PRINT_INVISIBLE_TEXT,
ID_DRILL_SHAPE_OPT,
ID_BROWSE_OUTPUT_DIRECTORY,
ID_MIROR_OPT,
ID_MASKVIA_OPT,
ID_EXEC_PLOT,
ID_SAVE_OPT_PLOT,
ID_CREATE_DRILL_FILE,
};
wxStaticBoxSizer* m_CopperLayersBoxSizer;
wxStaticBoxSizer* m_TechnicalLayersBoxSizer;
wxCheckBox* m_Use_Gerber_Extensions;
wxCheckBox* m_Exclude_Edges_Pcb;
wxCheckBox* m_SubtractMaskFromSilk;
wxCheckBox* m_Plot_Sheet_Ref;
wxCheckBox* m_Plot_Pads_on_Silkscreen;
wxCheckBox* m_Plot_Text_Value;
wxCheckBox* m_Plot_Text_Ref;
wxCheckBox* m_Plot_Text_Div;
wxCheckBox* m_Plot_Invisible_Text;
wxRadioBox* m_Drill_Shape_Opt;
wxRadioBox* m_Scale_Opt;
wxRadioBox* m_PlotModeOpt;
wxRadioBox* m_Choice_Plot_Offset;
wxRadioBox* m_PlotFormatOpt;
wxStaticText* m_textPenSize;
wxTextCtrl* m_HPGLPenSizeOpt;
wxStaticText* m_staticText3;
wxTextCtrl* m_HPGLPenSpeedOpt;
wxStaticText* m_textPenOvr;
wxTextCtrl* m_HPGLPenOverlayOpt;
wxCheckBox* m_Plot_PS_Negative;
wxTextCtrl* m_OutputDirectory;
wxButton* m_BrowseButton;
wxCheckBox* m_PlotMirorOpt;
wxCheckBox* m_PlotNoViaOnMaskOpt;
wxStaticText* m_staticText6;
wxTextCtrl* m_LinesWidth;
wxStaticText* m_staticText7;
wxTextCtrl* m_FineAdjustXscaleOpt;
wxStaticText* m_staticText8;
wxTextCtrl* m_FineAdjustYscaleOpt;
wxButton* m_PlotButton;
wxButton* m_buttonSaveOpt;
wxButton* m_buttonDrill;
wxButton* m_buttonQuit;
wxStaticText* m_staticText2;
wxTextCtrl* m_MessagesBox;
// Virtual event handlers, overide them in your derived class
virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); }
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
virtual void SetPlotFormat( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void Plot( wxCommandEvent& event ) { event.Skip(); }
virtual void SaveOptPlot( wxCommandEvent& event ) { event.Skip(); }
virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); }
virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plot"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 575,590 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PLOT_BASE();
};
#endif //__dialog_plot_base__
......@@ -35,6 +35,7 @@
// PCB_Plot_Options constructor: set the default values for plot options:
PCB_Plot_Options::PCB_Plot_Options()
{
subtractMaskFromSilk = true;
Sel_Texte_Reference = true;
Sel_Texte_Valeur = true;
Sel_Texte_Divers = true;
......@@ -248,6 +249,8 @@ void DIALOG_PLOT::Init_Dialog()
// Option for excluding contents of "Edges Pcb" layer
m_Exclude_Edges_Pcb->SetValue( g_pcb_plot_options.Exclude_Edges_Pcb );
m_SubtractMaskFromSilk->SetValue( g_pcb_plot_options.GetSubtractMaskFromSilk() );
// Option to plot page references:
if( m_Parent->m_Print_Sheet_Ref )
{
......@@ -364,6 +367,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_HPGLPenOverlayOpt->Enable( false );
m_Exclude_Edges_Pcb->SetValue( false );
m_Exclude_Edges_Pcb->Enable( false );
m_SubtractMaskFromSilk->Enable( false );
m_Use_Gerber_Extensions->Enable( false );
m_Scale_Opt->Enable( true );
m_FineAdjustXscaleOpt->Enable( true );
......@@ -383,6 +387,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_HPGLPenSpeedOpt->Enable( false );
m_HPGLPenOverlayOpt->Enable( false );
m_Exclude_Edges_Pcb->Enable( true );
m_SubtractMaskFromSilk->Enable( true );
m_Use_Gerber_Extensions->Enable( true );
m_Scale_Opt->SetSelection( 1 );
m_Scale_Opt->Enable( false );
......@@ -403,6 +408,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_HPGLPenOverlayOpt->Enable( true );
m_Exclude_Edges_Pcb->SetValue( false );
m_Exclude_Edges_Pcb->Enable( false );
m_SubtractMaskFromSilk->Enable( false );
m_Use_Gerber_Extensions->Enable( false );
m_Scale_Opt->Enable( true );
m_FineAdjustXscaleOpt->Enable( false );
......@@ -423,6 +429,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_HPGLPenOverlayOpt->Enable( false );
m_Exclude_Edges_Pcb->SetValue( false );
m_Exclude_Edges_Pcb->Enable( false );
m_SubtractMaskFromSilk->Enable( false );
m_Use_Gerber_Extensions->Enable( false );
m_Scale_Opt->Enable( false );
m_Scale_Opt->SetSelection( 1 );
......@@ -441,6 +448,8 @@ void DIALOG_PLOT::SaveOptPlot( wxCommandEvent& event )
{
g_pcb_plot_options.Exclude_Edges_Pcb = m_Exclude_Edges_Pcb->GetValue();
g_pcb_plot_options.SetSubtractMaskFromSilk( m_SubtractMaskFromSilk->GetValue() );
if( m_Plot_Sheet_Ref )
g_pcb_plot_options.Plot_Frame_Ref = m_Plot_Sheet_Ref->GetValue();
......
......@@ -64,12 +64,16 @@ public:
double ScaleAdjX;
double ScaleAdjY;
private:
wxString outputDirectory;
bool subtractMaskFromSilk;
public:
PCB_Plot_Options();
void SetOutputDirectory( wxString aDir ) { outputDirectory = aDir; };
wxString GetOutputDirectory() { return outputDirectory; };
void SetSubtractMaskFromSilk( bool aSubtract ) { subtractMaskFromSilk = aSubtract; };
bool GetSubtractMaskFromSilk() { return subtractMaskFromSilk; };
};
extern PCB_Plot_Options g_pcb_plot_options;
......
......@@ -746,6 +746,24 @@ void WinEDA_BasePcbFrame::Plot_Layer( PLOTTER* plotter, int Layer,
default:
Plot_Serigraphie( plotter, layer_mask, trace_mode );
// Gerber: Subtract soldermask from silkscreen if enabled
if( plotter->GetPlotterType() == PLOT_FORMAT_GERBER
&& g_pcb_plot_options.GetSubtractMaskFromSilk() )
{
if( Layer == SILKSCREEN_N_FRONT )
{
layer_mask = g_TabOneLayerMask[SOLDERMASK_N_FRONT];
}
else
{
layer_mask = g_TabOneLayerMask[SOLDERMASK_N_BACK];
}
// Set layer polarity to negative
plotter->SetLayerPolarity( false );
Plot_Standard_Layer( plotter, layer_mask,
g_pcb_plot_options.DrawViaOnMaskLayer,
trace_mode );
}
break;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment