1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-09-25 13:59:04 +02:00

fix base orientation

This commit is contained in:
Justin Lin
2019-09-15 08:26:02 +08:00
parent f5f0c7d5f8
commit bc8bf7f67b

View File

@@ -1,7 +1,7 @@
leng = 30; leng = 30;
leng_diff = 3; leng_diff = 3;
min_leng = 2; min_leng = 2;
model = "Cube"; // [Cube, Base, Both] model = "Both"; // [Cube, Base, Both]
module spiral_cube(leng, leng_diff, min_leng) { module spiral_cube(leng, leng_diff, min_leng) {
thickness = leng_diff / 3; thickness = leng_diff / 3;
@@ -81,11 +81,10 @@ if(model == "Cube") {
} else if(model == "Base") { } else if(model == "Base") {
base(leng); base(leng);
} else { } else {
// Because of float precision problems, I roate the base instead of the cube. half_leng = leng / 2;
spiral_cube(leng, leng_diff, min_leng); rotate([45, atan2(1, sqrt(2)), 0])
rotate([-45, 0, 0]) spiral_cube(leng, leng_diff, min_leng);
rotate([0, -atan2(1, sqrt(2)), 0]) translate([0, 0, -half_leng * sqrt(3) - leng / 15])
translate([0, 0, -half_leng * sqrt(3) - leng / 15]) base(leng);
base(leng);
} }