Design cases for the bike lighting project #250
|
@ -1,6 +1,7 @@
|
||||||
$fn = 50;
|
$fn = 50;
|
||||||
threshold = 0.1;
|
threshold = 0.1;
|
||||||
half_threshold = threshold / 2;
|
half_threshold = threshold / 2;
|
||||||
|
bevel = 0.5;
|
||||||
|
|
||||||
wire_radius = 1;
|
wire_radius = 1;
|
||||||
|
|
||||||
|
@ -25,107 +26,63 @@ converter_width = 11.25;
|
||||||
converter_length = 22.25;
|
converter_length = 22.25;
|
||||||
converter_height = 4.25;
|
converter_height = 4.25;
|
||||||
|
|
||||||
module box(length, width, height, wall_thickness) {
|
|
||||||
center_width = width - wall_thickness;
|
|
||||||
center_height = height - wall_thickness;
|
|
||||||
center_length = length - wall_thickness;
|
|
||||||
|
|
||||||
|
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() {
|
union() {
|
||||||
hull() {
|
translate([0, 0, -height / 2 + wall_thickness / 2])
|
||||||
translate([-center_width / 2, -center_length / 2, -center_height / 2]) sphere(r = wall_thickness);
|
box_face(length, width, wall_thickness, bevel);
|
||||||
translate([-center_width / 2, -center_length / 2, center_height / 2]) sphere(r = wall_thickness);
|
translate([-width / 2 + wall_thickness / 2, 0, 0]) rotate([0, 90, 0])
|
||||||
translate([center_width / 2, -center_length / 2, -center_height / 2]) sphere(r = wall_thickness);
|
box_face(length, height, wall_thickness, bevel);
|
||||||
translate([center_width / 2, -center_length / 2, center_height / 2]) sphere(r = wall_thickness);
|
translate([width / 2 - wall_thickness / 2, 0, 0]) rotate([0, 90, 0])
|
||||||
}
|
box_face(length, height, wall_thickness, bevel);
|
||||||
hull() {
|
|
||||||
translate([-center_width / 2, center_length / 2, -center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
translate([-center_width / 2, center_length / 2, center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
translate([center_width / 2, center_length / 2, -center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
translate([center_width / 2, center_length / 2, center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
}
|
|
||||||
hull() {
|
|
||||||
translate([-center_width / 2, -center_length / 2, -center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
translate([-center_width / 2, -center_length / 2, center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
translate([-center_width / 2, center_length / 2, -center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
translate([-center_width / 2, center_length / 2, center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
}
|
|
||||||
hull() {
|
|
||||||
translate([center_width / 2, -center_length / 2, -center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
translate([center_width / 2, -center_length / 2, center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
translate([center_width / 2, center_length / 2, -center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
translate([center_width / 2, center_length / 2, center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
}
|
|
||||||
hull() {
|
|
||||||
translate([-center_width / 2, -center_length / 2, -center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
translate([-center_width / 2, center_length / 2, -center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
translate([center_width / 2, -center_length / 2, -center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
translate([center_width / 2, center_length / 2, -center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
module box(length, width, height) {
|
||||||
difference() {
|
|
||||||
cube([width,
|
|
||||||
length,
|
|
||||||
height],
|
|
||||||
center = true);
|
|
||||||
translate([0, 0, wall_thickness])
|
|
||||||
cube([width - wall_thickness * 2,
|
|
||||||
length - wall_thickness * 2,
|
|
||||||
height + threshold],
|
|
||||||
center = true);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
module channel(length, width, height, wall_thickness) {
|
|
||||||
center_width = width - wall_thickness;
|
|
||||||
center_height = height - wall_thickness;
|
|
||||||
center_length = length - wall_thickness;
|
|
||||||
|
|
||||||
union() {
|
union() {
|
||||||
hull() {
|
channel(length, width, height);
|
||||||
translate([-center_width / 2, -center_length / 2, -center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
translate([-center_width / 2, -center_length / 2, center_height / 2]) sphere(r = wall_thickness);
|
translate([0, -length / 2 + wall_thickness / 2, 0]) rotate([90, 0, 0])
|
||||||
translate([-center_width / 2, center_length / 2, -center_height / 2]) sphere(r = wall_thickness);
|
box_face(height, width, wall_thickness, bevel);
|
||||||
translate([-center_width / 2, center_length / 2, center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
}
|
translate([0, length / 2 - wall_thickness / 2, 0]) rotate([90, 0, 0])
|
||||||
hull() {
|
box_face(height, width, wall_thickness, bevel);
|
||||||
translate([center_width / 2, -center_length / 2, -center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
translate([center_width / 2, -center_length / 2, center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
translate([center_width / 2, center_length / 2, -center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
translate([center_width / 2, center_length / 2, center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
}
|
|
||||||
hull() {
|
|
||||||
translate([-center_width / 2, -center_length / 2, -center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
translate([-center_width / 2, center_length / 2, -center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
translate([center_width / 2, -center_length / 2, -center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
translate([center_width / 2, center_length / 2, -center_height / 2]) sphere(r = wall_thickness);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// box(20, 10, 10);
|
||||||
|
// color("blue", 0.5) cube([10, 20, 10], center = true);
|
||||||
|
|
||||||
|
module cell_cradle(width, height) {
|
||||||
difference() {
|
difference() {
|
||||||
cube([width,
|
translate([0, 0, -height / 2]) cube([width,
|
||||||
length,
|
|
||||||
height],
|
|
||||||
center = true);
|
|
||||||
translate([0, 0, wall_thickness])
|
|
||||||
cube([width - wall_thickness * 2,
|
|
||||||
length + threshold,
|
|
||||||
height + threshold],
|
|
||||||
center = true);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
module cell_cradle(length, width) {
|
|
||||||
translate([0, 0, -width / 4]) difference() {
|
|
||||||
cube([width + wall_thickness * 2,
|
|
||||||
wall_thickness,
|
wall_thickness,
|
||||||
width / 2],
|
height],
|
||||||
center = true);
|
center = true);
|
||||||
translate([0, 0, width / 2])
|
color("red", 1) translate([0, 0, 0])
|
||||||
rotate([90, 0, 0])
|
rotate([90, 0, 0])
|
||||||
cylinder(h = wall_thickness + cutout_threshold,
|
cylinder(h = wall_thickness + cutout_threshold,
|
||||||
r = width / 2,
|
r = width / 2,
|
||||||
|
@ -135,35 +92,30 @@ module cell_cradle(length, width) {
|
||||||
|
|
||||||
module cell_box() {
|
module cell_box() {
|
||||||
union() {
|
union() {
|
||||||
channel(cell_holder_length, cell_holder_width, cell_holder_height, wall_thickness);
|
channel(cell_holder_length, cell_holder_width, cell_holder_height);
|
||||||
translate([0, -battery_length / 6, 0]) cell_cradle(cell_holder_length, battery_width);
|
translate([0, -battery_length / 6, wall_thickness]) cell_cradle(cell_holder_width, cell_holder_height / 2);
|
||||||
translate([0, battery_length / 6, 0]) cell_cradle(cell_holder_length, battery_width);
|
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;
|
||||||
|
|
||||||
module contact_box(width, contact_width, contact_height, contact_thickness) {
|
difference() {
|
||||||
contact_thickness_ = contact_thickness * .75;
|
box(wall_thickness * 2 + contact_thickness, cell_holder_width, cell_holder_height);
|
||||||
cutout_width = contact_width * .8;
|
translate([0, contact_thickness, wall_thickness * 2])
|
||||||
box_width = width + wall_thickness * 2;
|
cube([battery_contact_width,
|
||||||
box_thickness = contact_thickness_ + wall_thickness * 2;
|
wall_thickness * 2,
|
||||||
box_height = width + wall_thickness;
|
battery_contact_length + threshold],
|
||||||
|
|
||||||
union() {
|
|
||||||
color("red", 1) cube([box_width,
|
|
||||||
box_thickness,
|
|
||||||
width + wall_thickness],
|
|
||||||
center = true);
|
center = true);
|
||||||
|
}
|
||||||
|
|
||||||
translate([0,
|
|
||||||
0,
|
|
||||||
wall_thickness * 2])
|
|
||||||
cube([contact_width,
|
|
||||||
contact_thickness_,
|
|
||||||
contact_height + cutout_threshold],
|
|
||||||
center = true);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
union() {
|
||||||
translate([box_width / 2 - (contact_width * .8) / 2,
|
translate([box_width / 2 - (contact_width * .8) / 2,
|
||||||
wall_thickness,
|
wall_thickness,
|
||||||
box_height - contact_height])
|
box_height - contact_height])
|
||||||
|
@ -182,48 +134,26 @@ module contact_box(width, contact_width, contact_height, contact_thickness) {
|
||||||
box_thickness,
|
box_thickness,
|
||||||
width + wire_radius * 2])
|
width + wire_radius * 2])
|
||||||
cylinder(h = width + wall_thickness * 2 + cutout_threshold, r = 1, center = true);
|
cylinder(h = width + wall_thickness * 2 + cutout_threshold, r = 1, center = true);
|
||||||
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
module battery_slot(length, width) {
|
module battery_slot() {
|
||||||
union() {
|
union() {
|
||||||
translate([width + wall_thickness * 2, wall_thickness, 0])
|
translate([0, -cell_holder_length / 2, 0]) contact_box();
|
||||||
contact_box(battery_width,
|
|
||||||
battery_contact_width,
|
|
||||||
battery_contact_length,
|
|
||||||
battery_contact_flange_height);
|
|
||||||
translate([0, wall_thickness, 0]) cell_box();
|
translate([0, wall_thickness, 0]) cell_box();
|
||||||
translate([0, wall_thickness + length, 0])
|
translate([0, cell_holder_length / 2 + wall_thickness * 2, 0])
|
||||||
rotate([0, 0, 180])
|
rotate([0, 0, 180])
|
||||||
contact_box(battery_width,
|
contact_box();
|
||||||
battery_contact_width,
|
|
||||||
battery_contact_length,
|
|
||||||
battery_contact_flange_height);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module battery_case() {
|
module battery_case() {
|
||||||
union() {
|
union() {
|
||||||
battery_slot(battery_length, battery_width);
|
translate([-cell_holder_width / 2, 0, 0]) battery_slot();
|
||||||
translate([battery_width + wall_thickness, 0, 0]) battery_slot(battery_length, battery_width);
|
translate([cell_holder_width / 2 - wall_thickness, 0, 0]) battery_slot();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
battery_case();
|
battery_case();
|
||||||
|
|
||||||
translate([-50, 0, 0])
|
|
||||||
contact_box(battery_width,
|
|
||||||
battery_contact_width,
|
|
||||||
battery_contact_length,
|
|
||||||
battery_contact_flange_height);
|
|
||||||
|
|
||||||
/*
|
|
||||||
rotate([0, 90, 0])
|
|
||||||
translate([0, 5, 0])
|
|
||||||
cylinder(h=battery_width + wall_thickness * 2 + cutout_threshold, r=1, center = true);
|
|
||||||
|
|
||||||
translate([0, -5, 0])
|
|
||||||
rotate([0, 90, 0])
|
|
||||||
cylinder(h=battery_width + wall_thickness * 2 + cutout_threshold, r=1, center = true);
|
|
||||||
*/
|
|
||||||
|
|
Loading…
Reference in New Issue