From 1942fe3bed076447670d37418e596c33646739a6 Mon Sep 17 00:00:00 2001 From: Juan Pablo Caram Date: Fri, 2 Oct 2015 19:09:44 -0400 Subject: [PATCH] Create polygon for path drawn so far when D03 is encountered. Fixes #150. --- camlib.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/camlib.py b/camlib.py index 2f4aad63..1a8ba47c 100644 --- a/camlib.py +++ b/camlib.py @@ -1624,15 +1624,25 @@ class Gerber (Geometry): path = [[current_x, current_y]] # Start new path # Flash + # Not allowed in region mode. elif current_operation_code == 3: + # Create path draw so far. + if len(path) > 1: + # --- Buffered ---- + width = self.apertures[last_path_aperture]["size"] + geo = LineString(path).buffer(width / 2) + if not geo.is_empty: poly_buffer.append(geo) + + # Reset path starting point + path = [[current_x, current_y]] + # --- BUFFERED --- + # Draw the flash flash = Gerber.create_flash_geometry(Point([current_x, current_y]), self.apertures[current_aperture]) if not flash.is_empty: poly_buffer.append(flash) - path = [[current_x, current_y]] # Reset path starting point - continue ### G02/3 - Circular interpolation