fix a issue that coordinate normalization for excellon is imperfect

This commit is contained in:
Hiroshi Murayama 2019-09-30 18:52:17 +09:00
parent 242dc2ae17
commit d7a0693242
3 changed files with 7 additions and 4 deletions

View file

@ -138,7 +138,9 @@ class DrillComposition(Composition):
if num == t.number:
yield statement.to_excellon(self.settings)
yield EndOfProgramStmt().to_excellon()
self.settings.notation = 'absolute'
self.settings.zeros = 'trailing'
with open(path, 'w') as f:
gerberex.excellon.write_excellon_header(f, self.settings, self.tools)
for statement in statements():

View file

@ -475,9 +475,8 @@ class DxfFile(CamFile):
self.statements.pitch = value
def write(self, filename=None, filetype=FT_RX274X):
if self.settings.notation != 'absolute':
raise Exception('DXF file\'s notation must be absolute ')
self.settings.notation = 'absolute'
self.settings.zeros = 'trailing'
filename = filename if filename is not None else self.filename
with open(filename, 'w') as f:
if filetype == self.FT_RX274X:

View file

@ -200,6 +200,8 @@ class ExcellonFileEx(ExcellonFile):
self.units = 'metric'
def write(self, filename=None):
self.notation = 'absolute'
self.zeros = 'trailing'
filename = filename if filename is not None else self.filename
with open(filename, 'w') as f:
write_excellon_header(f, self.settings, [self.tools[t] for t in self.tools])