diff options
author | Garret Fick <garret@ficksworkshop.com> | 2016-03-24 00:10:34 +0800 |
---|---|---|
committer | Garret Fick <garret@ficksworkshop.com> | 2016-03-24 00:10:34 +0800 |
commit | d12f6385a434c02677bfbb7b075dd9d8e49627fe (patch) | |
tree | 3b5d96eae1d4e57d63a8b4220300c7b21a0ffaa1 /gerber/render/excellon_backend.py | |
parent | a6c186245075efa2af2acf7b736a1c8f0d0d90f6 (diff) | |
download | gerbonara-d12f6385a434c02677bfbb7b075dd9d8e49627fe.tar.gz gerbonara-d12f6385a434c02677bfbb7b075dd9d8e49627fe.tar.bz2 gerbonara-d12f6385a434c02677bfbb7b075dd9d8e49627fe.zip |
Basic rendering of excellon works, but still has issues
Diffstat (limited to 'gerber/render/excellon_backend.py')
-rw-r--r-- | gerber/render/excellon_backend.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gerber/render/excellon_backend.py b/gerber/render/excellon_backend.py index bec8367..f5cec1a 100644 --- a/gerber/render/excellon_backend.py +++ b/gerber/render/excellon_backend.py @@ -10,11 +10,12 @@ class ExcellonContext(GerberContext): self.header = [] self.tool_def = [] self.body = [] + self.start = [HeaderBeginStmt()] self.end = [EndOfProgramStmt()] self.handled_tools = set() self.cur_tool = None - self.pos = (None, None) + self._pos = (None, None) self.settings = settings @@ -25,7 +26,7 @@ class ExcellonContext(GerberContext): @property def statements(self): - return self.comments + self.header + self.body + self.end + return self.start + self.comments + self.header + self.body + self.end def set_bounds(self, bounds): pass @@ -61,15 +62,17 @@ class ExcellonContext(GerberContext): def _render_drill(self, drill, color): - if not drill in self.handled_tools: - self.tool_def.append(drill.tool) + tool = drill.hit.tool + if not tool in self.handled_tools: + self.handled_tools.add(tool) + self.header.append(ExcellonTool.from_tool(tool)) - if drill.tool != self.cur_tool: - self.body.append(ToolSelectionStmt(drill.tool.number)) + if tool != self.cur_tool: + self.body.append(ToolSelectionStmt(tool.number)) point = self._simplify_point(drill.position) self._pos = drill.position - self.body.append(CoordinateStmt.from_point()) + self.body.append(CoordinateStmt.from_point(point)) def _render_inverted_layer(self): pass |