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;
};
......
......@@ -45,6 +45,11 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
bLeftSizer->Add( m_Exclude_Edges_Pcb, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_SubtractMaskFromSilk = new wxCheckBox( this, wxID_ANY, _("Subtract Mask from Silk"), wxDefaultPosition, wxDefaultSize, 0 );
m_SubtractMaskFromSilk->SetToolTip( _("Remove silkscreen from areas without soldermask") );
bLeftSizer->Add( m_SubtractMaskFromSilk, 0, wxALL, 5 );
m_Plot_Sheet_Ref = new wxCheckBox( this, wxID_ANY, _("Print sheet reference"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftSizer->Add( m_Plot_Sheet_Ref, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
......
......@@ -258,6 +258,63 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Subtract Mask from Silk</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_SubtractMaskFromSilk</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip">Remove silkscreen from areas without soldermask</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="OnCheckBox"></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">wxTOP|wxRIGHT|wxLEFT</property>
......
......@@ -55,6 +55,7 @@ class DIALOG_PLOT_BASE : public wxDialog
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;
......
......@@ -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