summaryrefslogtreecommitdiff
path: root/gerberex/dxf_path.py
diff options
context:
space:
mode:
authorHiroshi Murayama <opiopan@gmail.com>2019-09-28 20:42:11 +0900
committerHiroshi Murayama <opiopan@gmail.com>2019-09-28 20:42:11 +0900
commit48b35377b1cce897a70d1d037b3e73b616af9be7 (patch)
tree483238db68f4387e26c826ddc9cb858c30d14024 /gerberex/dxf_path.py
parenta3c750fc060c6ff6b071dca2a7c765b8629efe8a (diff)
downloadgerbonara-48b35377b1cce897a70d1d037b3e73b616af9be7.tar.gz
gerbonara-48b35377b1cce897a70d1d037b3e73b616af9be7.tar.bz2
gerbonara-48b35377b1cce897a70d1d037b3e73b616af9be7.zip
minor refactoring
Diffstat (limited to 'gerberex/dxf_path.py')
-rw-r--r--gerberex/dxf_path.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/gerberex/dxf_path.py b/gerberex/dxf_path.py
index 0a92287..1307411 100644
--- a/gerberex/dxf_path.py
+++ b/gerberex/dxf_path.py
@@ -202,20 +202,22 @@ class DxfPath(object):
def to_excellon(self, settings=FileSettings(), pitch=0, width=0):
from gerberex.dxf import DxfArcStatement
if pitch == 0:
- x, y = self.statements[0].start
+ x0, y0 = self.statements[0].start
excellon = 'G00{0}\nM15\n'.format(
- CoordinateStmtEx(x=x, y=y).to_excellon(settings))
+ CoordinateStmtEx(x=x0, y=y0).to_excellon(settings))
for statement in self.statements:
- x, y = statement.end
+ x0, y0 = statement.start
+ x1, y1 = statement.end
if isinstance(statement, DxfArcStatement):
- r = statement.radius
+ i = statement.center[0] - x0
+ j = statement.center[1] - y0
excellon += '{0}{1}\n'.format(
'G03' if statement.end_angle > statement.start_angle else 'G02',
- CoordinateStmtEx(x=x, y=y, radius=r).to_excellon(settings))
+ CoordinateStmtEx(x=x1, y=y1, i=i, j=j).to_excellon(settings))
else:
excellon += 'G01{0}\n'.format(
- CoordinateStmtEx(x=x, y=y).to_excellon(settings))
+ CoordinateStmtEx(x=x1, y=y1).to_excellon(settings))
excellon += 'M16\nG05\n'
else: