← Back to team overview

kicad-developers team mailing list archive

Re: Script access to pcb plot

 


On 24/03/2013, at 18:08, Lorenzo Marcantonio <l.marcantonio@xxxxxxxxxxxx> wrote:

> On Sun, Mar 24, 2013 at 12:51:38AM +0100, Miguel Angel Ajo Pelayo wrote:
>> More questions,  is it possible to tell the plotter a background color?, something weird for a plotter, right,
>> but in SVG it would be great to dump in black background too.
> 
> Uhmm no. The only background processing done is the initial black splat
> for the initial negative processing (and only in pcbnew).
> 

Makes sense

> Nothing forbid you to do a svg-only interface for background color (or
> else do a virtual in the base class which is a no-op and implement it
> where significative). Both approach have deep philosophical implications XD
> 

I think second makes more sense, no-op for everything else but SVG, and SVG
with background method implemented, and, may be some plotting option to set background
where available (like stereo),

> Look for 'fat interface' on the net for neverending holy wars (i.e.
> a virtual method against a dynamic cast for checking availability). Also
> known as: C++ has no duck typing XDXD. 

> 
> Anyway the PS/PDF drivers already have the required code (the negative
> splat). Sadly ATM this is *not* done in the driver (I don't remember
> why...), look for the FillNegativeKnockout function in pcbnew. That
> could be easy moved in the initial page processing.
> 

/** Prefill in black an area a little bigger than the board to prepare for the
 *  negative plot */
static void FillNegativeKnockout( PLOTTER *aPlotter, const EDA_RECT &aBbbox )
{
    const int margin = 5 * IU_PER_MM;   // Add a 5 mm margin around the board
    aPlotter->SetNegative( true );
    aPlotter->SetColor( WHITE );       // Which will be plotted as black
    EDA_RECT area = aBbbox;
    area.Inflate( margin );
    aPlotter->Rect( area.GetOrigin(), area.GetEnd(), FILLED_SHAPE );
    aPlotter->SetColor( BLACK );
}

"SetNegative" isn't what I'm looking for?, 
shouldn't I just implement that in SVG plotter? (usually done with a 100% width, 100% height rect black element)

> Of course the negative feature *can't* be replaced with something like
> that because gerber (which is in fact the most important driver)
> implements it natively.

> 
> -- 
> Lorenzo Marcantonio
> Logos Srl
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp


Follow ups

References