* Migrate to pytest
All tests were update to use pytest.
Tests were alse black formatted. Eventually all code
will be black formatted but need to merge some PRs first.
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.
- '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.
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.
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.
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.
Fritzing uses more than 2 digits for tool in their Excellons. To comply
with that, I check specifically for 3 or less digits and use as tool
number, more than that we treat as the standard (2 for tool and 2 for
compensation index)