This fixes a crash in cairocffi on Python3, and should be compatible
with both python2 and python3. In python2, byte strings are just
strings. In python3, when getting binary data, the user probably wants
a byte string instead of a regular string.
Long term we should have only one .bounds method. But ExcellonParser right
now is not correct for cases with two drills in the same line
(it will report one dimension being zero)
- 'clear' polarity primitives no longer erase background
- Added aperture macro support for polygons
- Added aperture macro rendring support
- Renderer now creates a new surface for each layer and merges them instead of working
directly on a single surface
- Updated examples accordingly
this incorporates some of @chintal's layers.py changes
PCB.from_directory() simplifies loading of multiple gerbers
the PCB() class should be pretty helpful going forward...
the context classes could use some cleaning up, although I'd like to wait until the freecad stuff gets merged, that way we can try to refactor the context base to support more use cases
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.
I found out that Proteus generate some strange Excellon without any tool definition.
Gerbv renders it correctly and after digging in I found the heuristic that they use
to "guess" the tool diameter. This change replicates this behavior on pcb-tools.
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.
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.
per #33
the issue was trying to re-open the temporary file. it works on everything but windows. I've changed it to seek to the beginning and read from the file without re-opening, which should fix the issue.
This branch allows a pure cairo based render for both PNG and SVG.
Cairo backend is mostly the same but with improved support for
configurable scale, orientation and inverted color drawing.
API is not yet final.
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.