summaryrefslogtreecommitdiff
path: root/gerber/primitives.py
AgeCommit message (Collapse)AuthorFilesLines
2019-02-03Make primitives with unset level polarity inherit from regionjaseg1-2/+4
This fixes region rendering with programatically generated primitives such that clear level polarity works in an intuitive way. This is useful for e.g. cutouts in regions. Before, the renderer would set level polarity twice, both when starting the region and then again once for each region primitive (line or arc). The problem was that the primitives in a region with "clear" polarity would when constructed with unset polarity default to "dark". Thus the renderer would emit something like LPC (clear polarity) -> G36 (start region) -> LPD (dark polarity) -> {lines...} instead of LPC -> G36 -> {lines...}. After this commit, Line and Arc will retain None as level polarity when created with unset level polarity, and region rendering will override None with the region's polarity. Outside regions, the old dark default remains unchanged. Note on verification: Somehow, gEDA gerbv would still render the broken regions the way one would have intended, but other viewers (KiCAD gerbview, the online EasyEDA one and whatever JLC uses to make their silkscreens) would not.
2017-11-14Fix bounding box calculation for Slot primitives per #77Hamilton Kibbe1-3/+6
2017-11-01Fix error in slot rendering from #77Hamilton Kibbe1-0/+1
2016-11-18Finish adding square hole support, fix some primitive calculations, etc.Hamilton Kibbe1-97/+135
2016-11-06Merge upstream changesHamilton Kibbe1-20/+38
2016-11-05Finish Merge, most tests passingHamilton Kibbe1-183/+183
2016-09-24Commit partial merge so I can work on the planeHamilton Kibbe1-78/+94
2016-08-06Fix multiple problems with the merge. There are still errors, but I will ↵Garret Fick1-4/+7
intentionally leave them because future merges might resolve them
2016-08-06Manually mere rendering changesHamilton Kibbe1-378/+781
2016-07-24Add more tests for rendering to PNG. Start adding tests for rendering to ↵Garret Fick1-9/+21
Gerber format. Changed definition of no hole to use None instead of 0 so we can differentiate when writing to Gerber format. Makde polygon use hole diameter instead of hole radius to match other primitives
2016-07-24Add many render tests based on the Umaco gerger specification. Fix multiple ↵Garret Fick1-9/+26
rendering bugs, especially related to holes in flashed apertures
2016-07-16Fix most broken tests so that I can safely merge into changes with known ↵Garret Fick1-2/+5
expected test result
2016-06-25Add support for polygon aperturesGarret Fick1-3/+4
2016-06-19Offsetting amgroup was doubly offsetingGarret Fick1-1/+1
2016-05-28Fix converting amgroup unitsGarret Fick1-1/+18
2016-05-28Fix units statement. Keep track of original macro statement in the AMGroupGarret Fick1-3/+8
2016-03-26Support for the G85 slot statementGarret Fick1-0/+36
2016-03-05More robust writing, even for bad files. Remove accidentally added importsGarret Fick1-2/+0
2016-03-05AM group hasn't implemented offsetGarret Fick1-4/+7
2016-03-05Write polygons to macrosGarret Fick1-0/+18
2016-03-01More rendering of AMGroup to statementsGarret Fick1-0/+32
2016-02-27Fix critical issue with rotatin points (when the angle is zero the y would ↵Garret Fick1-1/+1
be flipped). Render AM with outline to gerber
2016-02-27RS274X backend for rendering. Incompelte stillGarret Fick1-2/+44
2016-02-02Draw thermal aperture macros (as approximation)Garret Fick1-1/+4
2016-01-31Keep track of quadrant mode so we can draw full circlesGarret Fick1-1/+2
2016-01-31Add support for more excellon formats. Dont consider line width when ↵Garret Fick1-1/+1
determinging region bounding box
2016-01-28Cleanup, rendering fixes.Hamilton Kibbe1-9/+38
fixed rendering of tented vias fixed rendering of semi-transparent layers fixed file type detection issues added some examples
2016-01-21Fix a bunch of rendering bugs.Hamilton Kibbe1-354/+723
- '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
2015-12-30Render polygon flashesGarret Fick1-1/+14
2015-12-30Render primitives for some aperture macrosGarret Fick1-0/+41
2015-12-30First time any macro rendersGarret Fick1-0/+56
2015-12-25Identify flashes and bounding box without apertureGarret Fick1-3/+133
2015-12-19Parse misc nc drill filesGarret Fick1-1/+1
2015-12-16Fix drawing arcs. Dont crash for arcs with rectangular apertures. Fix crash ↵Garret Fick1-4/+13
with board size of zero for only one drill
2015-12-02Make the hit accessible from the drawable Hit, fix crash with cario drawing rectGarret Fick1-1/+2
2015-09-10Merge pull request #40 from curtacircuitos/cairo-render-unificationHamilton Kibbe1-12/+20
Cairo render unification
2015-08-09Add support for arcs in regions.Hamilton Kibbe1-12/+20
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-06-11Add keys to statements for linking to primitives. Add some API features to ↵Hamilton Kibbe1-1/+3
ExcellonFile, such as getting a tool path length and changing tool parameters. Excellonfiles write method generates statements based on the drill hits in the hits member, so drill hits in a generated file can be re-ordered by re-ordering the drill hits in ExcellonFile.hits. see #30
2015-04-26Refactor primitive unit conversion and add regression coverage to testsHamilton Kibbe1-256/+104
2015-04-24Fix indentation after PR #26Paulo Henrique Silva1-2/+2
2015-04-24Fix for #25. Checking was happening at the gerber/excellon file level, but I ↵Hamilton Kibbe1-95/+160
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-03-05Fix parsing for multiline ipc-d-356 recordsHamilton Kibbe1-7/+56
2015-02-18Add offset operationHamilton Kibbe1-1/+69
2015-02-18Get unit conversion working for Gerber/Excellon filesHamilton Kibbe1-25/+161
Started operations module for file operations/transforms
2015-02-15Tests and bugfixesHamilton Kibbe1-4/+4
2015-02-13Fix rendering for line with rectangular aperture per #12. Still need to do ↵Hamilton Kibbe1-8/+64
the same for arcs.
2015-02-12Update line primitive to take aperture parameterHamilton Kibbe1-12/+12
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-02-02testsHamilton Kibbe1-1/+20
2015-02-02More tests and bugfixesHamilton Kibbe1-9/+14
2015-02-01Added primitives and testsHamilton Kibbe1-21/+182