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

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
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -504,3 +504,11 @@ void GERBER_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size,
    set_current_line_width( -1 );
    set_current_line_width( -1 );
    poly( 5, &polygon[0].x, aTrace_Mode==FILLED ? FILLED_SHAPE : NO_FILL );
    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" );
}
+15 −0
Original line number Original line Diff line number Diff line
@@ -169,6 +169,13 @@ public:
               bool                        aBold );
               bool                        aBold );
    void           marker( const wxPoint& position, int diametre, int aShapeId );
    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:
protected:
    /* These are marker subcomponents */
    /* These are marker subcomponents */
    void           center_square( const wxPoint& position, int diametre, FILL_T fill );
    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],
    virtual void flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
                                   int aPadOrient, GRTraceMode aTrace_Mode );
                                   int aPadOrient, GRTraceMode aTrace_Mode );


    virtual void SetLayerPolarity( bool aPositive ) {};

protected:
protected:
    void         pen_control( int plume );
    void         pen_control( int plume );


@@ -321,6 +330,8 @@ public:
    virtual void flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
    virtual void flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
                                   int aPadOrient, GRTraceMode aTrace_Mode );
                                   int aPadOrient, GRTraceMode aTrace_Mode );


    virtual void SetLayerPolarity( bool aPositive ) {};

protected:
protected:
    double plot_scale_adjX, plot_scale_adjY;
    double plot_scale_adjX, plot_scale_adjY;
};
};
@@ -379,6 +390,8 @@ public:
    virtual void                    flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
    virtual void                    flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
                                                      int aPadOrient, GRTraceMode aTrace_Mode );
                                                      int aPadOrient, GRTraceMode aTrace_Mode );


    virtual void                    SetLayerPolarity( bool aPositive );

protected:
protected:
    void                            select_aperture( const wxSize&           size,
    void                            select_aperture( const wxSize&           size,
                                                     APERTURE::Aperture_Type type );
                                                     APERTURE::Aperture_Type type );
@@ -439,6 +452,8 @@ public:
    virtual void flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
    virtual void flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
                                   int aPadOrient, GRTraceMode aTrace_Mode );
                                   int aPadOrient, GRTraceMode aTrace_Mode );


    virtual void SetLayerPolarity( bool aPositive ) {};

protected:
protected:
    int current_color;
    int current_color;
};
};
+262 −257
Original line number Original line Diff line number Diff line
@@ -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 );
	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 );
	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 );
	bLeftSizer->Add( m_Plot_Sheet_Ref, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
	
	
+2385 −2328
Original line number Original line Diff line number Diff line
@@ -258,6 +258,63 @@
                                        <event name="OnUpdateUI"></event>
                                        <event name="OnUpdateUI"></event>
                                    </object>
                                    </object>
                                </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">
                                <object class="sizeritem" expanded="0">
                                    <property name="border">5</property>
                                    <property name="border">5</property>
                                    <property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
                                    <property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
+114 −113
Original line number Original line Diff line number Diff line
@@ -55,6 +55,7 @@ class DIALOG_PLOT_BASE : public wxDialog
		wxStaticBoxSizer* m_TechnicalLayersBoxSizer;
		wxStaticBoxSizer* m_TechnicalLayersBoxSizer;
		wxCheckBox* m_Use_Gerber_Extensions;
		wxCheckBox* m_Use_Gerber_Extensions;
		wxCheckBox* m_Exclude_Edges_Pcb;
		wxCheckBox* m_Exclude_Edges_Pcb;
		wxCheckBox* m_SubtractMaskFromSilk;
		wxCheckBox* m_Plot_Sheet_Ref;
		wxCheckBox* m_Plot_Sheet_Ref;
		wxCheckBox* m_Plot_Pads_on_Silkscreen;
		wxCheckBox* m_Plot_Pads_on_Silkscreen;
		wxCheckBox* m_Plot_Text_Value;
		wxCheckBox* m_Plot_Text_Value;
Loading