|
|
@@ -1,7 +1,159 @@
|
|
|
include <../config/headphones_holder.scad>
|
|
|
|
|
|
+module headphones_holder_hanger_object() {
|
|
|
+ height = headphones_holder_height;
|
|
|
+ depth = headphones_holder_depth;
|
|
|
+ leg_depth = headphones_holder_leg_depth;
|
|
|
+ leg_width = headphones_holder_leg_width;
|
|
|
+ leg_thickness = headphones_holder_leg_thickness;
|
|
|
+ blocker_size = headphones_hanger_blocker_size;
|
|
|
+
|
|
|
+ module hanger() {
|
|
|
+ module main() {
|
|
|
+ size = [
|
|
|
+ blocker_size,
|
|
|
+ leg_depth * 1.5,
|
|
|
+ blocker_size
|
|
|
+ ];
|
|
|
+
|
|
|
+ cube(size, center = true);
|
|
|
+ }
|
|
|
+
|
|
|
+ module headphones() {
|
|
|
+ size = [
|
|
|
+ blocker_size,
|
|
|
+ blocker_size * 2,
|
|
|
+ blocker_size / 2
|
|
|
+ ];
|
|
|
+
|
|
|
+ translate([0, 0, blocker_size / 4]) {
|
|
|
+ cube(size, center = true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ render() {
|
|
|
+ difference() {
|
|
|
+ main();
|
|
|
+ headphones();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ hanger();
|
|
|
+}
|
|
|
+
|
|
|
+module headphones_holder_leg_object() {
|
|
|
+ height = headphones_holder_height;
|
|
|
+ depth = headphones_holder_depth;
|
|
|
+ leg_depth = headphones_holder_leg_depth;
|
|
|
+ leg_width = headphones_holder_leg_width;
|
|
|
+ leg_thickness = headphones_holder_leg_thickness;
|
|
|
+ blocker_size = headphones_hanger_blocker_size;
|
|
|
+
|
|
|
+ module legs_shape() {
|
|
|
+ module single_leg(splited = false) {
|
|
|
+ module point(x, y, squared = false) {
|
|
|
+ translate([x, y]) {
|
|
|
+ if (squared) {
|
|
|
+ square(leg_width, center = true);
|
|
|
+ } else {
|
|
|
+ circle(r = leg_width / 2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ move_x = leg_depth / 2 - leg_width / 2;
|
|
|
+ move_y = leg_depth / 2 - leg_width / 2;
|
|
|
+
|
|
|
+ union() {
|
|
|
+ hull() {
|
|
|
+ point(-move_x, move_y, squared = !splited);
|
|
|
+ point(move_x, move_y, squared = splited);
|
|
|
+ }
|
|
|
+
|
|
|
+ hull() {
|
|
|
+ if (splited) {
|
|
|
+ point(-move_x, move_y, squared = false);
|
|
|
+ point(-move_x, -move_y, squared = false);
|
|
|
+ } else {
|
|
|
+ point(move_x, move_y, squared = false);
|
|
|
+ point(move_x, -move_y, squared = false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ translate([-leg_depth / 2, 0]) {
|
|
|
+ single_leg(splited = true);
|
|
|
+ }
|
|
|
+
|
|
|
+ translate([leg_depth / 2, 0]) {
|
|
|
+ single_leg();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ module legs_object() {
|
|
|
+ linear_extrude(height = leg_thickness, center = false) {
|
|
|
+ legs_shape();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ module frame_object() {
|
|
|
+ precission = 1 / $fn;
|
|
|
+
|
|
|
+ module end_shape(x, y, z, top = false) {
|
|
|
+ translate([x, y, z - precission * (top ? 1 : -1)]) {
|
|
|
+ width = leg_width * (top ? 1 : 2);
|
|
|
+ depth = leg_width;
|
|
|
+ height = precission;
|
|
|
+
|
|
|
+ cube([width, depth, height], center = true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ move_y_bottom = leg_depth / 2 - leg_width / 2;
|
|
|
+ move_y_top = move_y_bottom + depth;
|
|
|
+
|
|
|
+ hull() {
|
|
|
+ end_shape(0, move_y_bottom, 0, top = false);
|
|
|
+ end_shape(0, move_y_top, height + depth, top = true);
|
|
|
+ }
|
|
|
+
|
|
|
+ hull() {
|
|
|
+ end_shape(0, move_y_top, height + depth, top = true);
|
|
|
+ end_shape(0, move_y_top, height + depth + blocker_size, top = true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ legs_object();
|
|
|
+
|
|
|
+ translate([0, 0, leg_thickness]) {
|
|
|
+ frame_object();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
module headphones_holder_object() {
|
|
|
height = headphones_holder_height;
|
|
|
depth = headphones_holder_depth;
|
|
|
leg_depth = headphones_holder_leg_depth;
|
|
|
+ leg_width = headphones_holder_leg_width;
|
|
|
+ leg_thickness = headphones_holder_leg_thickness;
|
|
|
+ blocker_size = headphones_hanger_blocker_size;
|
|
|
+
|
|
|
+
|
|
|
+ color("#444444") {
|
|
|
+ render() {
|
|
|
+ headphones_holder_leg_object();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ hanger_z = leg_thickness + height + depth + blocker_size / 2;
|
|
|
+
|
|
|
+ color("#999999") {
|
|
|
+ render() {
|
|
|
+ translate([0, 0, hanger_z]) {
|
|
|
+ headphones_holder_hanger_object();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|