← Back to team overview

kicad-developers team mailing list archive

[PATCH] Plot scripting


Here's the patch, it applies cleanly to 3677

- Removed the filename from BASE_SCREEN; for pcbnew it goes in the
  BOARD, eeschema keeps it in the SCH_SCREEN, gerbview (and the 3D
  viewer) only keeps a default filename for dialogs;

- The DXF drivers honours the 'aux origin' option; also added a sysvar
  expliciting that's a metric design (DXF are exported in mm);

- The PLOTTER object now keeps inside the IUs per decimil passed during
  viewport establishment: it needs it to properly draw the border frame;
  also it get static methods and an utility function to retrieve the
  default filename for a plotfile (depending on the driver)

- Fixed a silly typo in the HPGL generator output;

- Decoupled the worksheet drawing/plotting from BASE_SCREEN;

- Removed struct PCB_Plot_Options and g_pcb_plot_options from gerbview
  since it's not implemented anyway;

- PostscriptTextMode become PlotTextMode since it's used by PDF and DXF
  too; in the same way the A4 paper is honoured by all the drivers
  supporting scaling and paper size (i.e. PS, PDF and HPGL); NOTE:
  should be tested more XD

- Removed m_printBorderAndTitleBlock from PCB_BASE_FRAME since it was
  not referenced in any useful way;

- Removed the plot routines from the PCB_BASE_FRAME and put in
  procedural code; also there is only one entry point instead of one for
  each plot driver; this also causes the removal of files
  plot{gerb,hpgl,ps,dxf}.cpp; most of the plot setup now happen in

- Enable different colours for references and values on silk screen

- Refactored the drill marks code (the mark code was duplicated for vias
  and pad holes)

- Accessors for PCB_PLOT_PARAMS and private members;

- Fixed the interlock between the plot frame and the plot scale options
  in the plot dialog;

- Factored out the 'gerber extension' switch: it was asking to be pulled
  out:P also pulled out the plot filename handling functions;

- The PLOT_CONTROLLER class, obviously!

- Added a catch for std::exception in pcbnew.i; it's not used at the
  moment (I added it when we where discussing error handling) but it
  should be at least a useful parachute for python-called code;


- Think about error handling and output decoupling for python called
  code; also the issue with 'deleted' object

- Make a 'better' example script since it's actually my first python
  code ever... the current one is (necessarily) convoluted and probably
  not idiomatic

- Interface the other exporters, esp. the drill generator (I consider
  the current 'white holes' for DXF an hack)

Lorenzo Marcantonio
Logos Srl

Attachment: plot_script.diff.gz
Description: application/gunzip

Follow ups