| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- 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();
- }
|