From 3fce700ef289d16053b0f60cccdfd4d5956daf5c Mon Sep 17 00:00:00 2001 From: Garret Fick Date: Mon, 15 Feb 2016 23:53:52 +0800 Subject: Don't throw an exception for missing zero suppress, even though it is wrong --- gerber/cam.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gerber/cam.py') diff --git a/gerber/cam.py b/gerber/cam.py index c567055..08d80de 100644 --- a/gerber/cam.py +++ b/gerber/cam.py @@ -72,9 +72,10 @@ class FileSettings(object): elif zero_suppression is not None: if zero_suppression not in ['leading', 'trailing']: - raise ValueError('Zero suppression must be either leading or \ - trailling') - self.zero_suppression = zero_suppression + # This is a common problem in Eagle files, so just suppress it + self.zero_suppression = 'leading' + else: + self.zero_suppression = zero_suppression elif zeros is not None: if zeros not in ['leading', 'trailing']: -- cgit From 223a010831f0d9dae4bd6d2e626a603a78eb0b1d Mon Sep 17 00:00:00 2001 From: Garret Fick Date: Sat, 27 Feb 2016 18:18:04 +0800 Subject: Fix critical issue with rotatin points (when the angle is zero the y would be flipped). Render AM with outline to gerber --- gerber/cam.py | 1 + 1 file changed, 1 insertion(+) (limited to 'gerber/cam.py') diff --git a/gerber/cam.py b/gerber/cam.py index 08d80de..53f5c0d 100644 --- a/gerber/cam.py +++ b/gerber/cam.py @@ -255,6 +255,7 @@ class CamFile(object): filename : string If provided, save the rendered image to `filename` """ + ctx.set_bounds(self.bounds) ctx._paint_background() if ctx.invert: -- cgit From 20a9af279ac2217a39b73903ff94b916a3025be2 Mon Sep 17 00:00:00 2001 From: Garret Fick Date: Tue, 1 Mar 2016 00:06:14 +0800 Subject: More rendering of AMGroup to statements --- gerber/cam.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gerber/cam.py') diff --git a/gerber/cam.py b/gerber/cam.py index 53f5c0d..8e31bf0 100644 --- a/gerber/cam.py +++ b/gerber/cam.py @@ -166,6 +166,10 @@ class FileSettings(object): self.zero_suppression == other.zero_suppression and self.format == other.format and self.angle_units == other.angle_units) + + def __str__(self): + return ('' % + (self.units, self.notation, self.zero_suppression, self.format, self.angle_units)) class CamFile(object): -- cgit From 7cd6acf12670f3773113f67ed2acb35cb21c32a0 Mon Sep 17 00:00:00 2001 From: Garret Fick Date: Sun, 24 Jul 2016 17:08:47 +0800 Subject: Add many render tests based on the Umaco gerger specification. Fix multiple rendering bugs, especially related to holes in flashed apertures --- gerber/cam.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gerber/cam.py') diff --git a/gerber/cam.py b/gerber/cam.py index 28918cb..f64aa34 100644 --- a/gerber/cam.py +++ b/gerber/cam.py @@ -260,7 +260,7 @@ class CamFile(object): If provided, save the rendered image to `filename` """ - ctx.set_bounds(self.bounds) + ctx.set_bounds(self.bounding_box) ctx._paint_background() if invert: -- cgit From 8cd842a41a55ab3d8f558a2e3e198beba7da58a1 Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Thu, 21 Jan 2016 03:57:44 -0500 Subject: Manually mere rendering changes --- gerber/cam.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'gerber/cam.py') diff --git a/gerber/cam.py b/gerber/cam.py index f64aa34..0e19b05 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'): @@ -248,6 +250,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. @@ -262,15 +270,11 @@ class CamFile(object): ctx.set_bounds(self.bounding_box) 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) -- cgit From 5af19af190c1fb0f0c5be029d46d63e657dde4d9 Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Thu, 21 Jan 2016 03:57:44 -0500 Subject: Commit partial merge so I can work on the plane --- gerber/cam.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gerber/cam.py') diff --git a/gerber/cam.py b/gerber/cam.py index 0e19b05..c5b8938 100644 --- a/gerber/cam.py +++ b/gerber/cam.py @@ -267,8 +267,7 @@ class CamFile(object): filename : string If provided, save the rendered image to `filename` """ - - ctx.set_bounds(self.bounding_box) + ctx.set_bounds(self.bounds) ctx._paint_background() ctx.invert = invert ctx._new_render_layer() -- cgit