From ba89c31b177c51228762885868c27e4c04dbf676 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Thu, 24 Jun 2021 16:51:08 +0800 Subject: [PATCH] add BOTH option --- examples/taiwan/spiral_cube.scad | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/taiwan/spiral_cube.scad b/examples/taiwan/spiral_cube.scad index 3ce4e2dd..c67d2268 100644 --- a/examples/taiwan/spiral_cube.scad +++ b/examples/taiwan/spiral_cube.scad @@ -3,7 +3,7 @@ use ; leng = 30; leng_diff = 3; min_leng = 2; -model = "Cube"; // [Cube, Base] +model = "Cube"; // [Cube, Base, Both] module spiral_cube(leng, leng_diff, min_leng) { thickness = leng_diff / 3; @@ -82,5 +82,10 @@ if(model == "Cube") { spiral_cube(leng, leng_diff, min_leng); } else if(model == "Base") { base(leng); -} +} else { + translate([0, 0, leng * sqrt(3) / 2 + leng / 15]) + rotate([45, atan2(1, sqrt(2)), 0]) + spiral_cube(leng, leng_diff, min_leng); + base(leng); +}