From 53816574a986722d7af26c5597248d9c96f31bd3 Mon Sep 17 00:00:00 2001 From: opiopan Date: Sun, 31 Mar 2019 18:16:34 +0900 Subject: fix a minor issue --- gerberex/dxf.py | 8 +++----- gerberex/dxf_path.py | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'gerberex') diff --git a/gerberex/dxf.py b/gerberex/dxf.py index e6eb971..e863238 100644 --- a/gerberex/dxf.py +++ b/gerberex/dxf.py @@ -259,7 +259,7 @@ class DxfPolylineStatement(DxfStatement): if self.is_closed: self.end = self.start else: - self.start = (self.entity.points[-1][0], self.entity.points[-1][1]) + self.end = (self.entity.points[-1][0], self.entity.points[-1][1]) def to_gerber(self, settings=FileSettings(), pitch=0, width=0): if pitch: @@ -364,16 +364,14 @@ class DxfStatements(object): def gerbers(): yield 'D{0}*'.format(self.dcode) if self.draw_mode == DxfFile.DM_FILL: + yield 'G36*' for statement in self.statements: - yield 'G36*' if isinstance(statement, DxfCircleStatement) or \ (isinstance(statement, DxfPolylineStatement) and statement.entity.is_closed): yield statement.to_gerber(settings) - yield 'G37*' for path in self.paths: - yield 'G36*' yield path.to_gerber(settings) - yield 'G37*' + yield 'G37*' else: for statement in self.statements: yield statement.to_gerber( diff --git a/gerberex/dxf_path.py b/gerberex/dxf_path.py index b066b08..930d8d2 100644 --- a/gerberex/dxf_path.py +++ b/gerberex/dxf_path.py @@ -184,7 +184,7 @@ def generate_closed_paths(statements, error_range=0): working = [] for i in range(len(paths)): mergee = paths[i] - for j in range(i + 1, len(paths) - 1): + for j in range(i + 1, len(paths)): target = paths[j] if target.merge(mergee, error_range): break @@ -192,6 +192,5 @@ def generate_closed_paths(statements, error_range=0): working.append(mergee) prev_paths_num = len(paths) paths = working - return list(filter(lambda p: p.is_closed, paths)) -- cgit