takeup/examples/JK_projector_takeup_case.scad

119 lines
4.0 KiB
OpenSCAD

include <../common/common.scad>;
X = 115;
Y = 60;
Z = 40;
USB = -30;
L289N = 10;
ButtonD = 7.2;
module l289N_holes (r = 3/2 - .2, MOD_MOUNT = 0) {
$fn = 60;
DISTANCE = 36.5 + MOD_MOUNT;
H = 50;
translate([0, 0, 0]) cylinder(r = r, h = H * 5, center = true);
translate([DISTANCE, 0, 0]) cylinder(r = r, h = H * 5, center = true);
translate([DISTANCE, DISTANCE, 0]) cylinder(r = r, h = H * 5, center = true);
translate([0, DISTANCE, 0]) cylinder(r = r, h = H * 5, center = true);
}
module l289N_mount () {
$fn = 60;
DISTANCE = 36.5;
H = 4;
THICKNESS = 3;
module stand () {
cylinder(r1 = 4, r2 = 3, h = H, center = true);
cylinder(r = R(2.9), h = H + 5, center = true);
}
translate([0, 0, 0]) stand();
translate([DISTANCE, 0, 0]) stand();
translate([DISTANCE, DISTANCE, 0]) stand();
translate([0, DISTANCE, 0]) stand();
difference () {
translate([DISTANCE/2, DISTANCE/2, -3]) rounded_cube([DISTANCE + 8, DISTANCE + 8, THICKNESS], 8, center = true); //base
translate([DISTANCE/2, DISTANCE/2, -3]) rounded_cube([DISTANCE - 5, DISTANCE - 5, THICKNESS+1], 10, center = true); //base
}
}
module Arduino_Nano_mount () {
X = 18.2;
Y = 43.9;
Z = 10.5;
BOARD_Z = 1.5;
difference () {
//outer
cube([X + 4, Y + 4, Z], center = true);
//inner void minus corners
difference () {
cube([X - 1, Y - 1, Z + 1], center = true);
translate([(X / 2) - 1, (Y / 2) - 1, -BOARD_Z]) cylinder(r = (2 / 2), h = Z + 1, center = true, $fn = 20);
translate([(-X / 2) + 1, (Y / 2) - 1, -BOARD_Z]) cylinder(r = (2 / 2), h = Z + 1, center = true, $fn = 20);
translate([(X / 2) - 1, (-Y / 2) + 1, -BOARD_Z]) cylinder(r = (2 / 2), h = Z + 1, center = true, $fn = 20);
translate([(-X / 2) + 1, (-Y / 2) + 1, -BOARD_Z]) cylinder(r = (2 / 2), h = Z + 1, center = true, $fn = 20);
}
//board void
translate([0, 0, (Z / 2) - (BOARD_Z / 2)]) cube([X, Y, BOARD_Z], center = true);
//usb void
translate([0, Y / 2, (Z / 2) - (6 / 2) + 0.01]) cube([8, 10, 6], center = true);
}
}
module case_bottom () {
difference () {
rounded_cube([X, Y, Z], d = 10, center = true, $fn = 40);
translate([0, 0, 3]) rounded_cube([X - 5, Y - 5, Z], d = 7, center = true, $fn = 40);
//MiniUSB
translate([USB, Y / 2, 7]) cube([8, 10, Z], center = true);
//DC power connector
translate([(X / 2) - (13 / 2), -12, 4]) rotate([0, 90, 0]) cylinder(r = R(12.3), h = 13.5, center = true, $fn = 30);
//L289N wires
translate([L289N + 6, 0, 3]) {
rotate([90, 0, 0]) cylinder(r = R(4), h = Y + 1, center = true, $fn = 30);
translate([0, 0, Z / 2]) cube([4, Y + 1, Z], center = true);
}
//void for wire
translate([(X / 2), 12, 4]) rotate([0, 90, 0]) cylinder(r = R(5), h = 10, center = true, $fn = 30);
}
translate ([-20, 0, 0]) {
translate([L289N, -20 + 2, -(Z/2) + 7.2]) l289N_mount();
translate([-10, 6, -(Z/2) + 7.9]) Arduino_Nano_mount();
}
}
module case_top () {
difference () {
rounded_cube([X, Y, 3], d = 10, center = true, $fn = 40);
translate([-2, 0, 0]) cube([24, 27, 20], center = true);
translate([35, 18, 0]) cylinder(r = R(ButtonD), h = 10, center = true, $fn = 40);
translate([35, -18, 0]) cylinder(r = R(ButtonD), h = 10, center = true, $fn = 40);
//text
translate([25, 15, -0.5]) rotate([0, 0, 90]) emboss("FWD >");
translate([25, -15, -0.5]) rotate([0, 0, 90]) emboss("< BWD");
}
translate([0, 0, -2.9]) difference () {
rounded_cube([X - 5, Y - 5, 3], d = 7, center = true, $fn = 40);
rounded_cube([X - 11, Y - 11, 3 + 1], d = 7, center = true, $fn = 40);
}
}
module emboss (string) {
letter = 6;
color("red") linear_extrude(10) {
text(string, size = letter, halign = "center", valign = "center", $fn = 64);
}
}
//case_top();
case_bottom();