summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-12-27 13:34:54 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-12-27 13:39:42 (GMT)
commit3ea4f69cd800235887998eef16eedce92911f09d (patch)
tree11d427a19d331d5532b98bf0232e7382f86f7379
parent96834213f100f6fcfad59c96a6fe3cecbed36ded (diff)
downloadmisc-3ea4f69cd800235887998eef16eedce92911f09d.zip
misc-3ea4f69cd800235887998eef16eedce92911f09d.tar.gz
misc-3ea4f69cd800235887998eef16eedce92911f09d.tar.bz2
spacer/spacer.py: add 3D printing mode (in addition to CNC-milling)
-rwxr-xr-xspacer/spacer.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/spacer/spacer.py b/spacer/spacer.py
index ecb7f77..94b7357 100755
--- a/spacer/spacer.py
+++ b/spacer/spacer.py
@@ -18,6 +18,11 @@ from cad import *
# [2] http://irclog.whitequark.org/neo900/2015-07-20#13467507
#
+# Use cnc = True if CNC-milling from a 5.0 mm workpiece.
+# Use cnc = False if 3D-printing.
+
+cnc = False
+
extension = 3.3
top_t = 1.0
@@ -360,7 +365,8 @@ stab_t = 2.5 # this makes the stabilizers protrude about
# 0.5 mm below the PCB. We have room for about
# 1.0 mm.
-stab_t = 1.7 # if working with a 5.0 mm raw piece, the total
+if cnc:
+ stab_t = 1.7 # if working with a 5.0 mm raw piece, the total
# depth is limited. We'd need at least 6.0 mm
# to extend the front stabilizers.
@@ -520,7 +526,12 @@ if True:
frame = frame.fuse(s_out)
visualize(doc, frame, "Frame", (1.0, 1.0, 1.0), 50)
- visualize(doc, fill, "Fillers", (1.0, 1.0, 1.0), 80)
+ if cnc:
+ visualize(doc, fill, "Fillers", (1.0, 1.0, 1.0), 80)
- export = frame.fuse(fill)
+ if cnc:
+ export = frame.fuse(fill)
+ else:
+ frame.rotate(v(0, 0, 0), v(0, 1, 0), 180)
+ export = frame
export.exportStl("spacer.stl")