247 lines
6.6 KiB
OpenSCAD
247 lines
6.6 KiB
OpenSCAD
|
include <BOSL/constants.scad>;
|
||
|
use <BOSL/metric_screws.scad>;
|
||
|
$fn=100;
|
||
|
|
||
|
// pcb-related sizes:
|
||
|
inner_height = 11.5;
|
||
|
inner_width = 50;
|
||
|
inner_depth = 12;
|
||
|
// inner body size:
|
||
|
inner_length = inner_height/2+inner_depth;
|
||
|
|
||
|
guard_width = 57.8;
|
||
|
|
||
|
thickness = 1;
|
||
|
gap = 0.4;
|
||
|
glass = 0.3;
|
||
|
|
||
|
module sideshape( l, w) {
|
||
|
l2 = l-w/2;
|
||
|
intersection() {
|
||
|
translate( [0, l2/2+w/4, 0])
|
||
|
square( [w, l2+w/2], center=true);
|
||
|
union() {
|
||
|
translate( [0, l2/2, 0])
|
||
|
square( [w, l2], center=true);
|
||
|
translate( [0, l2, 0])
|
||
|
circle( d=w);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module shape( width, depth, height, r = 0.5) {
|
||
|
linear_extrude( width, center=true)
|
||
|
offset(r) offset(-r)
|
||
|
sideshape( depth, height);
|
||
|
}
|
||
|
|
||
|
module auflage(x,y,h){
|
||
|
a = x/2;
|
||
|
b = y/2;
|
||
|
translate( [0,-h,0])
|
||
|
rotate( [180,0,0])
|
||
|
difference() {
|
||
|
translate( [0, h/2, 0]) cube( [x,h,y], center=true);
|
||
|
translate( [-a,h , 1]) rotate( [ 45, 0, 0])
|
||
|
cube( [x, x+y+h, y]);
|
||
|
translate( [1, h ,-b]) rotate( [ 0, 0,-45])
|
||
|
cube( [x, x+y+h, y]);
|
||
|
translate( [-a,h ,-1]) rotate( [-45, 0, 0]) translate( [0,0,-y])
|
||
|
cube( [x, x+y+h, y]);
|
||
|
translate( [-1,h ,-b]) rotate( [ 0, 0, 45]) translate( [-x,0,0])
|
||
|
cube( [x, x+y+h, y]);
|
||
|
};
|
||
|
translate( [0, -h-0.01, 0]) cube([x,0.03,y], center=true);
|
||
|
}
|
||
|
|
||
|
module erker( depth, width) {
|
||
|
l = depth/(1-sin(45));
|
||
|
x = l*sin(45);
|
||
|
rotate([90,0,90])
|
||
|
linear_extrude(width,center=true)
|
||
|
intersection() {
|
||
|
//offset(0.5) offset(-0.5)
|
||
|
union() {
|
||
|
// gerundete abschrägung
|
||
|
intersection() {
|
||
|
// kreis, wovon ein teil als rundung für die abschrägung verwendet wird
|
||
|
translate( [0, -l+depth, 0])
|
||
|
circle( l);
|
||
|
// ausschnitt des kreises
|
||
|
translate( [-x, 0, 0])
|
||
|
square( x);
|
||
|
}
|
||
|
*translate( [-x-2,-2,0])
|
||
|
scale( [x+2,2])
|
||
|
square(1);
|
||
|
}
|
||
|
translate( [-x, -0.2, 0])
|
||
|
square( x);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module inner( height, width, depth, r, wire_diameter=1,thread_dim=[0.7,10]) {
|
||
|
thread_diameter = thread_dim.x;
|
||
|
thread_depth = thread_dim.y;
|
||
|
length = depth + height/2+2*gap;
|
||
|
thicky = 3*thickness;
|
||
|
difference() {
|
||
|
union() {
|
||
|
linear_extrude( width, center=true)
|
||
|
offset(-r) offset(r)
|
||
|
sideshape( length, height+2*(gap+thickness));
|
||
|
translate([0,2*thickness+thicky,0])
|
||
|
linear_extrude( width-thicky, center=true)
|
||
|
sideshape( length-thicky, height+8*thickness-gap);
|
||
|
|
||
|
// Nase vorne für Schraubloch
|
||
|
intersection() {
|
||
|
translate([0,length-3.6*length,0])
|
||
|
rotate([45+45/2,0,0])
|
||
|
rotate([0,90,0])
|
||
|
rotate_extrude(angle=45)
|
||
|
translate([thread_diameter*2+3*length,0,0])
|
||
|
circle(d=height+8*thickness-gap);
|
||
|
linear_extrude(width-thicky, center=true)
|
||
|
translate([-(width-thicky)/2,2*thickness+thicky,0])
|
||
|
square(width-thicky);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Raum für Platine+LEDs
|
||
|
linear_extrude( width+0.1, center=true)
|
||
|
offset(-r) offset(r)
|
||
|
translate( [0, depth/2, 0])
|
||
|
scale( [height, depth+0.1, 0])
|
||
|
square( 1, center=true);
|
||
|
|
||
|
translate([0,thicky,0]) {
|
||
|
// Schutzblechabdruck
|
||
|
translate([(height+guard_width)/2+1.5,depth+height/2,0])
|
||
|
rotate([0,90,100])
|
||
|
linear_extrude(height*2, center=true)
|
||
|
circle(d=guard_width);
|
||
|
// Schraubloch
|
||
|
translate([height/2+thicky/2+gap,(length+depth)/2,0])
|
||
|
rotate([0,-90,10])
|
||
|
linear_extrude(thread_depth+gap)
|
||
|
circle(d=thread_diameter);
|
||
|
}
|
||
|
|
||
|
// Kabelführungslöcher
|
||
|
scale([-1,1,1]) {
|
||
|
translate([(height-0.1)/2,depth/2,wire_diameter*0.475])
|
||
|
rotate([0,90,0])
|
||
|
linear_extrude(thicky+2*gap+0.2)
|
||
|
circle(d=wire_diameter);
|
||
|
translate([(height-0.1)/2,depth/2,-wire_diameter*0.475])
|
||
|
rotate([0,90,0])
|
||
|
linear_extrude(thicky+2*gap+0.2)
|
||
|
circle(d=wire_diameter);
|
||
|
}
|
||
|
// Wasserauslassöffnung
|
||
|
union() {
|
||
|
translate([(height-0.1)/2,depth/2,width/4])
|
||
|
rotate([0,90,0])
|
||
|
linear_extrude(thicky+2*gap+0.2)
|
||
|
circle(d=wire_diameter);
|
||
|
translate([(height-0.1)/2,depth/2,-width/4])
|
||
|
rotate([0,90,0])
|
||
|
linear_extrude(thicky+2*gap+0.2)
|
||
|
circle(d=wire_diameter);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* // Da Lötzinn über die gesamte Fläche verteilt vorhanden ist, kann dieses auch zum Abstandhalten verwendet werden.
|
||
|
h = 2;
|
||
|
f = 4;
|
||
|
translate([(height-h)/2, depth+1, width/2-f*2/3])
|
||
|
auflage(f,f,1);
|
||
|
translate([-(height-h)/2, depth+1, width/2-f*2/3])
|
||
|
auflage(f,f,1);
|
||
|
translate([(height-h)/2, depth+1, -width/2+f*2/3])
|
||
|
auflage(f,f,1);
|
||
|
translate([-(height-h)/2, depth+1, -width/2+f*2/3])
|
||
|
auflage(f,f,1);*/
|
||
|
}
|
||
|
|
||
|
module fensterausschnitt( width, height, diag_overlap) {
|
||
|
g = 2*thickness;
|
||
|
w = width-gap;
|
||
|
h = height-g;
|
||
|
d = diag_overlap;
|
||
|
rotate([0,90,90])
|
||
|
translate([-w/2,-h/2,thickness/2-0.1])
|
||
|
linear_extrude(thickness+0.3, center=true)
|
||
|
offset(2.5) offset(-2.5) polygon([
|
||
|
[0 , d], [ d,0 ],
|
||
|
[w-d,0 ], [w , d],
|
||
|
[w ,h-d], [w-d,h ],
|
||
|
[ d,h ], [0 ,h-d],
|
||
|
]);
|
||
|
}
|
||
|
|
||
|
module roundedside( height, width, depth, r) {
|
||
|
gaps = 2*gap;
|
||
|
extra = 2*(gap+thickness);
|
||
|
length = depth + height/2;
|
||
|
h = height+extra;
|
||
|
l = length+gaps;
|
||
|
w = width+extra;
|
||
|
d = depth+extra;
|
||
|
hull() {
|
||
|
*translate([0,r,0])
|
||
|
rotate([0,90,0])
|
||
|
linear_extrude( h-1, center=true) circle(r);
|
||
|
*translate([h/2-r, height/2-thickness/4-gap+r, 0])
|
||
|
rotate([0,90,90])
|
||
|
linear_extrude( d-thickness/2-2*r+gap, center=true) circle(r);
|
||
|
*translate([-h/2+r, height/2-thickness/4-gap+r, 0])
|
||
|
rotate([0,90,90])
|
||
|
linear_extrude( d-thickness/2-2*r+gap, center=true) circle(r);
|
||
|
translate([0,depth+gap+glass+thickness,0])
|
||
|
rotate_extrude(angle=180) translate([(h-2*r)/2,0,0]) circle(r);
|
||
|
translate([h/2-r,r,0]) sphere(r);
|
||
|
translate([-h/2+r,r,0]) sphere(r);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module outer( height, width, depth, r) {
|
||
|
gaps = 2*gap;
|
||
|
extra = 2*(gap+2*thickness);
|
||
|
length = depth + height/2+gaps + glass;
|
||
|
h = height+extra;
|
||
|
l = length+gaps;
|
||
|
w = width+extra;
|
||
|
d = depth+extra;
|
||
|
difference() {
|
||
|
shape( w, l, h);
|
||
|
|
||
|
// Innere Form, in die das innere Teil reinpasst
|
||
|
translate([0,thickness,0])
|
||
|
shape( width+gaps, length-2*thickness, height+gaps, 0);
|
||
|
|
||
|
// Ausschnitt, in den der innere Teil durch eingelegt werden kann
|
||
|
translate([0,length/2+extra+2,0])
|
||
|
cube( [h+0.2, length+gaps, width-gaps-2*thickness], center=true);
|
||
|
|
||
|
fensterausschnitt( width, height-gaps, 1);
|
||
|
}
|
||
|
|
||
|
/*s = 2;
|
||
|
v = 1;
|
||
|
for( i = [0, 180]) rotate([0, i, 0]) {
|
||
|
translate([ height/2-s/2-gap-thickness, depth+thickness+gap+glass-2, -width/2]) erker( 1, 1);
|
||
|
translate([ -height/2+s/2+gap+thickness, depth+thickness+gap+glass-2, -width/2]) erker( 1, 1);
|
||
|
}*/
|
||
|
|
||
|
*for( i = [w/2, -w/2])
|
||
|
translate([ 0, 0, i])
|
||
|
roundedside(height, width, depth, r);
|
||
|
}
|
||
|
|
||
|
color("blue") translate([ 0, gap+thickness+glass, 0])
|
||
|
inner( inner_height, inner_width, inner_depth, 0.5, wire_diameter=1.15, thread_dim=[4,6]);
|
||
|
*color( "green")
|
||
|
//rotate([90,0,90])
|
||
|
outer( inner_height+2*(thickness+gap), inner_width+2*gap, inner_depth+2*gap, 0.5);
|