Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
light line enclosure
circuitLength = 66;
circuitClipHeight = 7;
circuitOffset = 4;
module xhole(radius, length) {
rotate(a=[0,90,0]) cylinder(r=radius,h=length+1,center=true, $fn=10);
}
module batteryClip(width, length, thickness) {
union() {
difference() {
union() {
translate([0,0,-thickness/2-width/4+4]) {
cube([2*thickness+length,2*thickness+width-0.11,thickness+width/2+9], center=true);
}
translate([length*0.5+thickness,-width*0.5-thickness,-10-thickness]) {
circuitClip(19,circuitLength+thickness,thickness);
}
}
union() {
rotate([0,90,0]) cylinder(r=width/2,h=length,$fn=30,center=true);
translate([0,0,width/1.5]) cube([length,width+2*thickness+1,width],center=true);
translate([0,1.5,0]) xhole(.75,length+2*thickness+1);
translate([0,-1.5,0]) xhole(.75,length+2*thickness+1);
translate([length/3.5,0,0]) cube([length/3.5,width+2*thickness+1,width], center=true);
translate([-length/3.5,0,0]) cube([length/3.5,width+2*thickness+1,width], center=true);
}
}
translate([-length*0.5, -width*0.5-thickness, -10]) {
cube([length+circuitLength+thickness*3, thickness, 2]);
}
translate([-length*0.5, width*0.5, -10]) {
cube([length+circuitLength+thickness*3, thickness, 2]);
}
}
}
module circuitClip(width, length, thickness) {
languette = 15;
difference() {
cube([length+circuitOffset+thickness,width+thickness*2, circuitClipHeight+thickness]);
translate([circuitOffset, thickness*1.25, thickness]) {
cube([length, width-thickness*0.50, circuitClipHeight+thickness]);
}
translate([circuitOffset, -thickness, thickness]) {
cube([languette, width+4*thickness, circuitClipHeight+thickness]);
}
translate([circuitOffset+40, -thickness, thickness]) {
cube([languette, width+4*thickness, circuitClipHeight+thickness]);
}
translate([length+circuitOffset-1, width*0.5-10*0.5+thickness, thickness]) {
cube([10, 10, circuitClipHeight+thickness]);
}
}
}
batteryClip(19,66,1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment