include <../config/headphones_mount.scad> module headphones_mount_object() { length = headphones_mount_length; height = headphones_mount_height; thickness = headphones_mount_thickness; width = headphones_mount_width; screw = headphones_mount_screw; screws_width = headphones_mount_screws_width; module base() { module cutoff(x = 0, y = 0, rotation = 0) { translate([x, y]) { rotate(rotation) { move = width / 2 - thickness / 2; hull() { translate([-move, 0]) { circle(d = thickness); } translate([move, 0]) { circle(d = thickness); } } } } } module ending(split = false) { mirror([split ? 1 : 0, 0, 0]) { translate([length / 2, 0, height - thickness / 2]) { rotate([90, 90, 0]) { rotate_extrude(angle = 90) { cutoff(rotation = 90, x = height - thickness / 2); } } } } } module center() { rotate([90, 0, 90]) { translate([0, 0, -height / 2]) { linear_extrude(height = length + height, center = true) { cutoff(); } } } } module result() { translate([0, 0, thickness / 2 - height / 2]) { ending(split = false); ending(split = true); center(); } } result(); } module screws() { move = screws_width / 2; module screw_hole(x = 0, y = 0) { translate([x, y]) { circle(d = screw); } } module mount() { hull() { translate([-move, 0]) { circle(d = height); } translate([move, 0]) { circle(d = height); } } } module shape() { difference() { mount(); screw_hole(move); screw_hole(-move); } } module final() { linear_extrude(height = thickness, center = true) { shape(); } } translate([thickness * 1.5 - length - height, 0, 0]) { rotate([90, 0, 90]) { final(); } } } module final() { color("#404040") { render() { union() { screws(); base(); } } } } final(); }