Commit e7a6cc23 authored by gijs's avatar gijs

More stable pen selection

parent a7efa52f
......@@ -48,17 +48,14 @@ def ploteps():
dirtyhpgl = ''.join(handle.readlines()).replace('\n', '')
cleanhpglchunks = []
pencount = 3
pen = 1
pencount = 4
for chunk in dirtyhpgl.split(';'):
if chunk[0:2] in ['PA', 'PR', 'PU', 'PD']:
cleanhpglchunks.append(chunk)
elif chunk[0:2] == 'SP':
pen += 1
if pen > pencount:
pen = 1
pen = int(chunk[2]) % pencount
cleanhpglchunks.append('SP{}'.format(pen))
cleanhpgl = ';'.join(cleanhpglchunks)
......
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