Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorJoseph Lenox <lordofhyphens@gmail.com>2016-06-02 19:43:34 +0300
committerJoseph Lenox <lordofhyphens@gmail.com>2016-06-02 19:43:34 +0300
commit5e1774642796ae04dc048e92b13bfe7a96ed1598 (patch)
tree399b39fdff9ce03a1a897402207c9d08f8fd818d /utils
parent7b334bf2e5315f074d408309b2256859252bd6ab (diff)
Post process script for fan kickstart
Addresses #3308
Diffstat (limited to 'utils')
-rw-r--r--utils/post-processing/fan_kickstart.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/utils/post-processing/fan_kickstart.py b/utils/post-processing/fan_kickstart.py
new file mode 100644
index 000000000..9ee1bc0a4
--- /dev/null
+++ b/utils/post-processing/fan_kickstart.py
@@ -0,0 +1,13 @@
+#!/usr/bin/python
+import sys
+import re
+
+sea = re.compile("M106 S[1-9]+[0-9]*")
+rep = re.compile("M106 S255\n\g<0>")
+out = open(sys.argv[1]+"_fixed", 'w')
+ with open(sys.argv[1]) as f:
+ for r in f:
+ if re.search(sea, r) is not None:
+ out.write(re.sub(sea,"M106 S255\n\g<0>",r))
+ else:
+ out.write(r)