95 lines
2.1 KiB
OpenSCAD
95 lines
2.1 KiB
OpenSCAD
include <BOSL2/std.scad>
|
|
|
|
cube_h = 40;
|
|
cube_w = 40;
|
|
rounding = 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=(4*cube_w)/PI, 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, side=(4*cube_w)/3), 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, side=(4*cube_w)/5), 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, side=(4*cube_w)/6), 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);
|
|
}
|
|
}
|
|
|
|
/* Octagon */
|
|
|
|
module octagon_simple() { // make me
|
|
rounded_prism(regular_ngon(n=8, side=(4*cube_w)/8), joint_top=rounding, joint_bot=rounding, joint_sides=rounding, h=cube_h);
|
|
}
|
|
|
|
module octagon_with_round_hole() { // make me
|
|
difference() {
|
|
octagon_simple();
|
|
cyl(h=cube_h, d=cutout_d, chamfer=-rounding/2);
|
|
}
|
|
}
|