3d-stuff/openscad/own/1043-mounts/switchmount.scad

84 lines
2.1 KiB
OpenSCAD

// TP-Link 1043N/ND (v1) Wall mount
// by zeus - zeus@ctdo.de - CC-BY-NC-4.0
// -> https://www.thingiverse.com/zeus
// -> https://github.com/zeus86
// 2015-01-17
// =====================================================================
// Variables
// material thickness
material_t=3;
// "thickness" of switch
thickness=25.5;
// overall depth
d=thickness+material_t*2;
// width of holder
w=15+material_t;
// length of holder
l=50;
// screwhole diameter
hole_d=4.5;
big_hole_d=8.5;
//screwhole slider (set to hole_d to disable; requires printing bridges)
hole_slider=10;
big_hole_slider=hole_slider+(big_hole_d-hole_d);
//lip height
lip_h=4;
//lip offset
lip_offset=5;
// radius of switch corner
corner_r=15;
$fn=50;
// =====================================================================
// Code
module carving(dia,carving_h){
hull(){
cylinder(r=dia,h=carving_h,center=true);
translate([-dia,0,0]){cylinder(r=dia,h=carving_h,center=true);}
translate([0,d,0]){cylinder(r=dia,h=carving_h,center=true);}
}
}
module hole(hole_dia,hole_h,slider){
hull(){
translate([-slider/2+hole_dia/2,0,0])cylinder(r=hole_dia/2,h=hole_h+0.1,center=true);
translate([slider/2-hole_dia/2,0,0])cylinder(r=hole_dia/2,h=hole_h+0.1,center=true);
}
}
module holder(){
difference(){
cube([w,l,d],center=true);
translate([-corner_r+w/2-material_t,corner_r-l/2+material_t,0]){
carving(corner_r,thickness+0.1);
}
hull(){
translate([-corner_r+w/2-material_t,corner_r-l/2+material_t,d/2-lip_h+1]){
carving(corner_r,1);
}
translate([-corner_r+w/2-material_t,corner_r-l/2+material_t,d/2-0.4]){
carving(corner_r-lip_offset,1);
}
}
translate([-material_t/2,l/4,-d/2+material_t/2])hole(hole_d,material_t,hole_slider);
translate([-material_t/2,l/4,-d/2+material_t])hole(big_hole_d,material_t,big_hole_slider);
translate([-material_t/2,-l/8,-d/2+material_t/2])hole(hole_d,material_t,hole_slider);
translate([-material_t/2,-l/8,-d/2+material_t])hole(big_hole_d,material_t,big_hole_slider);
}
}
mirror([0,0,0]){
holder();
}