I've been meaning to write a quick script that would do this. You can use two similar processes to print the same model and interleave them by postprocessing the code to delete every other layer. This is a total messy hack, but you could definitely use this to test the interleaved perimeters (or interleaved infill percentages, or anything,really). I'm going to test it on an actual print sometime layer, I've got some other things going right now.
Usage:
interleave.py <FILE> <PROCESS COUNT>
Example Simplify3D postprocessing line:
./Users/dorsai3d/bin/interleave.py "[output_filepath]" 2
Code: Select all
#!/usr/bin/env python
"""
Interleave overlapping process gcode generated by Simplify3D
interleave.py <FILE> <PROCESS COUNT>
v0.1 by dorsai3d
"""
import os
import re
import sys
import string
import time
if __name__ == '__main__':
if len(sys.argv) < 3:
sys.exit('usage: interleave.py <FILE> <PROCESS COUNT>')
infilename = sys.argv[1]
outfilename = '{}_interleaved{}'.format(os.path.splitext(infilename)[0],os.path.splitext(infilename)[1])
processCount = int(sys.argv[2])
currentLayer = 0
#Wait until Simplify3D is done writing the gcode file
targetLastModifiedTime = os.path.getmtime(infilename)
while (time.time() - targetLastModifiedTime) < 0.5:
sleep(0.25)
targetLastModifiedTime = os.path.getmtime(infilename)
with open(infilename) as infile:
with open(outfilename,"w") as outfile:
for line in infile:
code = string.split(line)
if len(code)>1:
if code[1]=='layer':
if code[2] != 'end':
currentLayer = currentLayer + 1
elif code[2] == 'end':
currentLayer = 0
outfile.write(line)
elif currentLayer == 0:
outfile.write(line)
elif currentLayer % processCount != 1:
pass
else:
outfile.write(line)