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
 #!/usr/bin/env python
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
 import sys
9
 import sys
4
 import os
10
 import os
5
 from zipfile import ZipFile
11
 from zipfile import ZipFile
20
     'lift_speed': 30.0,
26
     'lift_speed': 30.0,
21
     'sink_speed': 100.0
27
     'sink_speed': 100.0
22
 }
28
 }
29
+final_move_speed = 100.0
23
 
30
 
24
 ###############################################################################
31
 ###############################################################################
25
 
32
 
145
         write("G4 S" + str(exposure_time) + ";")
152
         write("G4 S" + str(exposure_time) + ";")
146
         write("G4 S1;")
153
         write("G4 S1;")
147
 
154
 
155
+    write("M106 S0;")
156
+
148
     object_height = params['layer_height'] * (len(imgs) - 1) + params['first_layer_height']
157
     object_height = params['layer_height'] * (len(imgs) - 1) + params['first_layer_height']
149
     final_move = max_height - object_height
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
     write("M18;")
163
     write("M18;")
154
 
164
 
155
 ###############################################################################
165
 ###############################################################################
175
 
185
 
176
     print("Using following parameters:")
186
     print("Using following parameters:")
177
     pprint.pprint(params)
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
     print("Writing output to \"" + out_file_name + "\"")
200
     print("Writing output to \"" + out_file_name + "\"")
179
 
201
 
180
     with open(out_file_name, 'wb') as wow:
202
     with open(out_file_name, 'wb') as wow:

Loading…
Cancel
Save