I just wanted to share some results from playing around in Python the past couple of days. I wrote a gcode generator from scratch, and I added support for generating paths with lines and arcs. I certainly have aspirations for automating more things in my workflow, but right now, this already saves me a lot of time as ad hoc surfacing programs are a pain.
Right now I just have the code on my computer. Is this something anyone would be interested in?
Here’s the script I wrote for surfacing.
# Lead-in and lead-out using z-arc
self.lead = ZArcLeadStrategy(tool_diameter/2+1, 25, np.pi/6)
# Create the path
# Find the number of passes
if direction == SurfacingProgram.horizontal_surfacing:
num_passes = np.ceil(height / (self.tool.diameter*stepover))+1
else:
num_passes = np.ceil(width / (self.tool.diameter*stepover))+1
delta = height/(num_passes-1)
# Create the paths
passes = []
for i in range(int(num_passes)):
if direction == SurfacingProgram.horizontal_surfacing:
p = Path((0,i*delta,0))
p.LineTo((width,i*delta,0))
else:
p = Path((i*delta,0,0))
p.LineTo((i*delta,height,0))
passes.append(p)
# Contour on path
self.contourCut(passes, self.tool, self.lead, zstart, zstop, zstep)
Below are the results in NCViewer for surfacing 100mm x 100mm using McFly: