summaryrefslogtreecommitdiff
path: root/gerber/rs274x.py
AgeCommit message (Collapse)AuthorFilesLines
2016-06-25Add support for polygon aperturesGarret Fick1-2/+12
2016-06-03compliant fs format as FS<L or T><A or I>[Nn][Gn]<Xn><Yn>[Dn][Mn]visualgui823@live.com1-1/+1
2016-05-28Fix converting amgroup unitsGarret Fick1-1/+3
2016-04-23Correctly find the center for single quadrant arcsGarret Fick1-1/+32
2016-03-27Merge pull request #2 from qaulau/masterGarret Fick1-2/+2
Update rs274x.py
2016-03-26D02 in the middle of a region starts a new regionGarret Fick1-1/+7
2016-03-22Update rs274x.pyQau Lau1-2/+2
python 2.6 bug re incompatibility in sre, see https://bugs.python.org/issue214033
2016-03-19Correctly handle empty command statementsGarret Fick1-0/+6
2016-02-21Additional bounding box calcuation that considers only actual positions, not ↵Garret Fick1-0/+15
the movement of the machine
2016-02-16Keep aperature macros as single statement. Don't generate regions with no pointsGarret Fick1-3/+16
2016-02-16Handle multiple commands on a single lineGarret Fick1-3/+22
2016-02-14Fix convertion of units for apertures and regionsGarret Fick1-4/+4
2016-01-31Keep track of quadrant mode so we can draw full circlesGarret Fick1-3/+3
2016-01-08More stability fixes for poorly constructed filesGarret Fick1-2/+4
2015-12-30Work with Diptrace that calls things D3 not D03Garret Fick1-3/+3
2015-12-03Move the coordinate matching to the beginning since most of the items are ↵Garret Fick1-9/+8
coordinates. For large files, this decreases total time by 10-20%
2015-11-18Regions with arcs would crash if they occured before any command to set the ↵Garret Fick1-2/+2
aperture
2015-11-15Use Python's universal newlines to open filesPaulo Henrique Silva1-1/+1
2015-11-13Fix issue when a region is created as the first graphical object in a filePaulo Henrique Silva1-2/+5
When regions were the first thing draw there is no current aperture defined, as regions do not require an aperture, so we use an zeroed Circle as aperture in this case. Gerber spec says that apertures have no graphical meaning for regions, so this should be enough.
2015-10-10Python 3 fixHamilton Kibbe1-1/+5
2015-10-10Allow files to be read from strings per #37Hamilton Kibbe1-10/+14
Adds a loads() method to the top level module which generates a GerberFile or ExcellonFile from a string
2015-08-09Add support for arcs in regions.Hamilton Kibbe1-12/+19
This fixes the circular cutout issue described in #32. Regions were previously stored as a collection of points, now they are stored as a collection of line and arc primitives.
2015-05-21G70/G71 are now interpreted as MOParamStmt.Paulo Henrique Silva1-2/+4
Got a bunch of metric files with no MOMM but only G71, this should be pretty mush harmless.
2015-05-21Fix multiline read of mixed statements (%XXX*% followed by DNN*)Paulo Henrique Silva1-1/+3
We now check if there is a %XXX*% command inside the line before considering it a multiline statement.
2015-05-21Fix ADD statement parsing for concatened statements.Paulo Henrique Silva1-6/+6
ADDxxx param statements were too greedy on the mofidiers and were matching more than it should in cases where there are no newlines after the statement like: '%ADD12C,0.305*%%LPD*%', in a single line. The '%' was not exluded form modifiers so it got confused with the %LPD*% concatened. top_copper.GTL example was changed to be in a single line now with no spaces at all and it works well.
2015-05-16Add checks to ensure statement unit conversions are idempotentHamilton Kibbe1-0/+4
2015-04-24Fix for #25. Checking was happening at the gerber/excellon file level, but I ↵Hamilton Kibbe1-2/+3
added units checking at the primitive level so the use case shown in the example is covered. Might want to throw a bunch more assertions in the test code (i started doing a few) to cover multiple calls to unit conversion functions
2015-04-23Fix Gerber generation for coord blocks with implicit op codePaulo Henrique Silva1-0/+3
2015-04-13Fix issue where D01 and D03 are implicit.Paulo Henrique Silva1-4/+7
Based on code from @rdprescott.
2015-04-07Fix CoordStmt with missing i/j offsetsPaulo Henrique Silva1-2/+4
2015-04-07Add some deprecated but still found statementsPaulo Henrique Silva1-6/+26
2015-04-07Add unspecified FS D leading zeros formatPaulo Henrique Silva1-5/+2
FS D leading zero format (probably form Direct) is an unspecified coordinate format where all numbers are specified with both leading and trailing zeros.
2015-03-05Fix for py3Paulo Henrique Silva1-1/+1
2015-03-05Fix tests for macros with no variables.Paulo Henrique Silva1-1/+1
All AM*Primitive classes now handles float for all but the code modifiers. This simplifies the reading/parsing.
2015-03-03Add aperture macro parsing and evaluation.Paulo Henrique Silva1-3/+17
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.
2015-02-20Fix GerberFile.bounds when board origin is negativePaulo Henrique Silva1-13/+10
2015-02-18Add offset operationHamilton Kibbe1-0/+6
2015-02-18Get unit conversion working for Gerber/Excellon filesHamilton Kibbe1-1/+17
Started operations module for file operations/transforms
2015-02-12Update line primitive to take aperture parameterHamilton Kibbe1-3/+3
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.
2015-01-26merge upstream changesHamilton Kibbe1-0/+2
2015-01-14Refactor AM aperture handling and add unit conversion supportPaulo Henrique Silva1-5/+5
* 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)
2015-01-13Fix region primitive creationPaulo Henrique Silva1-1/+1
2014-12-15Fix parsing for OrCAD.Paulo Henrique Silva1-17/+30
* 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.
2014-12-05add ipc2581 primitivesHamilton Kibbe1-2/+2
2014-11-10Bunch of small fixes to improve Gerber read/write.Paulo Henrique Silva1-2/+2
2014-10-26style changePaulo Henrique Silva1-2/+3
2014-10-26Add simple hack to allow evaluation when gerber have macros and polygonPaulo Henrique Silva1-3/+5
2014-10-26Fix parsing for AM macros and support for zero sized circle primitivesPaulo Henrique Silva1-3/+3
2014-10-26Fix parsing of Unknown commandsPaulo Henrique Silva1-0/+4
2014-10-26Merge aperture fixses from upstreamHamilton Kibbe1-4/+4