/
/
/
1import os
2from decimal import Decimal
3from shutil import which, rmtree
4
5buildPath = "./.build"
6
7print("HotKeep Generator V1")
8print("created by Gerrit 'Geaz' Gazic")
9print()
10
11if which("openscad") is None:
12 print("OpenSCAD was not found! Please make sure that it is in your PATH!")
13 exit()
14
15printClearance = Decimal(input("Enter your print clearance [0.2] : ") or "0.2")
16smallHolePrintClearance = Decimal(input("Enter your small hole print clearance (used for anything smaller than 1.5mm). [0.7] : ") or "0.7")
17
18if os.path.isdir(buildPath):
19 rmtree(buildPath)
20os.mkdir(buildPath)
21
22files = [
23 {"input":"1 - Hotswap Socket.scad", "output":"1 - Hotswap Socket.stl" },
24 {"input":"2 - Hotswap Board.scad", "output":"2 - Hotswap Board.stl" },
25 {"input":"3 - Plate.scad", "output":"3 - Plate.stl" },
26 {"input":"4 - Top Layer.scad", "output":"4 - Top Layer.stl" },
27 {"input":"5 - Middle Layer.scad", "output":"5 - Middle Layer.stl" },
28 {"input":"6 - Bottom Layer.scad", "output":"6 - Bottom Layer.stl" }
29]
30
31for i in files:
32 print("Creating {} ...".format(i["output"]))
33 os.system("openscad -q -D printClearance={} -D smallHolePrintClearance={} -o \"./{}/{}\" \"{}\"".format(printClearance, smallHolePrintClearance, buildPath, i["output"], i["input"]))