Commit graph

46 commits

Author SHA1 Message Date
Paulo Henrique Silva
49dadd46ee Fix AMParamStmt to_gerber to write changes back.
AMParamStmt was not calling to_gerber on each of its primitives
on his own to_gerber method. That way primitives that changes after reading,
such as when you call to_inch/to_metric was failing because it was
writing only the original macro back.
2016-05-28 12:39:05 +08:00
Garret Fick
c9c1313d59 Fix units statement. Keep track of original macro statement in the AMGroup 2016-05-28 12:36:31 +08:00
Garret Fick
74c638c718 Fix issue where did not always switch into the G01 mode after G03 when the point was unchanged 2016-05-19 23:19:28 +08:00
Garret Fick
20a9af279a More rendering of AMGroup to statements 2016-03-01 00:06:14 +08:00
Garret Fick
223a010831 Fix critical issue with rotatin points (when the angle is zero the y would be flipped). Render AM with outline to gerber 2016-02-27 18:18:04 +08:00
Garret Fick
29c0d82bf5 RS274X backend for rendering. Incompelte still 2016-02-27 15:24:36 +08:00
Garret Fick
4a815bf25d First time any macro renders 2015-12-30 14:05:00 +08:00
Paulo Henrique Silva
d3b19efb48 Add support for PCBmodE generated files.
PCBmodE uses a standard but probably undefined behaviour issue
on Gerber where it defines circle apertures with a single modifier
but leaves a trilling 'X' after it. 'X' is modifiers separator but
when there is only one modifier the behaviour is undefined.

For parsing we are just ignoring blank modifiers.

Test updated to catch this case.
2015-05-20 16:20:02 -03:00
Hamilton Kibbe
8ec3077be9 Add checks to ensure statement unit conversions are idempotent 2015-05-16 09:45:34 -04:00
Paulo Henrique Silva
51c630ab77 AMStatement are used as is when gerbers are generated 2015-04-14 23:27:11 -03:00
Paulo Henrique Silva
d7ce97b180 (really) Fix parsing for AM macros with zero modifiers 2015-04-07 18:55:12 -03:00
Paulo Henrique Silva
50c01d4635 Fix CommentStmt for multi-line comments 2015-04-07 18:27:31 -03:00
Paulo Henrique Silva
d1c74317c8 Add some deprecated but still found statements 2015-04-07 18:26:33 -03:00
Paulo Henrique Silva
bbfa66eb38 Small change on __str__ for SF Statement 2015-04-07 18:25:44 -03:00
Paulo Henrique Silva
9ab4ec360c Fix parsing for AM macros with zero modifiers 2015-04-07 18:24:47 -03:00
Paulo Henrique Silva
b93804ed9a Add unspecified FS D leading zeros format
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-04-07 18:22:02 -03:00
Paulo Henrique Silva
a13b981c1c Fix tests for macros with no variables.
All AM*Primitive classes now handles float for all but the code
modifiers. This simplifies the reading/parsing.
2015-03-05 14:43:30 -03:00
Paulo Henrique Silva
670d3fbbd7 Add aperture macro parsing and evaluation.
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-03-03 03:41:55 -03:00
Hamilton Kibbe
5966d7830b Add offset operation 2015-02-18 23:13:23 -05:00
Hamilton Kibbe
e71d7a24b5 Python 3 tests passing 2015-02-18 21:14:30 -05:00
Hamilton Kibbe
288ac27084 Get unit conversion working for Gerber/Excellon files
Started operations module for file operations/transforms
2015-02-18 04:31:23 -05:00
Hamilton Kibbe
5cf1fa74b4 Tests and bugfixes 2015-02-15 02:20:02 -05:00
Hamilton Kibbe
41f9475b13 Tests and bugfixes 2015-02-09 17:39:24 -05:00
Paulo Henrique Silva
e38071868a Fix copy-paste error on ASParamStmt 2015-02-08 00:29:08 -02:00
Hamilton Kibbe
f98b918634 Added some Aperture Macro Primitives. Moved AM primitives to seperate file 2015-02-02 20:03:26 -05:00
Hamilton Kibbe
1cc20b351c tests 2015-02-02 11:42:47 -05:00
Hamilton Kibbe
208149d676 merge upstream changes 2015-01-26 22:24:45 -05:00
Hamilton Kibbe
c054136a65 Added some tests 2015-01-26 22:17:09 -05:00
Paulo Henrique Silva
a9b5a17c53 Fix Mirror (deprecated) param generation 2015-01-14 14:30:53 -02:00
Paulo Henrique Silva
cbb662491c Refactor AM aperture handling and add unit conversion support
* 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-14 03:15:52 -02:00
Paulo Henrique Silva
be5b94b8c0 Fix parsing for OrCAD.
* 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-15 23:44:12 -02:00
Hamilton Kibbe
29deffcf77 add ipc2581 primitives 2014-12-05 23:59:28 -05:00
Paulo Henrique Silva
ab69ee0172 Bunch of small fixes to improve Gerber read/write. 2014-11-10 12:24:09 -02:00
Paulo Henrique Silva
459e0205d1 Fix ValueError, missing self. 2014-10-26 22:25:26 -02:00
Hamilton Kibbe
4f076d7b76 Merge aperture fixses from upstream 2014-10-26 17:59:57 -04:00
Hamilton Kibbe
18e3b87625 Test update 2014-10-19 22:23:00 -04:00
Hamilton Kibbe
6d2db67e6d Refactor rendering 2014-10-18 01:44:51 -04:00
Hamilton Kibbe
ae3bbff8b0 Added excellon format detection 2014-10-10 23:07:51 -04:00
Hamilton Kibbe
76c03a55c9 Working region fills and level polarity. Renders Altium-generated gerbers like a champ! 2014-10-10 20:36:38 -04:00
Hamilton Kibbe
1750c3c60a Add tests 2014-10-10 13:07:54 -04:00
Hamilton Kibbe
f2f411493e doc update 2014-10-09 22:10:28 -04:00
Hamilton Kibbe
8851bc17b9 Doc update 2014-10-09 18:09:17 -04:00
Hamilton Kibbe
84bfd34e91 Add mode statement parsing 2014-10-09 09:51:29 -04:00
Hamilton Kibbe
bcb6cbc50d start arc 2014-10-08 22:49:49 -04:00
Hamilton Kibbe
af97dcf2a8 fix excellon render 2014-10-07 22:44:08 -04:00
Hamilton Kibbe
597427d785 add excellon statements 2014-10-06 08:33:53 -04:00
Renamed from gerber/statements.py (Browse further)