diff options
author | Hiroshi Murayama <opiopan@gmail.com> | 2019-09-28 20:42:11 +0900 |
---|---|---|
committer | Hiroshi Murayama <opiopan@gmail.com> | 2019-09-28 20:42:11 +0900 |
commit | 48b35377b1cce897a70d1d037b3e73b616af9be7 (patch) | |
tree | 483238db68f4387e26c826ddc9cb858c30d14024 /gerberex | |
parent | a3c750fc060c6ff6b071dca2a7c765b8629efe8a (diff) | |
download | gerbonara-48b35377b1cce897a70d1d037b3e73b616af9be7.tar.gz gerbonara-48b35377b1cce897a70d1d037b3e73b616af9be7.tar.bz2 gerbonara-48b35377b1cce897a70d1d037b3e73b616af9be7.zip |
minor refactoring
Diffstat (limited to 'gerberex')
-rw-r--r-- | gerberex/dxf.py | 2 | ||||
-rw-r--r-- | gerberex/dxf_path.py | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/gerberex/dxf.py b/gerberex/dxf.py index 8f0b984..eca246c 100644 --- a/gerberex/dxf.py +++ b/gerberex/dxf.py @@ -120,7 +120,7 @@ class DxfArcStatement(DxfStatement): self.start = (self.center[0] + self.radius, self.center[1]) self.end = self.start self.start_angle = 0 - self.end_angle = -360 + self.end_angle = 360 self.is_closed = True elif entity.dxftype == 'ARC': self.start_angle = self.entity.start_angle 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: |