Browse Source

improve sparkmaker script

Thomas Buck 1 year ago
parent
commit
c18f99e218
1 changed files with 24 additions and 2 deletions
  1. 24
    2
      tools/convert_sparkmaker.py

+ 24
- 2
tools/convert_sparkmaker.py View File

@@ -1,5 +1,11 @@
1 1
 #!/usr/bin/env python
2 2
 
3
+# convert_sparkmaker.py
4
+# Copyright 2023 Thomas Buck <thomas@xythobuz.de>
5
+# Convert PrusaSlicer .sl1 files to Sparkmaker .wow format
6
+# Lift settings can only be customized below, not in the slicer.
7
+# Should also work for Sparkmaker FHD, adjust parameters below.
8
+
3 9
 import sys
4 10
 import os
5 11
 from zipfile import ZipFile
@@ -20,6 +26,7 @@ initial_params = {
20 26
     'lift_speed': 30.0,
21 27
     'sink_speed': 100.0
22 28
 }
29
+final_move_speed = 100.0
23 30
 
24 31
 ###############################################################################
25 32
 
@@ -145,11 +152,14 @@ def write_wow(f, params, imgs):
145 152
         write("G4 S" + str(exposure_time) + ";")
146 153
         write("G4 S1;")
147 154
 
155
+    write("M106 S0;")
156
+
148 157
     object_height = params['layer_height'] * (len(imgs) - 1) + params['first_layer_height']
149 158
     final_move = max_height - object_height
159
+    if final_move >= 1.0:
160
+        write("G1 Z1 F" + str(params['lift_speed']) + ";")
161
+        write("G1 Z" + str(final_move - 1.0) + " F" + str(final_move_speed) + ";")
150 162
 
151
-    write("M106 S0;")
152
-    write("G1 Z" + str(final_move) + " F25;")
153 163
     write("M18;")
154 164
 
155 165
 ###############################################################################
@@ -175,6 +185,18 @@ def main():
175 185
 
176 186
     print("Using following parameters:")
177 187
     pprint.pprint(params)
188
+
189
+    print("Height: {:.3f}".format(params['first_layer_height'] + (params['layer_height'] * (len(imgs) - 1))) + "mm")
190
+
191
+    t = params['first_exposure_time']
192
+    t += (len(imgs) - 1) * params['exposure_time']
193
+    t += params['lift_height'] / params['lift_speed'] * 60 * len(imgs)
194
+    t += (params['lift_height'] - params['layer_height']) / params['sink_speed'] * 60 * len(imgs)
195
+    h = t / 3600
196
+    m = (t / 60) % 60
197
+    s = t % 60
198
+    print("Estimated print time: " + str(int(h)) + "h " + str(int(m)) + "m " + str(int(s)) + "s")
199
+
178 200
     print("Writing output to \"" + out_file_name + "\"")
179 201
 
180 202
     with open(out_file_name, 'wb') as wow:

Loading…
Cancel
Save