More toy cubes
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
include <BOSL2/std.scad>
|
||||
|
||||
cube_h = 40;
|
||||
cube_w = 40;
|
||||
rounding = 2;
|
||||
|
||||
cube_diag = cube_w*sqrt(2);
|
||||
|
||||
cutout_d = 20;
|
||||
|
||||
$fn=150;
|
||||
|
||||
/* Cubes */
|
||||
|
||||
module cube_simple() { // make me
|
||||
cuboid([cube_w,cube_w,cube_h], rounding=rounding);
|
||||
}
|
||||
|
||||
module cube_with_round_hole() { // make me
|
||||
difference() {
|
||||
cube_simple();
|
||||
cyl(h=cube_h, d=cutout_d, chamfer=-rounding/2);
|
||||
}
|
||||
}
|
||||
|
||||
module cube_long_with_round_hole() { // make me
|
||||
difference() {
|
||||
cuboid([cube_w,cube_w,2*cube_h], rounding=rounding);
|
||||
cyl(h=2*cube_h, d=cutout_d, chamfer=-rounding/2);
|
||||
}
|
||||
}
|
||||
|
||||
/* Cylinders */
|
||||
|
||||
module cylinder_simple() { // make me
|
||||
cyl(d=cube_diag, h=cube_h, rounding=rounding);
|
||||
}
|
||||
|
||||
module cylinder_with_round_hole() { // make me
|
||||
difference() {
|
||||
cylinder_simple();
|
||||
cyl(h=cube_h, d=cutout_d, chamfer=-rounding/2);
|
||||
}
|
||||
}
|
||||
|
||||
/* Triangle */
|
||||
|
||||
module triangle_simple() { // make me
|
||||
rounded_prism(regular_ngon(n=3, od=cube_diag), joint_top=rounding, joint_bot=rounding, joint_sides=rounding, h=cube_h);
|
||||
}
|
||||
|
||||
module triangle_with_round_hole() { // make me
|
||||
difference() {
|
||||
triangle_simple();
|
||||
cyl(h=cube_h, d=cutout_d, chamfer=-rounding/2);
|
||||
}
|
||||
}
|
||||
|
||||
/* Pentagon */
|
||||
|
||||
module pentagon_simple() { // make me
|
||||
rounded_prism(regular_ngon(n=5, od=cube_diag), joint_top=rounding, joint_bot=rounding, joint_sides=rounding, h=cube_h);
|
||||
}
|
||||
|
||||
module pentagon_with_round_hole() { // make me
|
||||
difference() {
|
||||
pentagon_simple();
|
||||
cyl(h=cube_h, d=cutout_d, chamfer=-rounding/2);
|
||||
}
|
||||
}
|
||||
|
||||
/* Hexagon */
|
||||
|
||||
module hexagon_simple() { // make me
|
||||
rounded_prism(regular_ngon(n=6, od=cube_diag), joint_top=rounding, joint_bot=rounding, joint_sides=rounding, h=cube_h);
|
||||
}
|
||||
|
||||
module hexagon_with_round_hole() { // make me
|
||||
difference() {
|
||||
hexagon_simple();
|
||||
cyl(h=cube_h, d=cutout_d, chamfer=-rounding/2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
cube_with_round_hole();
|
||||
Reference in New Issue
Block a user