2022-10-13 22:35:21 +00:00
|
|
|
// Assorted modules to be re-used by multiple files
|
|
|
|
|
2022-10-14 01:18:51 +00:00
|
|
|
|
|
|
|
// Stuff that's used for tops:
|
|
|
|
|
2022-10-13 22:35:21 +00:00
|
|
|
module leg(height) {
|
2022-10-13 23:27:02 +00:00
|
|
|
color(COLORSCHEME == "semantic" ? COLOR_SEMANTIC_LOAD_BEARING : COLOR_STEEL) {
|
|
|
|
union() {
|
|
|
|
translate([0, 0, height - LEG_BASE_THICKNESS]){
|
|
|
|
cylinder(d=LEG_BASE_DIAMETER, h=LEG_BASE_THICKNESS, $fn=8);
|
|
|
|
}
|
|
|
|
cylinder(d=LEG_DIAMETER, h=height, $fn=8);
|
2022-10-13 22:35:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module stand_side() {
|
|
|
|
|
|
|
|
difference() {
|
2022-10-13 23:27:02 +00:00
|
|
|
color(COLORSCHEME == "semantic" ? COLOR_SEMANTIC_LOAD_BEARING : COLOR_WOOD) {
|
|
|
|
cube([
|
|
|
|
STAND_DEPTH,
|
|
|
|
STAND_HEIGHT - STAND_THICKNESS,
|
|
|
|
STAND_THICKNESS
|
|
|
|
]);
|
|
|
|
}
|
2022-10-13 22:35:21 +00:00
|
|
|
|
|
|
|
// cut out cable slot
|
2022-10-13 23:27:02 +00:00
|
|
|
color(COLORSCHEME == "semantic" ? COLOR_SEMANTIC_CABLE_MANAGEMENT : COLOR_CUTOUT) {
|
2022-10-13 22:35:21 +00:00
|
|
|
translate([
|
|
|
|
(STAND_DEPTH - CABLE_SLOT_WIDTH) / 2,
|
|
|
|
STAND_HEIGHT - STAND_THICKNESS - CABLE_SLOT_SIDE_OFFSET - CABLE_SLOT_DEPTH,
|
|
|
|
-CUTOUT_OVERCOMMIT
|
|
|
|
]){
|
|
|
|
cube([
|
|
|
|
CABLE_SLOT_WIDTH,
|
|
|
|
CABLE_SLOT_DEPTH,
|
|
|
|
CUTOUT_OVERCOMMIT + STAND_THICKNESS + CUTOUT_OVERCOMMIT
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module spacer_cuff() {
|
|
|
|
cylinder(d=LEG_DIAMETER + 2 * SPACER_CUFF_THICKNESS, h=SPACER_CUFF_HEIGHT, $fn=8);
|
|
|
|
}
|
|
|
|
|
|
|
|
module spacer(length) {
|
|
|
|
// length is not the overall length, but the distance between
|
|
|
|
// the centerpoints of the two legs/feet being connected
|
|
|
|
|
|
|
|
spacer_cuff_diameter = (LEG_DIAMETER + 2 * SPACER_CUFF_THICKNESS);
|
|
|
|
mid_segment_length = length - spacer_cuff_diameter;
|
|
|
|
|
2022-10-13 23:27:02 +00:00
|
|
|
color(COLORSCHEME == "semantic" ? COLOR_SEMANTIC_LOAD_BEARING : COLOR_STEEL) {
|
|
|
|
difference() {
|
|
|
|
union() {
|
|
|
|
spacer_cuff();
|
2022-10-13 22:35:21 +00:00
|
|
|
|
2022-10-13 23:27:02 +00:00
|
|
|
translate([0, mid_segment_length + spacer_cuff_diameter / 2, SPACER_CUFF_HEIGHT / 2]){
|
|
|
|
rotate([90, 0, 0]){
|
|
|
|
cylinder(d=SPACER_THICKNESS, h=mid_segment_length, $fn=8);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
translate([0, length, 0]){
|
|
|
|
spacer_cuff();
|
2022-10-13 22:35:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-13 23:27:02 +00:00
|
|
|
cylinder(d=LEG_DIAMETER, h=SPACER_CUFF_HEIGHT, $fn=8); // hole in first cuff
|
2022-10-13 22:35:21 +00:00
|
|
|
translate([0, length, 0]){
|
2022-10-13 23:27:02 +00:00
|
|
|
cylinder(d=LEG_DIAMETER, h=SPACER_CUFF_HEIGHT, $fn=8); // hole in second cuff
|
2022-10-13 22:35:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-10-14 01:18:51 +00:00
|
|
|
|
|
|
|
// Stuff that's used for subs:
|
|
|
|
|
|
|
|
module screw() {
|
|
|
|
color(COLORSCHEME == "semantic" ? COLOR_SEMANTIC_LOAD_BEARING : COLOR_STEEL) {
|
|
|
|
translate([0, 0, MODULE_SCREW_LENGTH]){
|
|
|
|
cylinder(d=SCREW_HEAD_DIAMETER, h=SCREW_HEAD_THICKNESS, $fn=6);
|
|
|
|
}
|
|
|
|
cylinder(d=SCREW_DIAMETER, h=MODULE_SCREW_LENGTH);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module screw_hole() {
|
|
|
|
color(COLOR_CUTOUT){
|
|
|
|
cylinder(d=SCREW_DIAMETER * 1.01, h=MODULE_SCREW_LENGTH + CUTOUT_OVERCOMMIT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module barrel_nut() {
|
|
|
|
color(COLORSCHEME == "semantic" ? COLOR_SEMANTIC_LOAD_BEARING : COLOR_STEEL) {
|
|
|
|
difference() {
|
|
|
|
translate([
|
|
|
|
-MODULE_THICKNESS / 2, // center on origin
|
|
|
|
0,
|
|
|
|
BARREL_NUT_DIAMETER / 2 // but with the bottom at z=0
|
|
|
|
]){
|
|
|
|
rotate([0, 90, 0]){
|
|
|
|
cylinder(d=BARREL_NUT_DIAMETER, h=MODULE_THICKNESS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cylinder(d=SCREW_DIAMETER, h=BARREL_NUT_DIAMETER); // screw hole
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module barrel_nut_hole(){
|
|
|
|
color(COLOR_CUTOUT){
|
|
|
|
translate([
|
|
|
|
-MODULE_THICKNESS / 2 - CUTOUT_OVERCOMMIT, // center on origin
|
|
|
|
0,
|
|
|
|
BARREL_NUT_DIAMETER / 2 // but with the bottom at z=0
|
|
|
|
]){
|
|
|
|
rotate([0, 90, 0]){
|
|
|
|
cylinder(d=BARREL_NUT_DIAMETER * 1.01, h=CUTOUT_OVERCOMMIT + MODULE_THICKNESS + CUTOUT_OVERCOMMIT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|