1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-13 02:04:16 +02:00
This commit is contained in:
Justin Lin
2019-09-19 15:39:38 +08:00
parent 7634a0dd72
commit afa3dbcd62

View File

@@ -31,10 +31,11 @@ module rounded_cube(size, corner_r, center = false) {
half_cube_leng = size / 2; half_cube_leng = size / 2;
half_leng = half_cube_leng - edge_d; half_leng = half_cube_leng - edge_d;
pair = [1, -1];
corners = [ corners = [
for(z = [1, -1]) for(z = pair)
for(y = [1, -1]) for(y = pair)
for(x = [1, -1]) for(x = pair)
[half_l * x, half_w * y, half_h * z] [half_l * x, half_w * y, half_h * z]
]; ];
@@ -47,14 +48,14 @@ module rounded_cube(size, corner_r, center = false) {
// Don't use `hull() for(...) {...}` because it's slow. // Don't use `hull() for(...) {...}` because it's slow.
translate(center_pts) hull() { translate(center_pts) hull() {
corner(0); corner(0);
corner(1); corner(1);
corner(2); corner(2);
corner(3); corner(3);
corner(4); corner(4);
corner(5); corner(5);
corner(6); corner(6);
corner(7); corner(7);
} }
// hook for testing // hook for testing