160 lines
4.9 KiB
OpenSCAD
160 lines
4.9 KiB
OpenSCAD
$fn = 50;
|
|
threshold = 0.1;
|
|
half_threshold = threshold / 2;
|
|
bevel = 0.5;
|
|
|
|
wire_radius = 1;
|
|
|
|
wall_thickness = 2;
|
|
cutout_threshold = 1;
|
|
|
|
battery_length = 71;
|
|
battery_width = 18.75;
|
|
|
|
cell_holder_length = battery_length + wall_thickness * 2;
|
|
cell_holder_width = battery_width + wall_thickness * 2;
|
|
cell_holder_height = battery_width + wall_thickness;
|
|
|
|
battery_contact_thickness = .6;
|
|
// battery_contact_thickness = 1;
|
|
battery_contact_width = 11;
|
|
battery_contact_length = 12.8;
|
|
battery_contact_spring_height = 10.5;
|
|
battery_contact_flange_height = 1.9;
|
|
|
|
converter_width = 11.25;
|
|
converter_length = 22.25;
|
|
converter_height = 4.25;
|
|
|
|
|
|
module pill(length, bevel) {
|
|
hull() {
|
|
translate([0, 0, (-length / 2) + bevel]) sphere(r = bevel);
|
|
translate([0, 0, (length / 2) - bevel]) sphere(r = bevel);
|
|
}
|
|
}
|
|
|
|
module box_face(length, width, wall_thickness, bevel) {
|
|
center_width = width - bevel * 2;
|
|
center_length = length - bevel * 2;
|
|
|
|
hull() {
|
|
translate([-center_width / 2, -center_length / 2, 0])
|
|
pill(wall_thickness, bevel);
|
|
translate([center_width / 2, -center_length / 2, 0])
|
|
pill(wall_thickness, bevel);
|
|
translate([center_width / 2, center_length / 2, 0])
|
|
pill(wall_thickness, bevel);
|
|
translate([-center_width / 2, center_length / 2, 0])
|
|
pill(wall_thickness, bevel);
|
|
}
|
|
}
|
|
|
|
module channel(length, width, height) {
|
|
union() {
|
|
translate([0, 0, -height / 2 + wall_thickness / 2])
|
|
box_face(length, width, wall_thickness, bevel);
|
|
translate([-width / 2 + wall_thickness / 2, 0, 0]) rotate([0, 90, 0])
|
|
box_face(length, height, wall_thickness, bevel);
|
|
translate([width / 2 - wall_thickness / 2, 0, 0]) rotate([0, 90, 0])
|
|
box_face(length, height, wall_thickness, bevel);
|
|
}
|
|
}
|
|
|
|
module box(length, width, height) {
|
|
union() {
|
|
channel(length, width, height);
|
|
|
|
translate([0, -length / 2 + wall_thickness / 2, 0]) rotate([90, 0, 0])
|
|
box_face(height, width, wall_thickness, bevel);
|
|
|
|
translate([0, length / 2 - wall_thickness / 2, 0]) rotate([90, 0, 0])
|
|
box_face(height, width, wall_thickness, bevel);
|
|
}
|
|
}
|
|
|
|
// box(20, 10, 10);
|
|
// color("blue", 0.5) cube([10, 20, 10], center = true);
|
|
|
|
module cell_cradle(width, height) {
|
|
difference() {
|
|
translate([0, 0, -height / 2]) cube([width,
|
|
wall_thickness,
|
|
height],
|
|
center = true);
|
|
color("red", 1) translate([0, 0, 0])
|
|
rotate([90, 0, 0])
|
|
cylinder(h = wall_thickness + cutout_threshold,
|
|
r = width / 2,
|
|
center = true);
|
|
}
|
|
}
|
|
|
|
module cell_box() {
|
|
union() {
|
|
channel(cell_holder_length, cell_holder_width, cell_holder_height);
|
|
translate([0, -battery_length / 6, wall_thickness]) cell_cradle(cell_holder_width, cell_holder_height / 2);
|
|
translate([0, battery_length / 6, wall_thickness]) cell_cradle(cell_holder_width, cell_holder_height / 2);
|
|
}
|
|
}
|
|
|
|
module contact_box() {
|
|
contact_thickness = battery_contact_flange_height * .75;
|
|
cutout_width = battery_contact_width * .8;
|
|
// box_thickness = contact_thickness_ + wall_thickness * 2;
|
|
// box_height = width + wall_thickness;
|
|
|
|
difference() {
|
|
box(wall_thickness * 2 + contact_thickness, cell_holder_width, cell_holder_height);
|
|
translate([0, contact_thickness, wall_thickness * 2])
|
|
cube([battery_contact_width,
|
|
wall_thickness * 2,
|
|
battery_contact_length + threshold],
|
|
center = true);
|
|
}
|
|
|
|
|
|
/*
|
|
union() {
|
|
translate([box_width / 2 - (contact_width * .8) / 2,
|
|
wall_thickness,
|
|
box_height - contact_height])
|
|
cube([contact_width * .8,
|
|
wall_thickness + contact_thickness_ + cutout_threshold,
|
|
contact_height + cutout_threshold]);
|
|
|
|
translate([width / 2 + wall_thickness,
|
|
0,
|
|
width + wire_radius * 2])
|
|
rotate([-90, 0, 0])
|
|
cylinder(h=wall_thickness * 4, r=wire_radius, center = true);
|
|
|
|
rotate([0, 180, 0])
|
|
translate([-cutout_threshold / 2,
|
|
box_thickness,
|
|
width + wire_radius * 2])
|
|
cylinder(h = width + wall_thickness * 2 + cutout_threshold, r = 1, center = true);
|
|
}
|
|
*/
|
|
}
|
|
|
|
module battery_slot() {
|
|
union() {
|
|
translate([0, -cell_holder_length / 2, 0]) contact_box();
|
|
translate([0, wall_thickness, 0]) cell_box();
|
|
translate([0, cell_holder_length / 2 + wall_thickness * 2, 0])
|
|
rotate([0, 0, 180])
|
|
contact_box();
|
|
}
|
|
}
|
|
|
|
module battery_case() {
|
|
union() {
|
|
translate([-cell_holder_width / 2, 0, 0]) battery_slot();
|
|
translate([cell_holder_width / 2 - wall_thickness, 0, 0]) battery_slot();
|
|
}
|
|
}
|
|
|
|
battery_case();
|
|
|