Skip to content

Instantly share code, notes, and snippets.

@okkdev
Created February 27, 2023 18:53
Show Gist options
  • Save okkdev/8361a759bb73fe20a87339033d03c4bd to your computer and use it in GitHub Desktop.
Save okkdev/8361a759bb73fe20a87339033d03c4bd to your computer and use it in GitHub Desktop.
rounded cube openscad
//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