Commit 0e2e3a56 authored by sumpfralle's avatar sumpfralle

added a simple Exporter for EMC tool definitions


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@278 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 52175090
import os
class EMCToolExporter:
def __init__(self, tools):
self.tools = tools
def get_tool_definition_string(self):
result = []
#result.append(self.HEADER_ROW)
for index in range(len(self.tools)):
tool = self.tools[index]
# use an arbitrary length
tool_length = tool["tool_radius"] * 10
line = "T%d P%d D%f Z-%f ;%s" % (index + 1, index + 1, tool["tool_radius"], tool_length, tool["name"])
result.append(line)
# add the dummy line for the "last" tool
result.append("T99999 P99999 Z+0.100000 ;dummy tool")
return os.linesep.join(result)
list = [ "SimpleGCodeExporter", "SVGExporter", "STLExporter" ] __all__ = [ "SimpleGCodeExporter", "SVGExporter", "STLExporter", "EMCToolExporter"]
__all__ = list
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment