Created
February 27, 2023 18:53
-
-
Save okkdev/8361a759bb73fe20a87339033d03c4bd to your computer and use it in GitHub Desktop.
rounded cube openscad
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//3D rounded cube | |
module rcube(width, depth, height, radius, center){ | |
points = [ | |
for (p = [ | |
[0 + radius, 0 + radius], | |
[0 + radius, depth - radius], | |
[width - radius, 0 + radius], | |
[width - radius, depth - radius] | |
]) | |
if (center) [p[0] - width / 2, p[1] - depth / 2] | |
else p | |
]; | |
hull(){ | |
for (p = points){ | |
translate(p) cylinder(r=radius, h=height); | |
} | |
} | |
} | |
rcube(350, 190, 8, 15, center=true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment