LED-Lampe-8x16/Lampe_2DFormen.scad

144 lines
3.8 KiB
OpenSCAD

module top_outer_plate() {
difference() {
circle(d=lamp_dia);
//circle(d=screw_dia);
circle(r=nut_outer_radius, $fn=6);
};
}
module top_inner_plate() {
difference() {
union() {
difference() {
circle(d=lamp_dia);
circle(d=acryl_outer_dia+acryl_tolerance);
}
circle(d=acryl_inner_dia-acryl_tolerance);
}
union() {
for(angle = [0:45:7*45]) {
rotate(angle) translate([tooth_distance/2, holder_offset])
square([tooth_width+tooth_hole_tolerance, wood_thickness+tooth_hole_tolerance], center=true);
rotate(angle) translate([-tooth_distance/2, holder_offset])
square([tooth_width+tooth_hole_tolerance, wood_thickness+tooth_hole_tolerance], center=true);
}
}
circle(d=screw_dia);
};
}
module cable_holes() {
difference() {
circle(d = acryl_inner_dia-2*cable_hole_spacing);
circle(r = holder_offset + cable_hole_spacing);
for(angle = [0:45:7*45]) {
rotate(angle+22.5)
translate([0, lamp_dia/4]) square([cable_hole_spacing, lamp_dia/2], center=true);
}
}
}
module bottom_inner_plate() {
difference() {
top_inner_plate();
cable_holes();
}
}
module bottom_outer_plate() {
difference() {
top_outer_plate();
cable_holes();
box_wall_tooth_holes();
}
}
module base_plate() {
difference() {
circle(d=lamp_dia);
circle(d=screw_dia);
box_wall_tooth_holes();
}
}
module ledstrip_holder() {
union() {
square([holder_width, inner_height], center=true);
translate([tooth_distance/2, (inner_height + tooth_height)/2]) square([tooth_width, tooth_height], center=true);
translate([-tooth_distance/2, (inner_height + tooth_height)/2]) square([tooth_width, tooth_height], center=true);
translate([tooth_distance/2, -(inner_height + tooth_height)/2]) square([tooth_width, tooth_height], center=true);
translate([-tooth_distance/2, -(inner_height + tooth_height)/2]) square([tooth_width, tooth_height], center=true);
}
}
module box_wall() {
teeth_topbottom = floor(bottom_box_wall_width / tooth_distance);
teeth_right = floor(bottom_box_height / tooth_distance);
teeth_left = teeth_right - 1;
union() {
square([bottom_box_wall_width, bottom_box_height], center=true);
start_pos_tb = -(tooth_distance * teeth_topbottom)/2 + tooth_distance/2;
for(i = [0:teeth_topbottom-1]) {
translate([start_pos_tb + i*tooth_distance, (bottom_box_height + tooth_height)/2])
square([tooth_width, tooth_height], center=true);
translate([start_pos_tb + i*tooth_distance, -(bottom_box_height + tooth_height)/2])
square([tooth_width, tooth_height], center=true);
}
/*
start_pos_r = -(tooth_distance * teeth_right)/2 + tooth_distance/2;
for(i = [0:teeth_right-1]) {
translate([(bottom_box_wall_width + tooth_width)/2, start_pos_r + i*tooth_distance])
square([tooth_height, tooth_width], center=true);
}
start_pos_l = -(tooth_distance * teeth_left)/2 - tooth_distance/2;
for(i = [1:teeth_left]) {
translate([-(bottom_box_wall_width + tooth_width)/2, start_pos_l + i*tooth_distance])
square([tooth_height, tooth_width], center=true);
}
*/
}
}
module box_wall_tooth_holes() {
teeth_topbottom = floor(bottom_box_wall_width / tooth_distance);
start_pos_tb = -(tooth_distance * teeth_topbottom)/2 + tooth_distance/2;
for(angle = [0:45:7*45]) {
rotate(angle)
for(i = [0:teeth_topbottom-1]) {
translate([start_pos_tb + i*tooth_distance, bottom_box_wall_offset])
square([tooth_width+tooth_hole_tolerance, tooth_height+tooth_hole_tolerance], center=true);
}
}
}
module box_wall_with_holes() {
difference() {
box_wall();
translate([0, dc_conn_offset]) circle(d=dc_conn_dia);
}
}
module foot_piece() {
intersection() {
difference() {
circle(r=foot_outer_radius);
circle(r=foot_inner_radius);
}
polygon(points=[ [0,0], lamp_dia/2 * [ cos(foot_angle/2), sin(foot_angle/2) ], lamp_dia/2 * [ cos(-foot_angle/2), sin(-foot_angle/2) ] ]);
}
}