← Back to team overview

kicad-developers team mailing list archive

Re: Proposal for batch plotting

 

On 8/5/2012 2:11 AM, Lorenzo Marcantonio wrote:
On Sun, Aug 05, 2012 at 12:11:04AM +0200, Miguel Angel Ajo Pelayo wrote:
Nice proof of concept :-), It's really useful already :-)

Consider that now I have to do 4-5 plot runs setting options by hand on the dialog and combining layer with a shell script. I waste about 30 minutes doing fabrication plots for a 4 layer boards. At this stage it would already reduce time to about 5 minutes (you need to do pick and place, drills and gencam too. Also zip the whole for emailing). So, yes, it's already *very* useful for me (it *only* need a gui and a lot of error checking on parameters:P:P)

Let me understand the interpretation of your pctl file, as I imagine, it
reads options, options options, and then you run an output like HGPL=   or
PS= or PDF= ,

The interpretation work this way: options simply sets an option;HPGL=,PS=,PDF=,DXF=,GERBER= starts a new plot (closing the previous one) with current plot options (like scaling)
LAYER= actually does a layer in the current plotfile with all the options in effect.
Changing plot-level options between layer could have, uhm, unexpected results XD (altough for most of them unexpected would be only a no-op)

Looking at the code I identified these as plot-level options:

AutoScale,PlotScale,PlotMirror,
PlotLineWidth,AuxOrigin,PSA4Output,
FineScaleAdjustX, FineScaleAdjustY,
FineWidthAdjust			These set the plot coordinate system.
				Obviously it doesn't make sense to plot
				different layers on the same sheet with
				different coordinate systems...
				(also the plotter classes simply can't
				do that at the moment). FineWidthAdjust
				actually *is* processed layer-by-layer but
				logically it makes no sense...

TrimSilk, PSNegative
				These use layering already for their work.
				TrimSilk with multiple layers would give
				strange results (but it's only for gerbers
				and I don't think the multilayer feature
				would be useful here). PSNegative fill the
				page in black at opening and then paint in
				reversed color so the result would be at
				least curious. Actually the whole
				'negative print' feature is a little strange,
				the only reason for it would be using negative
				photoresist... anyway if it's there something
				probably is using it

HPGLPenNum,HPGLPenSpeed,
HPGLPenDiameter,HPGLPenOverlay
				These *should* be layer-level options, but the
				plotter classes don't handle pen change after
				open, at the moment. Diameter and overlay are
				actually processed layer by layer but they
				have no sense without the corresponding pen
				change command. Since HPGL is mostly unused
				these day I'll fix that only if people ask for
				it.

Other options which have 'interesting' behaviour would be:
DrillShape			Actually is only on PS (so it would be
				trivially added to PDF) using scraping. I
				think it would be useful for DXF too, at
				least (to have fixturing and tooling holes
				references without adding them to the drawing
				layer), so I'm thinking to add a primitive
				to the plotter engines for them: scraping
				would be useful for PS and PDF, DXF could use
				circles or points (depending on the mark type),
				HPGL maybe circles and for gerber maybe single
				flashes (would make a plot like gerbv view of
				drill tapes)

PlotFrame			At the moment is a layer level option but I
				think it should be plot-level (replotting the
				frame is not interesting...)

ExcludeEdge			Is not strictly needed since you can always
				plot the pcbedge as a layer, but it's needed
				to keep the preference for the standard plot
				dialog... I'll think about that when I convert
				the standard plot to use the BatchPlot
				class.

I'd also like to add options to set the color for reference and value: you could have DXF plots with both of them forced on (using PlotInvisibleText) and controlling the display with the mcad layer system. Could be *very* useful for repair diagrams in my experience.

when you run an output, then all the previous options get cleared? :)

At the moment no, they accumulate in the same option bank (it's easier when writing the control file by hand), but clearing them would be easy. It's only a design decision. But the plotfile open can tweak some option (for example, setting line width to atleast 1), so that would need some (but not a lot) of thinking.

For a final s-expr format it could be something like:

I'd say more something like:

(...
     (output

Shouldn't this be:
       (output TYPE   # Where TYPE is PDF, SVG, GERBER, etc?

I would also like to see a path for each plot type which can be made relative to the project path to save the plot files into. I like to avoid putting a bunch of plot files in my project directory.

Wayne

	(filename xxxx.pdf)
	(format PDF)
	(plot-option1 value1)
	...
	(plot-optionn valuen)
	(layer
	    (layernum layer)
	    (layer-option1 value1)
	    ...
	    (layer-optionn valuen))
	...
	(layer
	    ...))
...)

There are also to decide things like pathname processing (like the output directory setting  or the base filename stemming) which could be useful to make the control file independant from the board.

For binding the whole thing to a scripting language I think you'd only need to bind the accessors to the plot options (I've already made all the remaining member variables private) and the two function 'StartPlot' and 'PlotLayer' (they actually have another name:P)




Follow ups

References