Aperture macros can get complex with arithmetical operations,
variables and variables substitution.
Current pcb-tools code just read each macro block as an independent
unit, this cannot deal with variables that get changed after used.
This patch splits the task in two: first we parse all macro content
and creates a bytecode representation of all operations. This bytecode
representation will be executed when an AD command is issues passing
the required parameters.
Parsing is heavily based on gerbv using a Shunting Yard approach to
math parsing.
Integration with rs274x.py code is not finished as I need to figure out
how to integrate the final macro primitives with the graphical primitives
already in use.
This fixes the exception referenced in #12. Still need to add rendering
code for rectangle aperture lines and arcs.
Rectangle strokes will be drawn as polygons by the rendering backends.
CAUTION: the original code used zero_suppression flags
in the opposite sense as Gerber functions. This
patch changes it to behave just like Gerber code.
* Add metric/inch conversion support
* Add settings context variable to to_gerber just like Gerber code.
* Add some missing Excellon values.
Tests are not entirely updated.
If we parse a file with 5.5 INCH format and ask to write
it back as 2.4 INCH we are going to loose precision and
write_gerber_value was not handling these cases write.
* Add support to convert between metric/impertial
* AM primitives are now properly created and can be
converted between metric/imperial.
(only Outline primitive is supported, no rendering yet)
* Modify the way we parse parameters to allow more than
one parameter in a single line as in the following example:
%FSLAX55Y55*MOIN*%
%IR0*IPPOS*OFA0.00000B0.00000*MIA0B0*SFA1.00000B1.00000*%
(this is from OrCAD 16 default output)
* Add missing deprecated parameters.
* Change API to use given FileSettings on output. This allows
us to use pcb-tools to convert between FS formats.