diff options
author | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2016-01-21 03:57:44 -0500 |
---|---|---|
committer | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2016-01-21 03:57:44 -0500 |
commit | 5476da8aa3f4ee424f56f4f2491e7af1c4b7b758 (patch) | |
tree | 427dafda78ee21a1846a2b9c9747dd96afe7e8a3 /gerber/cam.py | |
parent | 7a532514631384dbfc9d7fc2002cbbfe52433c9f (diff) | |
download | gerbonara-5476da8aa3f4ee424f56f4f2491e7af1c4b7b758.tar.gz gerbonara-5476da8aa3f4ee424f56f4f2491e7af1c4b7b758.tar.bz2 gerbonara-5476da8aa3f4ee424f56f4f2491e7af1c4b7b758.zip |
Fix a bunch of rendering bugs.
- '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
Diffstat (limited to 'gerber/cam.py')
-rw-r--r-- | gerber/cam.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/gerber/cam.py b/gerber/cam.py index 92ce83d..dda5c10 100644 --- a/gerber/cam.py +++ b/gerber/cam.py @@ -22,6 +22,7 @@ CAM File This module provides common base classes for Excellon/Gerber CNC files """ + class FileSettings(object): """ CAM File Settings @@ -52,6 +53,7 @@ class FileSettings(object): specify both. `zero_suppression` will take on the opposite value of `zeros` and vice versa """ + def __init__(self, notation='absolute', units='inch', zero_suppression=None, format=(2, 5), zeros=None, angle_units='degrees'): @@ -243,6 +245,12 @@ class CamFile(object): """ pass + def to_inch(self): + pass + + def to_metric(self): + pass + def render(self, ctx, invert=False, filename=None): """ Generate image of layer. @@ -256,15 +264,11 @@ class CamFile(object): """ ctx.set_bounds(self.bounds) ctx._paint_background() - - if invert: - ctx.invert = True - ctx._clear_mask() + ctx.invert = invert + ctx._new_render_layer() for p in self.primitives: ctx.render(p) - if invert: - ctx.invert = False - ctx._render_mask() + ctx._flatten() if filename is not None: ctx.dump(filename) |