mirror of
https://github.com/DJSundog/NopSCADlib.git
synced 2024-11-27 01:03:51 -05:00
Library printed parts now make use of stl() child.
This commit is contained in:
parent
5bac2bf46d
commit
b67cf4ce97
190
printed/box.scad
190
printed/box.scad
@ -139,17 +139,17 @@ module box_corner_profile_2D(type) { //! The 2D shape of the corner profile.
|
|||||||
}
|
}
|
||||||
|
|
||||||
module box_corner_profile(type) { //! Generates the corner profile STL for 3D printing.
|
module box_corner_profile(type) { //! Generates the corner profile STL for 3D printing.
|
||||||
stl("box_corner_profile");
|
|
||||||
|
|
||||||
length = box_height(type) - 2 * box_margin(type);
|
length = box_height(type) - 2 * box_margin(type);
|
||||||
difference() {
|
|
||||||
linear_extrude(length, center = true, convexity = 5)
|
|
||||||
box_corner_profile_2D(type);
|
|
||||||
|
|
||||||
for(z = [-1, 1])
|
stl("box_corner_profile")
|
||||||
translate([box_hole_inset(type), box_hole_inset(type), z * length / 2])
|
difference() {
|
||||||
insert_hole(box_insert(type), 5);
|
linear_extrude(length, center = true, convexity = 5)
|
||||||
}
|
box_corner_profile_2D(type);
|
||||||
|
|
||||||
|
for(z = [-1, 1])
|
||||||
|
translate([box_hole_inset(type), box_hole_inset(type), z * length / 2])
|
||||||
|
insert_hole(box_insert(type), 5);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module box_corner_profile_section(type, section, sections) { //! Generates interlocking sections of the corner profile to allow it to be taller than the printer
|
module box_corner_profile_section(type, section, sections) { //! Generates interlocking sections of the corner profile to allow it to be taller than the printer
|
||||||
@ -209,7 +209,6 @@ module box_corner_quadrants(type, width, depth)
|
|||||||
}
|
}
|
||||||
|
|
||||||
module box_bezel(type, bottom) { //! Generates top and bottom bezel STLs
|
module box_bezel(type, bottom) { //! Generates top and bottom bezel STLs
|
||||||
stl(bottom ? "bottom_bezel" : "top_bezel");
|
|
||||||
feet = bottom && box_feet(type);
|
feet = bottom && box_feet(type);
|
||||||
t = box_sheet_slot(type);
|
t = box_sheet_slot(type);
|
||||||
outset = box_outset(type);
|
outset = box_outset(type);
|
||||||
@ -221,66 +220,67 @@ module box_bezel(type, bottom) { //! Generates top and bottom bezel STLs
|
|||||||
height = box_bezel_height(type, bottom);
|
height = box_bezel_height(type, bottom);
|
||||||
foot_extension = foot_height - height;
|
foot_extension = foot_height - height;
|
||||||
|
|
||||||
difference() {
|
stl(bottom ? "bottom_bezel" : "top_bezel")
|
||||||
w = box_width(type);
|
difference() {
|
||||||
d = box_depth(type);
|
w = box_width(type);
|
||||||
translate_z(-box_profile_overlap(type)) difference() {
|
d = box_depth(type);
|
||||||
tw = w + 2 * outset;
|
translate_z(-box_profile_overlap(type)) difference() {
|
||||||
td = d + 2 * outset;
|
tw = w + 2 * outset;
|
||||||
rounded_rectangle([tw, td, feet ? foot_height : height], box_corner_rad(type), false);
|
td = d + 2 * outset;
|
||||||
//
|
rounded_rectangle([tw, td, feet ? foot_height : height], box_corner_rad(type), false);
|
||||||
// Remove edges between the feet
|
//
|
||||||
//
|
// Remove edges between the feet
|
||||||
if(feet)
|
//
|
||||||
hull() {
|
if(feet)
|
||||||
translate_z(height + 0.5)
|
hull() {
|
||||||
cube([w - 2 * foot_length, td + 1, 1], center = true);
|
translate_z(height + 0.5)
|
||||||
|
cube([w - 2 * foot_length, td + 1, 1], center = true);
|
||||||
|
|
||||||
translate_z(foot_height + 1)
|
translate_z(foot_height + 1)
|
||||||
cube([w - 2 * (foot_length - foot_extension), td + 1, 1], center = true);
|
cube([w - 2 * (foot_length - foot_extension), td + 1, 1], center = true);
|
||||||
}
|
|
||||||
if(feet)
|
|
||||||
hull() {
|
|
||||||
translate_z(height + 0.5)
|
|
||||||
cube([tw + 1, d - 2 * foot_length, 1], center = true);
|
|
||||||
|
|
||||||
translate_z(foot_height + 1)
|
|
||||||
cube([tw + 1, d - 2 * (foot_length - foot_extension), 1], center = true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// slots for side panels
|
|
||||||
//
|
|
||||||
translate_z(-box_profile_overlap(type))
|
|
||||||
linear_extrude(2 * box_profile_overlap(type), center = true)
|
|
||||||
for(i = [-1, 1]) {
|
|
||||||
translate([i * (w + t - sheet_slot_clearance) / 2, 0])
|
|
||||||
square([t, d - 2 * cgap], center = true);
|
|
||||||
|
|
||||||
translate([0, i * (d + t - sheet_slot_clearance) / 2])
|
|
||||||
square([w - 2 * cgap, t], center = true);
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// recess for top / bottom panel
|
|
||||||
//
|
|
||||||
translate_z(cgap)
|
|
||||||
rounded_rectangle([w + bezel_clearance, d + bezel_clearance, height], inner_r + bezel_clearance / 2, false);
|
|
||||||
//
|
|
||||||
// leave plastic over the corner profiles
|
|
||||||
//
|
|
||||||
translate_z(-box_profile_overlap(type) - 1)
|
|
||||||
linear_extrude(box_profile_overlap(type) + cgap + 2)
|
|
||||||
union() {
|
|
||||||
difference() {
|
|
||||||
square([w - 2 * inset,
|
|
||||||
d - 2 * inset], center = true);
|
|
||||||
|
|
||||||
box_corner_quadrants(type, w, d);
|
|
||||||
}
|
}
|
||||||
box_screw_hole_positions(type)
|
if(feet)
|
||||||
poly_circle(screw_clearance_radius(box_screw(type)));
|
hull() {
|
||||||
}
|
translate_z(height + 0.5)
|
||||||
}
|
cube([tw + 1, d - 2 * foot_length, 1], center = true);
|
||||||
|
|
||||||
|
translate_z(foot_height + 1)
|
||||||
|
cube([tw + 1, d - 2 * (foot_length - foot_extension), 1], center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// slots for side panels
|
||||||
|
//
|
||||||
|
translate_z(-box_profile_overlap(type))
|
||||||
|
linear_extrude(2 * box_profile_overlap(type), center = true)
|
||||||
|
for(i = [-1, 1]) {
|
||||||
|
translate([i * (w + t - sheet_slot_clearance) / 2, 0])
|
||||||
|
square([t, d - 2 * cgap], center = true);
|
||||||
|
|
||||||
|
translate([0, i * (d + t - sheet_slot_clearance) / 2])
|
||||||
|
square([w - 2 * cgap, t], center = true);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// recess for top / bottom panel
|
||||||
|
//
|
||||||
|
translate_z(cgap)
|
||||||
|
rounded_rectangle([w + bezel_clearance, d + bezel_clearance, height], inner_r + bezel_clearance / 2, false);
|
||||||
|
//
|
||||||
|
// leave plastic over the corner profiles
|
||||||
|
//
|
||||||
|
translate_z(-box_profile_overlap(type) - 1)
|
||||||
|
linear_extrude(box_profile_overlap(type) + cgap + 2)
|
||||||
|
union() {
|
||||||
|
difference() {
|
||||||
|
square([w - 2 * inset,
|
||||||
|
d - 2 * inset], center = true);
|
||||||
|
|
||||||
|
box_corner_quadrants(type, w, d);
|
||||||
|
}
|
||||||
|
box_screw_hole_positions(type)
|
||||||
|
poly_circle(screw_clearance_radius(box_screw(type)));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dowel_length = 20;
|
dowel_length = 20;
|
||||||
@ -485,7 +485,6 @@ module box_shelf_screw_positions(type, screw_positions, thickness = 0, wall = un
|
|||||||
}
|
}
|
||||||
|
|
||||||
module box_shelf_bracket(type, screw_positions, wall = undef) { //! Generates a shelf bracket, the first optional child is a 2D cutout and the second 3D cutouts
|
module box_shelf_bracket(type, screw_positions, wall = undef) { //! Generates a shelf bracket, the first optional child is a 2D cutout and the second 3D cutouts
|
||||||
stl("shelf_bracket");
|
|
||||||
w = is_undef(wall) ? box_wall(type) : wall;
|
w = is_undef(wall) ? box_wall(type) : wall;
|
||||||
insert = box_shelf_insert(type);
|
insert = box_shelf_insert(type);
|
||||||
lip = 2 * insert_boss_radius(insert, w);
|
lip = 2 * insert_boss_radius(insert, w);
|
||||||
@ -513,44 +512,45 @@ module box_shelf_bracket(type, screw_positions, wall = undef) { //! Generates a
|
|||||||
square([lip, eps]);
|
square([lip, eps]);
|
||||||
}
|
}
|
||||||
|
|
||||||
difference() {
|
stl("shelf_bracket")
|
||||||
union() {
|
difference() {
|
||||||
linear_extrude(w)
|
union() {
|
||||||
difference() {
|
linear_extrude(w)
|
||||||
shape()
|
difference() {
|
||||||
if($children)
|
|
||||||
children(0);
|
|
||||||
|
|
||||||
round(2) offset(-width)
|
|
||||||
shape()
|
shape()
|
||||||
if($children)
|
if($children)
|
||||||
children(0);
|
children(0);
|
||||||
}
|
|
||||||
|
|
||||||
linear_extrude(lip)
|
round(2) offset(-width)
|
||||||
difference() {
|
shape()
|
||||||
shape()
|
if($children)
|
||||||
if($children)
|
children(0);
|
||||||
children(0);
|
}
|
||||||
|
|
||||||
offset(-w)
|
linear_extrude(lip)
|
||||||
|
difference() {
|
||||||
shape()
|
shape()
|
||||||
if($children)
|
if($children)
|
||||||
children(0);
|
children(0);
|
||||||
}
|
|
||||||
|
offset(-w)
|
||||||
|
shape()
|
||||||
|
if($children)
|
||||||
|
children(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
hflip()
|
||||||
|
box_shelf_screw_positions(type, screw_positions, 0, w)
|
||||||
|
boss();
|
||||||
|
}
|
||||||
|
if($children > 1)
|
||||||
|
hflip()
|
||||||
|
children(1);
|
||||||
|
|
||||||
hflip()
|
hflip()
|
||||||
box_shelf_screw_positions(type, screw_positions, 0, w)
|
box_shelf_screw_positions(type, screw_positions, 0, w)
|
||||||
boss();
|
insert_hole(insert, counterbore = 1, horizontal = true);
|
||||||
}
|
}
|
||||||
if($children > 1)
|
|
||||||
hflip()
|
|
||||||
children(1);
|
|
||||||
|
|
||||||
hflip()
|
|
||||||
box_shelf_screw_positions(type, screw_positions, 0, w)
|
|
||||||
insert_hole(insert, counterbore = 1, horizontal = true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module box_shelf_bracket_section(type, rows, cols, x, y) { //! Generates sections of the shelf bracket to allow it to be bigger than the printer
|
module box_shelf_bracket_section(type, rows, cols, x, y) { //! Generates sections of the shelf bracket to allow it to be bigger than the printer
|
||||||
|
@ -49,84 +49,84 @@ module ribbon_grommet_hole(ways, h = 50, expand = true) { //! Generate a hole fo
|
|||||||
}
|
}
|
||||||
|
|
||||||
module ribbon_grommet(ways, thickness) { //! Generate the STL for a printed ribbon grommet
|
module ribbon_grommet(ways, thickness) { //! Generate the STL for a printed ribbon grommet
|
||||||
stl(str("ribbon_grommet_", ways, "_", thickness));
|
|
||||||
|
|
||||||
width = 2 * (wall + clearance) + thickness;
|
width = 2 * (wall + clearance) + thickness;
|
||||||
slot_length = ribbon_clamp_slot(ways);
|
slot_length = ribbon_clamp_slot(ways);
|
||||||
length = slot_length + 2 * wall + 2 * overlap;
|
length = slot_length + 2 * wall + 2 * overlap;
|
||||||
|
|
||||||
rotate([90, 0, 0])
|
stl(str("ribbon_grommet_", ways, "_", thickness))
|
||||||
union() {
|
rotate([90, 0, 0])
|
||||||
for(side = [-1, 1])
|
union() {
|
||||||
translate_z(side * (width - wall) / 2)
|
for(side = [-1, 1])
|
||||||
linear_extrude(wall, center = true, convexity = 5)
|
translate_z(side * (width - wall) / 2)
|
||||||
difference() {
|
linear_extrude(wall, center = true, convexity = 5)
|
||||||
hull() {
|
difference() {
|
||||||
translate([-length / 2, 0])
|
hull() {
|
||||||
square([length, base]);
|
translate([-length / 2, 0])
|
||||||
|
square([length, base]);
|
||||||
|
|
||||||
for(end = [-1, 1])
|
for(end = [-1, 1])
|
||||||
translate([end * (length / 2 - rad), height - rad])
|
translate([end * (length / 2 - rad), height - rad])
|
||||||
semi_circle(rad);
|
semi_circle(rad);
|
||||||
|
}
|
||||||
|
translate([-slot_length / 2, base])
|
||||||
|
square([slot_length, slot_height]);
|
||||||
}
|
}
|
||||||
translate([-slot_length / 2, base])
|
|
||||||
square([slot_length, slot_height]);
|
|
||||||
}
|
|
||||||
|
|
||||||
linear_extrude(width -1, center = true)
|
linear_extrude(width -1, center = true)
|
||||||
difference() {
|
difference() {
|
||||||
ribbon_grommet_hole(ways, expand = false, h = 0);
|
ribbon_grommet_hole(ways, expand = false, h = 0);
|
||||||
|
|
||||||
translate([-slot_length / 2, base])
|
translate([-slot_length / 2, base])
|
||||||
square([slot_length, slot_height]);
|
square([slot_length, slot_height]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module round_grommet_top(diameter, thickness, od = undef) { //! Generate the STL for a round grommet top half
|
module round_grommet_top(diameter, thickness, od = undef) { //! Generate the STL for a round grommet top half
|
||||||
stl(str("round_grommet_top_", round(diameter * 10), "_", thickness));
|
|
||||||
chamfer = layer_height;
|
chamfer = layer_height;
|
||||||
h = wall + thickness + wall;
|
h = wall + thickness + wall;
|
||||||
r1 = diameter / 2;
|
r1 = diameter / 2;
|
||||||
r2 = od == undef ? corrected_radius(r1) + wall : od / 2;
|
r2 = od == undef ? corrected_radius(r1) + wall : od / 2;
|
||||||
r3 = r2 + overlap;
|
r3 = r2 + overlap;
|
||||||
r0 = r1 + 1;
|
r0 = r1 + 1;
|
||||||
union() {
|
stl(str("round_grommet_top_", round(diameter * 10), "_", thickness))
|
||||||
rotate_extrude()
|
union() {
|
||||||
polygon([
|
rotate_extrude()
|
||||||
[r0, 0],
|
polygon([
|
||||||
[r3 - chamfer, 0],
|
[r0, 0],
|
||||||
[r3, chamfer],
|
[r3 - chamfer, 0],
|
||||||
[r3, wall],
|
[r3, chamfer],
|
||||||
[r2, wall],
|
[r3, wall],
|
||||||
[r2, h - chamfer],
|
[r2, wall],
|
||||||
[r2 - chamfer, h],
|
[r2, h - chamfer],
|
||||||
[r0, h],
|
[r2 - chamfer, h],
|
||||||
]);
|
[r0, h],
|
||||||
|
]);
|
||||||
|
|
||||||
render() difference() {
|
render() difference() {
|
||||||
cylinder(r = r0 + eps, h = h);
|
cylinder(r = r0 + eps, h = h);
|
||||||
|
|
||||||
poly_cylinder(r = r1, h = 100, center = true);
|
poly_cylinder(r = r1, h = 100, center = true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module round_grommet_bottom(diameter, od = undef) { //! Generate the STL for a round grommet bottom half
|
module round_grommet_bottom(diameter, od = undef) { //! Generate the STL for a round grommet bottom half
|
||||||
stl(str("round_grommet_bottom_", round(diameter * 10)));
|
|
||||||
chamfer = layer_height;
|
chamfer = layer_height;
|
||||||
r1 = diameter / 2;
|
r1 = diameter / 2;
|
||||||
r2 = od == undef ? corrected_radius(r1) + wall : od / 2;
|
r2 = od == undef ? corrected_radius(r1) + wall : od / 2;
|
||||||
r3 = r2 + max(overlap, wall + chamfer);
|
r3 = r2 + max(overlap, wall + chamfer);
|
||||||
rotate_extrude()
|
stl(str("round_grommet_bottom_", round(diameter * 10)))
|
||||||
polygon([
|
rotate_extrude()
|
||||||
[r2, chamfer],
|
polygon([
|
||||||
[r2 + chamfer, 0],
|
[r2, chamfer],
|
||||||
[r3, 0],
|
[r2 + chamfer, 0],
|
||||||
[r3, wall - chamfer],
|
[r3, 0],
|
||||||
[r3 - chamfer, wall],
|
[r3, wall - chamfer],
|
||||||
[r2, wall],
|
[r3 - chamfer, wall],
|
||||||
]);
|
[r2, wall],
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
module round_grommet_hole(diameter, h = 100) //! Make a hole for a round grommet
|
module round_grommet_hole(diameter, h = 100) //! Make a hole for a round grommet
|
||||||
@ -161,30 +161,30 @@ module mouse_grommet_hole(r, h = 50, z = undef, expand = wall + clearance) //! M
|
|||||||
function mouse_grommet_offset(r) = r + wall;
|
function mouse_grommet_offset(r) = r + wall;
|
||||||
|
|
||||||
module mouse_grommet(r, thickness) { //! Make the STL for a mouse grommet
|
module mouse_grommet(r, thickness) { //! Make the STL for a mouse grommet
|
||||||
stl(str("mouse_grommet_", r * 10, "_", thickness));
|
|
||||||
|
|
||||||
width = 2 * (wall + clearance) + thickness;
|
width = 2 * (wall + clearance) + thickness;
|
||||||
length = 2 * r + 2 * wall + 2 * overlap;
|
length = 2 * r + 2 * wall + 2 * overlap;
|
||||||
|
|
||||||
rotate([90, 0, 0])
|
stl(str("mouse_grommet_", r * 10, "_", thickness))
|
||||||
union() {
|
rotate([90, 0, 0])
|
||||||
for(side = [-1, 1])
|
union() {
|
||||||
translate_z(side * (width - wall) / 2)
|
for(side = [-1, 1])
|
||||||
linear_extrude(wall, center = true)
|
translate_z(side * (width - wall) / 2)
|
||||||
difference() {
|
linear_extrude(wall, center = true)
|
||||||
mouse_grommet_hole(r, z = r + wall, h = 0, expand = wall + overlap);
|
difference() {
|
||||||
|
mouse_grommet_hole(r, z = r + wall, h = 0, expand = wall + overlap);
|
||||||
|
|
||||||
|
translate([0, wall])
|
||||||
|
mouse_grommet_hole(r, h = 0, expand = 0);
|
||||||
|
}
|
||||||
|
linear_extrude(width - 1, center = true)
|
||||||
|
difference() {
|
||||||
|
mouse_grommet_hole(r, h = 0, z = r + wall, expand = wall);
|
||||||
|
|
||||||
translate([0, wall])
|
translate([0, wall])
|
||||||
mouse_grommet_hole(r, h = 0, expand = 0);
|
mouse_grommet_hole(r, h = 0, expand = 0);
|
||||||
}
|
}
|
||||||
linear_extrude(width - 1, center = true)
|
}
|
||||||
difference() {
|
|
||||||
mouse_grommet_hole(r, h = 0, z = r + wall, expand = wall);
|
|
||||||
|
|
||||||
translate([0, wall])
|
|
||||||
mouse_grommet_hole(r, h = 0, expand = 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module mouse_grommet_assembly(r, thickness)
|
module mouse_grommet_assembly(r, thickness)
|
||||||
|
@ -82,7 +82,6 @@ module cam_holes(cam) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module rpi_camera_focus_ring_stl() { //! Focus ring the glue onto RPI lens
|
module rpi_camera_focus_ring_stl() { //! Focus ring the glue onto RPI lens
|
||||||
stl("rpi_camera_focus_ring");
|
|
||||||
|
|
||||||
rad = 15 / 2;
|
rad = 15 / 2;
|
||||||
hole_r1 = 2.5 / 2;
|
hole_r1 = 2.5 / 2;
|
||||||
@ -93,58 +92,58 @@ module rpi_camera_focus_ring_stl() { //! Focus ring the glue onto RPI lens
|
|||||||
x = rad / (sin(angle / 2) + cos(angle / 2));
|
x = rad / (sin(angle / 2) + cos(angle / 2));
|
||||||
r = x * sin(angle / 2);
|
r = x * sin(angle / 2);
|
||||||
|
|
||||||
difference() {
|
stl("rpi_camera_focus_ring")
|
||||||
linear_extrude(height = thickness, convexity = 5)
|
difference() {
|
||||||
difference() {
|
linear_extrude(height = thickness, convexity = 5)
|
||||||
union() {
|
difference() {
|
||||||
circle(x);
|
union() {
|
||||||
|
circle(x);
|
||||||
|
for(i = [0 : flutes - 1])
|
||||||
|
rotate([0, 0, 2 * angle * i])
|
||||||
|
translate([x, 0])
|
||||||
|
circle(r);
|
||||||
|
}
|
||||||
for(i = [0 : flutes - 1])
|
for(i = [0 : flutes - 1])
|
||||||
rotate([0, 0, 2 * angle * i])
|
rotate([0, 0, 2 * angle * i + angle])
|
||||||
translate([x, 0])
|
translate([x, 0])
|
||||||
circle(r);
|
circle(r);
|
||||||
}
|
}
|
||||||
for(i = [0 : flutes - 1])
|
hull() {
|
||||||
rotate([0, 0, 2 * angle * i + angle])
|
poly_cylinder(r = hole_r1, h = 0.1, center = true);
|
||||||
translate([x, 0])
|
|
||||||
circle(r);
|
|
||||||
}
|
|
||||||
hull() {
|
|
||||||
poly_cylinder(r = hole_r1, h = 0.1, center = true);
|
|
||||||
|
|
||||||
translate([0, 0, thickness])
|
translate([0, 0, thickness])
|
||||||
poly_cylinder(r = hole_r2, h = 0.1, center = true);
|
poly_cylinder(r = hole_r2, h = 0.1, center = true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module camera_back(cam) { //! Make the STL for a camera case back
|
module camera_back(cam) { //! Make the STL for a camera case back
|
||||||
stl(str("camera_back_", cam[0]));
|
|
||||||
pcb = camera_pcb(cam);
|
pcb = camera_pcb(cam);
|
||||||
back = cam_back_size(cam);
|
back = cam_back_size(cam);
|
||||||
screw = pcb_screw(pcb);
|
screw = pcb_screw(pcb);
|
||||||
nut = screw_nut(screw);
|
nut = screw_nut(screw);
|
||||||
|
|
||||||
translate_z(back.z)
|
stl(str("camera_back_", cam[0]))
|
||||||
hflip()
|
translate_z(back.z)
|
||||||
difference() {
|
hflip()
|
||||||
translate_z(back.z / 2)
|
difference() {
|
||||||
cube(back, center = true);
|
translate_z(back.z / 2)
|
||||||
|
cube(back, center = true);
|
||||||
|
|
||||||
translate([0, -cam_back_overlap])
|
translate([0, -cam_back_overlap])
|
||||||
cube([pcb_length(pcb) - 2 * cam_back_overlap, pcb_width(pcb), 2 * cam_back_clearance], center = true);
|
cube([pcb_length(pcb) - 2 * cam_back_overlap, pcb_width(pcb), 2 * cam_back_clearance], center = true);
|
||||||
|
|
||||||
translate([0, -pcb_width(pcb) / 2])
|
translate([0, -pcb_width(pcb) / 2])
|
||||||
cube([connector_size.x + 2 * clearance, 2 * connector_size.y + 1, 2 * round_to_layer(connector_size.z + clearance)], center = true);
|
cube([connector_size.x + 2 * clearance, 2 * connector_size.y + 1, 2 * round_to_layer(connector_size.z + clearance)], center = true);
|
||||||
|
|
||||||
translate_z(back.z)
|
translate_z(back.z)
|
||||||
cam_holes(cam)
|
cam_holes(cam)
|
||||||
hflip()
|
hflip()
|
||||||
nut_trap(screw, nut, supported = true);
|
nut_trap(screw, nut, supported = true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module camera_front(cam, hinge = 0) { //! Make the STL for a camera case front
|
module camera_front(cam, hinge = 0) { //! Make the STL for a camera case front
|
||||||
stl(str("camera_front_", cam[0]));
|
|
||||||
front = cam_front_size(cam);
|
front = cam_front_size(cam);
|
||||||
back = cam_back_size(cam);
|
back = cam_back_size(cam);
|
||||||
pcb = camera_pcb(cam);
|
pcb = camera_pcb(cam);
|
||||||
@ -170,70 +169,71 @@ module camera_front(cam, hinge = 0) { //! Make the STL for a camera case front
|
|||||||
translate([0, (hinge ? front.x * hinge : front.y) / 2 + hinge_offset, hinge_r])
|
translate([0, (hinge ? front.x * hinge : front.y) / 2 + hinge_offset, hinge_r])
|
||||||
children();
|
children();
|
||||||
|
|
||||||
difference() {
|
stl(str("camera_front_", cam[0]))
|
||||||
union() {
|
difference() {
|
||||||
hull()
|
union() {
|
||||||
for(x = [-1, 1], y = [-1, 1])
|
hull()
|
||||||
translate([x * (front.x / 2 - rad), y * (front.y / 2 - rad)])
|
for(x = [-1, 1], y = [-1, 1])
|
||||||
hull() { // 3D truncated teardrop gives radiused edges without exceeding 45 degree overhang
|
translate([x * (front.x / 2 - rad), y * (front.y / 2 - rad)])
|
||||||
translate_z(front.z - 1)
|
hull() { // 3D truncated teardrop gives radiused edges without exceeding 45 degree overhang
|
||||||
cylinder(r = rad, h = 1);
|
translate_z(front.z - 1)
|
||||||
|
cylinder(r = rad, h = 1);
|
||||||
|
|
||||||
translate_z(rad)
|
translate_z(rad)
|
||||||
sphere(rad);
|
sphere(rad);
|
||||||
|
|
||||||
cylinder(r = rad * (sqrt(2) - 1), h = eps);
|
cylinder(r = rad * (sqrt(2) - 1), h = eps);
|
||||||
}
|
}
|
||||||
|
|
||||||
hinge_pos()
|
hinge_pos()
|
||||||
hull() {
|
hull() {
|
||||||
rotate([-90, 0, -90])
|
rotate([-90, 0, -90])
|
||||||
teardrop(r = hinge_r, h = hinge_h, center = false);
|
teardrop(r = hinge_r, h = hinge_h, center = false);
|
||||||
|
|
||||||
translate([0, -10, -hinge_r])
|
translate([0, -10, -hinge_r])
|
||||||
cube([hinge_h, eps, 2 * hinge_r]);
|
cube([hinge_h, eps, 2 * hinge_r]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
hinge_pos()
|
|
||||||
rotate([90, 0, 90])
|
|
||||||
teardrop_plus(r = screw_clearance_radius(hinge_screw), h = 100, center = true);
|
|
||||||
|
|
||||||
translate_z(front.z / 2 + shelf - layer_height) // recess for the back
|
|
||||||
cube([back.x + 2 * clearance, back.y + 2 * clearance, front.z], center = true);
|
|
||||||
|
|
||||||
translate_z(front.z / 2 + shelf - pcb_size.z) // recess for PCB
|
|
||||||
cube([pcb_size.x + 2 * clearance, pcb_size.y + 2 * clearance, front.z], center = true);
|
|
||||||
|
|
||||||
translate_z(shelf)
|
|
||||||
hflip() {
|
|
||||||
pcb_component_position(pcb, "smd_led") // clearance for LED
|
|
||||||
cube(led_clearance, center = true);
|
|
||||||
|
|
||||||
pcb_component_position(pcb, "smd_res") // clearance for resistor
|
|
||||||
cube(res_clearance, center = true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
translate([conn_pos.x, lens_offset.y + sensor_length / 2, shelf - pcb_size.z]) // clearance for sensor connector
|
hinge_pos()
|
||||||
cube([conn.x + 2 * clearance, sensor_length, 2 * cam_front_clearance(cam)], center = true);
|
rotate([90, 0, 90])
|
||||||
|
teardrop_plus(r = screw_clearance_radius(hinge_screw), h = 100, center = true);
|
||||||
|
|
||||||
translate([0, -front.y / 2, shelf + front.z / 2]) // slot for connector
|
translate_z(front.z / 2 + shelf - layer_height) // recess for the back
|
||||||
cube([connector_slot.x, connector_slot.y, front.z], center = true);
|
cube([back.x + 2 * clearance, back.y + 2 * clearance, front.z], center = true);
|
||||||
|
|
||||||
translate_z(cam_back_clearance + layer_height)
|
translate_z(front.z / 2 + shelf - pcb_size.z) // recess for PCB
|
||||||
cam_holes(cam)
|
cube([pcb_size.x + 2 * clearance, pcb_size.y + 2 * clearance, front.z], center = true);
|
||||||
rotate(90)
|
|
||||||
poly_cylinder(r = screw_clearance_radius(screw), h = 100, center = true);
|
translate_z(shelf)
|
||||||
|
hflip() {
|
||||||
|
pcb_component_position(pcb, "smd_led") // clearance for LED
|
||||||
|
cube(led_clearance, center = true);
|
||||||
|
|
||||||
|
pcb_component_position(pcb, "smd_res") // clearance for resistor
|
||||||
|
cube(res_clearance, center = true);
|
||||||
|
}
|
||||||
|
|
||||||
|
translate([conn_pos.x, lens_offset.y + sensor_length / 2, shelf - pcb_size.z]) // clearance for sensor connector
|
||||||
|
cube([conn.x + 2 * clearance, sensor_length, 2 * cam_front_clearance(cam)], center = true);
|
||||||
|
|
||||||
|
translate([0, -front.y / 2, shelf + front.z / 2]) // slot for connector
|
||||||
|
cube([connector_slot.x, connector_slot.y, front.z], center = true);
|
||||||
|
|
||||||
|
translate_z(cam_back_clearance + layer_height)
|
||||||
|
cam_holes(cam)
|
||||||
|
rotate(90)
|
||||||
|
poly_cylinder(r = screw_clearance_radius(screw), h = 100, center = true);
|
||||||
|
|
||||||
|
translate_z(shelf - pcb_size.z)
|
||||||
|
hflip()
|
||||||
|
camera_lens(cam, clearance);
|
||||||
|
|
||||||
translate_z(shelf - pcb_size.z)
|
|
||||||
hflip()
|
hflip()
|
||||||
camera_lens(cam, clearance);
|
pcb_component_position(pcb, "smd_led")
|
||||||
|
rotate(45)
|
||||||
hflip()
|
poly_cylinder(r = led_hole_r, h = 100, center = true); // hole for led
|
||||||
pcb_component_position(pcb, "smd_led")
|
}
|
||||||
rotate(45)
|
|
||||||
poly_cylinder(r = led_hole_r, h = 100, center = true); // hole for led
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function bracket_thickness(cam) = max(wall, min(3.5, hinge_z(cam) - hinge_r - 1));
|
function bracket_thickness(cam) = max(wall, min(3.5, hinge_z(cam) - hinge_r - 1));
|
||||||
@ -253,34 +253,35 @@ module camera_bracket_position(cam) //! Position children at the bracket positio
|
|||||||
children();
|
children();
|
||||||
|
|
||||||
module camera_bracket(cam) { //! Make the STL for the camera bracket
|
module camera_bracket(cam) { //! Make the STL for the camera bracket
|
||||||
stl(str("camera_bracket_", cam[0]));
|
|
||||||
|
|
||||||
t = bracket_thickness(cam);
|
t = bracket_thickness(cam);
|
||||||
z = hinge_z(cam);
|
z = hinge_z(cam);
|
||||||
translate([hinge_h / 2, 0])
|
|
||||||
difference() {
|
|
||||||
hull() {
|
|
||||||
translate_z(eps / 2)
|
|
||||||
cube([hinge_h, 2 * hinge_r, eps], center = true);
|
|
||||||
|
|
||||||
translate_z(z)
|
stl(str("camera_bracket_", cam[0])) union() {
|
||||||
rotate([0, 90, 0])
|
translate([hinge_h / 2, 0])
|
||||||
cylinder(r = hinge_r, h = hinge_h, center = true);
|
difference() {
|
||||||
|
hull() {
|
||||||
|
translate_z(eps / 2)
|
||||||
|
cube([hinge_h, 2 * hinge_r, eps], center = true);
|
||||||
|
|
||||||
|
translate_z(z)
|
||||||
|
rotate([0, 90, 0])
|
||||||
|
cylinder(r = hinge_r, h = hinge_h, center = true);
|
||||||
|
}
|
||||||
|
translate([hinge_h / 2, 0, z])
|
||||||
|
rotate([90, 0, 90])
|
||||||
|
nut_trap(hinge_screw, screw_nut(hinge_screw), horizontal = true);
|
||||||
}
|
}
|
||||||
translate([hinge_h / 2, 0, z])
|
|
||||||
rotate([90, 0, 90])
|
|
||||||
nut_trap(hinge_screw, screw_nut(hinge_screw), horizontal = true);
|
|
||||||
}
|
|
||||||
|
|
||||||
linear_extrude(t)
|
linear_extrude(t)
|
||||||
difference() {
|
difference() {
|
||||||
hull()
|
hull()
|
||||||
|
camera_bracket_screw_positions(cam)
|
||||||
|
circle(washer_radius(screw_washer(bracket_screw)) + 0.5);
|
||||||
|
|
||||||
camera_bracket_screw_positions(cam)
|
camera_bracket_screw_positions(cam)
|
||||||
circle(washer_radius(screw_washer(bracket_screw)) + 0.5);
|
poly_circle(screw_clearance_radius(bracket_screw));
|
||||||
|
}
|
||||||
camera_bracket_screw_positions(cam)
|
}
|
||||||
poly_circle(screw_clearance_radius(bracket_screw));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module camera_assembly(cam, angle = 0) //! Camera case assembly
|
module camera_assembly(cam, angle = 0) //! Camera case assembly
|
||||||
|
@ -27,7 +27,6 @@ include <../utils/core/core.scad>
|
|||||||
function carrier_height() = 3; //! Height of PCB carrier
|
function carrier_height() = 3; //! Height of PCB carrier
|
||||||
|
|
||||||
module ESP12F_carrier_stl() { //! Generate the STL for an ESP12 carrier
|
module ESP12F_carrier_stl() { //! Generate the STL for an ESP12 carrier
|
||||||
stl("ESP12F_carrier");
|
|
||||||
pins = 8;
|
pins = 8;
|
||||||
pitch1 = 2;
|
pitch1 = 2;
|
||||||
pitch2 = 2.54;
|
pitch2 = 2.54;
|
||||||
@ -43,29 +42,29 @@ module ESP12F_carrier_stl() { //! Generate the STL for an ESP12 carrier
|
|||||||
width1 = wpitch1 + hole + squeezed_wall * 2;
|
width1 = wpitch1 + hole + squeezed_wall * 2;
|
||||||
width2 = wpitch2 + hole2 + squeezed_wall * 2;
|
width2 = wpitch2 + hole2 + squeezed_wall * 2;
|
||||||
|
|
||||||
difference() {
|
stl("ESP12F_carrier")
|
||||||
hull() {
|
difference() {
|
||||||
translate_z(height - eps / 2)
|
hull() {
|
||||||
cube([width1, length1, eps], center = true);
|
translate_z(height - eps / 2)
|
||||||
|
cube([width1, length1, eps], center = true);
|
||||||
|
|
||||||
translate_z(eps / 2)
|
translate_z(eps / 2)
|
||||||
cube([width2, length2, eps], center = true);
|
cube([width2, length2, eps], center = true);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(side = [-1, 1])
|
||||||
|
for(i = [0 : pins - 1])
|
||||||
|
hull() {
|
||||||
|
translate([side * wpitch1 / 2, i * pitch1 - (pins - 1) * pitch1 / 2, height])
|
||||||
|
cube([hole, hole, eps], center = true);
|
||||||
|
|
||||||
|
translate([side * wpitch2 / 2, i * pitch2 - (pins - 1) * pitch2 / 2])
|
||||||
|
cube([hole2, hole2, eps], center = true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(side = [-1, 1])
|
|
||||||
for(i = [0 : pins - 1])
|
|
||||||
hull() {
|
|
||||||
translate([side * wpitch1 / 2, i * pitch1 - (pins - 1) * pitch1 / 2, height])
|
|
||||||
cube([hole, hole, eps], center = true);
|
|
||||||
|
|
||||||
translate([side * wpitch2 / 2, i * pitch2 - (pins - 1) * pitch2 / 2])
|
|
||||||
cube([hole2, hole2, eps], center = true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module TP4056_carrier_stl() { //! Generate the STL for an TP4056 carrier, two required
|
module TP4056_carrier_stl() { //! Generate the STL for an TP4056 carrier, two required
|
||||||
stl("TP4056_carrier");
|
|
||||||
pitch = 2.54;
|
pitch = 2.54;
|
||||||
outer_pitch = 13.9;
|
outer_pitch = 13.9;
|
||||||
inner_pitch = 7.54;
|
inner_pitch = 7.54;
|
||||||
@ -78,30 +77,30 @@ module TP4056_carrier_stl() { //! Generate the STL for an TP4056 carrier, two re
|
|||||||
width = hole + squeezed_wall * 2;
|
width = hole + squeezed_wall * 2;
|
||||||
spacing = inch(0.9);
|
spacing = inch(0.9);
|
||||||
|
|
||||||
difference() {
|
stl("TP4056_carrier")
|
||||||
hull() {
|
difference() {
|
||||||
translate_z(height - eps / 2)
|
hull() {
|
||||||
cube([width, length1, eps], center = true);
|
translate_z(height - eps / 2)
|
||||||
|
cube([width, length1, eps], center = true);
|
||||||
|
|
||||||
translate_z(eps / 2)
|
translate_z(eps / 2)
|
||||||
cube([width, length2, eps], center = true);
|
cube([width, length2, eps], center = true);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(i = [0 : pins - 1])
|
||||||
|
let(x = [-outer_pitch / 2, - inner_pitch / 2, 0, 0, inner_pitch / 2, outer_pitch / 2][i])
|
||||||
|
if(x)
|
||||||
|
hull() {
|
||||||
|
translate([0, x, height])
|
||||||
|
cube([hole, hole, eps], center = true);
|
||||||
|
|
||||||
|
translate([0, i * pitch - (pins - 1) * pitch / 2])
|
||||||
|
cube([hole, hole, eps], center = true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i = [0 : pins - 1])
|
|
||||||
let(x = [-outer_pitch / 2, - inner_pitch / 2, 0, 0, inner_pitch / 2, outer_pitch / 2][i])
|
|
||||||
if(x)
|
|
||||||
hull() {
|
|
||||||
translate([0, x, height])
|
|
||||||
cube([hole, hole, eps], center = true);
|
|
||||||
|
|
||||||
translate([0, i * pitch - (pins - 1) * pitch / 2])
|
|
||||||
cube([hole, hole, eps], center = true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module MT3608_carrier_stl() { //! Generate the STL for an MT3608 carrier, two required
|
module MT3608_carrier_stl() { //! Generate the STL for an MT3608 carrier, two required
|
||||||
stl("MT3608_carrier");
|
|
||||||
pcb_width = 17;
|
pcb_width = 17;
|
||||||
w_pitch_top = 6.81;
|
w_pitch_top = 6.81;
|
||||||
w_pitch_bot = inch(0.3);
|
w_pitch_bot = inch(0.3);
|
||||||
@ -113,21 +112,22 @@ module MT3608_carrier_stl() { //! Generate the STL for an MT3608 carrier, two re
|
|||||||
width = hole + 2 * wall;
|
width = hole + 2 * wall;
|
||||||
offset = (l_pitch_top - l_pitch_bot) / 2;
|
offset = (l_pitch_top - l_pitch_bot) / 2;
|
||||||
|
|
||||||
difference() {
|
stl("MT3608_carrier")
|
||||||
hull() {
|
difference() {
|
||||||
translate([offset, 0, height - eps / 2])
|
|
||||||
rounded_rectangle([width, pcb_width - 2, eps], 1);
|
|
||||||
|
|
||||||
translate_z(eps / 2)
|
|
||||||
rounded_rectangle([width, pcb_width - 2, eps], 1);
|
|
||||||
}
|
|
||||||
for(side = [-1, 1])
|
|
||||||
hull() {
|
hull() {
|
||||||
translate([offset, side * w_pitch_top / 2, height])
|
translate([offset, 0, height - eps / 2])
|
||||||
cube([hole, hole, eps], center = true);
|
rounded_rectangle([width, pcb_width - 2, eps], 1);
|
||||||
|
|
||||||
translate([0, side * w_pitch_bot / 2])
|
translate_z(eps / 2)
|
||||||
cube([hole, hole, eps], center = true);
|
rounded_rectangle([width, pcb_width - 2, eps], 1);
|
||||||
}
|
}
|
||||||
}
|
for(side = [-1, 1])
|
||||||
|
hull() {
|
||||||
|
translate([offset, side * w_pitch_top / 2, height])
|
||||||
|
cube([hole, hole, eps], center = true);
|
||||||
|
|
||||||
|
translate([0, side * w_pitch_bot / 2])
|
||||||
|
cube([hole, hole, eps], center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,8 +72,6 @@ module corner_block_holes(screw = def_screw) //! Place children at all the holes
|
|||||||
children();
|
children();
|
||||||
|
|
||||||
module corner_block(screw = def_screw, name = false) { //! Generate the STL for a printed corner block
|
module corner_block(screw = def_screw, name = false) { //! Generate the STL for a printed corner block
|
||||||
stl(name ? name : str("corner_block", "_M", screw_radius(screw) * 20));
|
|
||||||
|
|
||||||
r = 1;
|
r = 1;
|
||||||
cb_width = corner_block_width(screw);
|
cb_width = corner_block_width(screw);
|
||||||
cb_height = cb_width;
|
cb_height = cb_width;
|
||||||
@ -81,39 +79,41 @@ module corner_block(screw = def_screw, name = false) { //! Generate the STL for
|
|||||||
insert = screw_insert(screw);
|
insert = screw_insert(screw);
|
||||||
corner_rad = insert_outer_d(insert) / 2 + wall;
|
corner_rad = insert_outer_d(insert) / 2 + wall;
|
||||||
offset = corner_block_hole_offset(screw);
|
offset = corner_block_hole_offset(screw);
|
||||||
difference() {
|
|
||||||
hull() {
|
|
||||||
translate([r, r])
|
|
||||||
rounded_cylinder(r = r, h = cb_height, r2 = r);
|
|
||||||
|
|
||||||
translate([r, cb_depth - r])
|
stl(name ? name : str("corner_block", "_M", screw_radius(screw) * 20))
|
||||||
cylinder(r = r, h = cb_height - corner_rad);
|
difference() {
|
||||||
|
hull() {
|
||||||
|
translate([r, r])
|
||||||
|
rounded_cylinder(r = r, h = cb_height, r2 = r);
|
||||||
|
|
||||||
translate([cb_width - r, r])
|
translate([r, cb_depth - r])
|
||||||
cylinder(r = r, h = cb_height - corner_rad);
|
cylinder(r = r, h = cb_height - corner_rad);
|
||||||
|
|
||||||
translate([offset, offset, offset])
|
translate([cb_width - r, r])
|
||||||
sphere(corner_rad);
|
cylinder(r = r, h = cb_height - corner_rad);
|
||||||
|
|
||||||
translate([offset, offset])
|
translate([offset, offset, offset])
|
||||||
cylinder(r = corner_rad, h = offset);
|
sphere(corner_rad);
|
||||||
|
|
||||||
translate([offset, r, offset])
|
translate([offset, offset])
|
||||||
rotate([-90, 0, 180])
|
cylinder(r = corner_rad, h = offset);
|
||||||
rounded_cylinder(r = corner_rad, h = r, r2 = r);
|
|
||||||
|
|
||||||
translate([r, offset, offset])
|
translate([offset, r, offset])
|
||||||
rotate([0, 90, 180])
|
rotate([-90, 0, 180])
|
||||||
rounded_cylinder(r = corner_rad, h = r, r2 = r);
|
rounded_cylinder(r = corner_rad, h = r, r2 = r);
|
||||||
|
|
||||||
|
translate([r, offset, offset])
|
||||||
|
rotate([0, 90, 180])
|
||||||
|
rounded_cylinder(r = corner_rad, h = r, r2 = r);
|
||||||
|
}
|
||||||
|
corner_block_v_hole(screw)
|
||||||
|
insert_hole(insert, overshoot);
|
||||||
|
|
||||||
|
corner_block_h_holes(screw)
|
||||||
|
insert_hole(insert, overshoot, true);
|
||||||
|
|
||||||
|
children();
|
||||||
}
|
}
|
||||||
corner_block_v_hole(screw)
|
|
||||||
insert_hole(insert, overshoot);
|
|
||||||
|
|
||||||
corner_block_h_holes(screw)
|
|
||||||
insert_hole(insert, overshoot, true);
|
|
||||||
|
|
||||||
children();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module corner_block_assembly(screw = def_screw, name = false) //! The printed block with inserts
|
module corner_block_assembly(screw = def_screw, name = false) //! The printed block with inserts
|
||||||
|
@ -54,44 +54,44 @@ module door_hinge_hole_positions(dir = 0) { //! Position chidren
|
|||||||
}
|
}
|
||||||
|
|
||||||
module door_hinge(door_thickness) { //! Generates STL for the moving part of the hinge
|
module door_hinge(door_thickness) { //! Generates STL for the moving part of the hinge
|
||||||
stl(str("door_hinge_", door_thickness));
|
|
||||||
|
|
||||||
hole_pitch = width - 10;
|
hole_pitch = width - 10;
|
||||||
|
|
||||||
union() {
|
stl(str("door_hinge_", door_thickness))
|
||||||
rotate([90, 0, 0])
|
union() {
|
||||||
linear_extrude(width, center = true)
|
rotate([90, 0, 0])
|
||||||
|
linear_extrude(width, center = true)
|
||||||
|
difference() {
|
||||||
|
hull() {
|
||||||
|
translate([dia / 2, thickness + door_thickness / 2])
|
||||||
|
intersection() {
|
||||||
|
rotate(180)
|
||||||
|
teardrop(r = dia / 2, h = 0, truncate = false);
|
||||||
|
|
||||||
|
square([dia + 1, 2 * thickness + door_thickness], center = true);
|
||||||
|
}
|
||||||
|
|
||||||
|
square([1, thickness + door_thickness]);
|
||||||
|
}
|
||||||
|
translate([dia / 2, thickness + door_thickness / 2])
|
||||||
|
teardrop_plus(r = screw_clearance_radius(pin_screw), h = 0);
|
||||||
|
}
|
||||||
|
linear_extrude(thickness)
|
||||||
difference() {
|
difference() {
|
||||||
hull() {
|
hull() {
|
||||||
translate([dia / 2, thickness + door_thickness / 2])
|
translate([0, -width / 2])
|
||||||
intersection() {
|
square([1, width]);
|
||||||
rotate(180)
|
|
||||||
teardrop(r = dia / 2, h = 0, truncate = false);
|
|
||||||
|
|
||||||
square([dia + 1, 2 * thickness + door_thickness], center = true);
|
for(side = [-1, 1])
|
||||||
}
|
translate([-width + rad, side * (width / 2 - rad)])
|
||||||
|
circle4n(rad);
|
||||||
square([1, thickness + door_thickness]);
|
|
||||||
}
|
}
|
||||||
translate([dia / 2, thickness + door_thickness / 2])
|
rotate(180)
|
||||||
teardrop_plus(r = screw_clearance_radius(pin_screw), h = 0);
|
vflip()
|
||||||
|
door_hinge_hole_positions()
|
||||||
|
poly_circle(screw_clearance_radius(screw));
|
||||||
}
|
}
|
||||||
linear_extrude(thickness)
|
}
|
||||||
difference() {
|
|
||||||
hull() {
|
|
||||||
translate([0, -width / 2])
|
|
||||||
square([1, width]);
|
|
||||||
|
|
||||||
for(side = [-1, 1])
|
|
||||||
translate([-width + rad, side * (width / 2 - rad)])
|
|
||||||
circle4n(rad);
|
|
||||||
}
|
|
||||||
rotate(180)
|
|
||||||
vflip()
|
|
||||||
door_hinge_hole_positions()
|
|
||||||
poly_circle(screw_clearance_radius(screw));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module door_hinge_6_stl() door_hinge(6);
|
module door_hinge_6_stl() door_hinge(6);
|
||||||
|
@ -38,23 +38,23 @@ function door_latch_offset() = width / 2 + 1; //! Offset of the axle from the do
|
|||||||
nut_trap_depth = round_to_layer(screw_head_height(screw)) + 4 * layer_height;
|
nut_trap_depth = round_to_layer(screw_head_height(screw)) + 4 * layer_height;
|
||||||
|
|
||||||
module door_latch_stl() { //! Generates the STL for the printed part
|
module door_latch_stl() { //! Generates the STL for the printed part
|
||||||
stl("door_latch");
|
|
||||||
|
|
||||||
ridge = 4;
|
ridge = 4;
|
||||||
difference() {
|
|
||||||
union() {
|
|
||||||
hull() {
|
|
||||||
rounded_rectangle([length, width, thickness - tan(30) * (width - ridge) / 2], rad, center = false);
|
|
||||||
|
|
||||||
translate_z(thickness / 2)
|
stl("door_latch")
|
||||||
cube([length, ridge, thickness], center = true);
|
difference() {
|
||||||
|
union() {
|
||||||
|
hull() {
|
||||||
|
rounded_rectangle([length, width, thickness - tan(30) * (width - ridge) / 2], rad, center = false);
|
||||||
|
|
||||||
|
translate_z(thickness / 2)
|
||||||
|
cube([length, ridge, thickness], center = true);
|
||||||
|
}
|
||||||
|
|
||||||
|
cylinder(d = width, h = height);
|
||||||
}
|
}
|
||||||
|
hanging_hole(nut_trap_depth, screw_clearance_radius(screw))
|
||||||
cylinder(d = width, h = height);
|
circle(r = nut_trap_radius(screw_nut(screw)), $fn = 6);
|
||||||
}
|
}
|
||||||
hanging_hole(nut_trap_depth, screw_clearance_radius(screw))
|
|
||||||
circle(r = nut_trap_radius(screw_nut(screw)), $fn = 6);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module door_latch_assembly(sheet_thickness = 3) { //! The assembly for a specified sheet thickess
|
module door_latch_assembly(sheet_thickness = 3) { //! The assembly for a specified sheet thickess
|
||||||
|
@ -71,38 +71,38 @@ module fixing_block_h_hole_2D(screw = def_screw) //! Position 2D child on the ho
|
|||||||
children();
|
children();
|
||||||
|
|
||||||
module fixing_block(screw = def_screw) { //! Generate the STL
|
module fixing_block(screw = def_screw) { //! Generate the STL
|
||||||
stl(str("fixing_block_M", screw_radius(screw) * 20));
|
r = 1;
|
||||||
r = 1;
|
|
||||||
insert = screw_insert(screw);
|
insert = screw_insert(screw);
|
||||||
corner_rad = insert_outer_d(insert) / 2 + wall;
|
corner_rad = insert_outer_d(insert) / 2 + wall;
|
||||||
fb_width = fixing_block_width(screw);
|
fb_width = fixing_block_width(screw);
|
||||||
fb_height = fixing_block_height(screw);
|
fb_height = fixing_block_height(screw);
|
||||||
fb_depth = fixing_block_depth(screw);
|
fb_depth = fixing_block_depth(screw);
|
||||||
|
|
||||||
difference() {
|
stl(str("fixing_block_M", screw_radius(screw) * 20))
|
||||||
union() {
|
difference() {
|
||||||
linear_extrude(fb_height, convexity = 5)
|
union() {
|
||||||
difference() {
|
linear_extrude(fb_height, convexity = 5)
|
||||||
hull() {
|
difference() {
|
||||||
for(side = [-1, 1]) {
|
hull() {
|
||||||
translate([side * (fb_width / 2 - corner_rad), fb_depth - corner_rad])
|
for(side = [-1, 1]) {
|
||||||
circle4n(corner_rad);
|
translate([side * (fb_width / 2 - corner_rad), fb_depth - corner_rad])
|
||||||
|
circle4n(corner_rad);
|
||||||
|
|
||||||
translate([side * (fb_width / 2 - r), r])
|
translate([side * (fb_width / 2 - r), r])
|
||||||
circle4n(r);
|
circle4n(r);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
fixing_block_v_holes(screw)
|
||||||
|
poly_circle(screw_clearance_radius(screw));
|
||||||
}
|
}
|
||||||
fixing_block_v_holes(screw)
|
}
|
||||||
poly_circle(screw_clearance_radius(screw));
|
translate_z(fb_height)
|
||||||
}
|
fixing_block_v_holes(screw)
|
||||||
}
|
insert_hole(insert);
|
||||||
translate_z(fb_height)
|
|
||||||
fixing_block_v_holes(screw)
|
|
||||||
insert_hole(insert);
|
|
||||||
|
|
||||||
fixing_block_h_hole(screw)
|
fixing_block_h_hole(screw)
|
||||||
insert_hole(insert, 10, true);
|
insert_hole(insert, 10, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module fixing_block_assembly(screw = def_screw) pose([55, 180, 25], [0, 4.8, 4.8]) //! Printed part with the inserts inserted
|
module fixing_block_assembly(screw = def_screw) pose([55, 180, 25], [0, 4.8, 4.8]) //! Printed part with the inserts inserted
|
||||||
|
@ -65,8 +65,6 @@ module hinge_screw_positions(type) { //! Place children at the screw positions
|
|||||||
}
|
}
|
||||||
|
|
||||||
module hinge_male(type, female = false) { //! The half with the stationary pin
|
module hinge_male(type, female = false) { //! The half with the stationary pin
|
||||||
stl(str("hinge_", female ? "fe": "", "male_", type[0]));
|
|
||||||
|
|
||||||
r = hinge_radius(type);
|
r = hinge_radius(type);
|
||||||
w = hinge_width(type);
|
w = hinge_width(type);
|
||||||
t = hinge_thickness(type);
|
t = hinge_thickness(type);
|
||||||
@ -85,37 +83,40 @@ module hinge_male(type, female = false) { //! The half with the stationary
|
|||||||
teardrop_r = kr / cos(22.5); // The corner on the teardrop
|
teardrop_r = kr / cos(22.5); // The corner on the teardrop
|
||||||
inset = sqrt(sqr(teardrop_r + gap) - sqr(kr - t)) - kr;
|
inset = sqrt(sqr(teardrop_r + gap) - sqr(kr - t)) - kr;
|
||||||
|
|
||||||
linear_extrude(t)
|
stl(str("hinge_", female ? "fe": "", "male_", type[0]))
|
||||||
difference() {
|
union() {
|
||||||
hull() {
|
linear_extrude(t)
|
||||||
for(side = [-1, 1])
|
difference() {
|
||||||
translate([side * (w / 2 - r), hinge_depth(type) - r])
|
hull() {
|
||||||
circle4n(r);
|
for(side = [-1, 1])
|
||||||
|
translate([side * (w / 2 - r), hinge_depth(type) - r])
|
||||||
|
circle4n(r);
|
||||||
|
|
||||||
translate([-w / 2, inset])
|
translate([-w / 2, inset])
|
||||||
square([w, eps]);
|
square([w, eps]);
|
||||||
}
|
}
|
||||||
hinge_screw_positions(type)
|
hinge_screw_positions(type)
|
||||||
poly_circle(screw_clearance_radius(hinge_screw(type)));
|
poly_circle(screw_clearance_radius(hinge_screw(type)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pitch = mw + gap + fw + gap;
|
||||||
|
dir = female ? -1 : 1;
|
||||||
|
translate([0, -kr, kr])
|
||||||
|
rotate([90, 0, -90])
|
||||||
|
for(z = [0 : (female ? fn : mn) - 1])
|
||||||
|
translate_z(-dir * w / 2 + z * dir * pitch + (female ? -fw - mw - gap : 0))
|
||||||
|
linear_extrude(female ? fw : mw)
|
||||||
|
difference() {
|
||||||
|
hull() {
|
||||||
|
rotate(180)
|
||||||
|
teardrop(r = kr, h = 0);
|
||||||
|
|
||||||
|
translate([-kr - 1, -kr])
|
||||||
|
square(1);
|
||||||
|
}
|
||||||
|
teardrop_plus(r = pr + (female ? gap : 0), h = 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pitch = mw + gap + fw + gap;
|
|
||||||
dir = female ? -1 : 1;
|
|
||||||
translate([0, -kr, kr])
|
|
||||||
rotate([90, 0, -90])
|
|
||||||
for(z = [0 : (female ? fn : mn) - 1])
|
|
||||||
translate_z(-dir * w / 2 + z * dir * pitch + (female ? -fw - mw - gap : 0))
|
|
||||||
linear_extrude(female ? fw : mw)
|
|
||||||
difference() {
|
|
||||||
hull() {
|
|
||||||
rotate(180)
|
|
||||||
teardrop(r = kr, h = 0);
|
|
||||||
|
|
||||||
translate([-kr - 1, -kr])
|
|
||||||
square(1);
|
|
||||||
}
|
|
||||||
teardrop_plus(r = pr + (female ? gap : 0), h = 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module hinge_female(type) hinge_male(type, true);
|
module hinge_female(type) hinge_male(type, true);
|
||||||
|
@ -39,7 +39,6 @@ function foot_screw(type = foot) = type[4]; //! Screw type
|
|||||||
function foot_slant(type = foot) = type[5]; //! Taper angle
|
function foot_slant(type = foot) = type[5]; //! Taper angle
|
||||||
|
|
||||||
module foot(type = foot) { //! Generate STL
|
module foot(type = foot) { //! Generate STL
|
||||||
stl("foot");
|
|
||||||
h = foot_height(type);
|
h = foot_height(type);
|
||||||
t = foot_thickness(type);
|
t = foot_thickness(type);
|
||||||
r1 = washer_radius(screw_washer(foot_screw(type)));
|
r1 = washer_radius(screw_washer(foot_screw(type)));
|
||||||
@ -47,24 +46,25 @@ module foot(type = foot) { //! Generate STL
|
|||||||
r2 = r3 - h * tan(foot_slant(type));
|
r2 = r3 - h * tan(foot_slant(type));
|
||||||
r = foot_rad(type);
|
r = foot_rad(type);
|
||||||
|
|
||||||
union() {
|
stl("foot")
|
||||||
rotate_extrude(convexity = 3) {
|
union() {
|
||||||
hull() {
|
rotate_extrude(convexity = 3) {
|
||||||
translate([r1, 0])
|
hull() {
|
||||||
square([r3 - r1, eps]);
|
translate([r1, 0])
|
||||||
|
square([r3 - r1, eps]);
|
||||||
|
|
||||||
for(x = [r1 + r, r2 - r])
|
for(x = [r1 + r, r2 - r])
|
||||||
translate([x, h - r])
|
translate([x, h - r])
|
||||||
circle4n(r);
|
circle4n(r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
linear_extrude(t)
|
||||||
|
difference() {
|
||||||
|
circle(r1 + eps);
|
||||||
|
|
||||||
|
poly_circle( screw_clearance_radius(foot_screw(type)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
linear_extrude(t)
|
|
||||||
difference() {
|
|
||||||
circle(r1 + eps);
|
|
||||||
|
|
||||||
poly_circle( screw_clearance_radius(foot_screw(type)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module foot_assembly(t = 0, type = foot, flip = false) { //! Assembly with fasteners in place for specified sheet thickness
|
module foot_assembly(t = 0, type = foot, flip = false) { //! Assembly with fasteners in place for specified sheet thickness
|
||||||
@ -93,7 +93,6 @@ module foot_assembly(t = 0, type = foot, flip = false) { //! Assembly with faste
|
|||||||
}
|
}
|
||||||
|
|
||||||
module insert_foot(type = insert_foot) { //! Generate STL for foot with insert
|
module insert_foot(type = insert_foot) { //! Generate STL for foot with insert
|
||||||
stl("insert_foot");
|
|
||||||
h = foot_height(type);
|
h = foot_height(type);
|
||||||
r3 = foot_diameter(type) / 2;
|
r3 = foot_diameter(type) / 2;
|
||||||
r2 = r3 - h * tan(foot_slant(type));
|
r2 = r3 - h * tan(foot_slant(type));
|
||||||
@ -103,30 +102,31 @@ module insert_foot(type = insert_foot) { //! Generate STL for foot with insert
|
|||||||
h2 = insert_hole_length(insert);
|
h2 = insert_hole_length(insert);
|
||||||
r4 = insert_hole_radius(insert);
|
r4 = insert_hole_radius(insert);
|
||||||
r5 = r4 + 1;
|
r5 = r4 + 1;
|
||||||
union() {
|
stl("insert_foot")
|
||||||
rotate_extrude() {
|
union() {
|
||||||
union() {
|
rotate_extrude() {
|
||||||
hull() {
|
union() {
|
||||||
translate([r5, 0]) {
|
hull() {
|
||||||
square([r3 - r5, eps]);
|
translate([r5, 0]) {
|
||||||
square([eps, h]);
|
square([r3 - r5, eps]);
|
||||||
}
|
square([eps, h]);
|
||||||
|
}
|
||||||
|
|
||||||
translate([r2 - r, h - r])
|
translate([r2 - r, h - r])
|
||||||
circle4n(r);
|
circle4n(r);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
linear_extrude(h2 + eps)
|
||||||
|
difference() {
|
||||||
|
circle(r5 + eps);
|
||||||
|
|
||||||
|
poly_circle(r4);
|
||||||
|
}
|
||||||
|
|
||||||
|
translate_z(h2)
|
||||||
|
cylinder(r = r5 + eps, h = h - h2);
|
||||||
}
|
}
|
||||||
linear_extrude(h2 + eps)
|
|
||||||
difference() {
|
|
||||||
circle(r5 + eps);
|
|
||||||
|
|
||||||
poly_circle(r4);
|
|
||||||
}
|
|
||||||
|
|
||||||
translate_z(h2)
|
|
||||||
cylinder(r = r5 + eps, h = h - h2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
//! Place the insert in the bottom of the foot and push home with a soldering iron with a conical bit heated to 200°C.
|
//! Place the insert in the bottom of the foot and push home with a soldering iron with a conical bit heated to 200°C.
|
||||||
|
@ -46,8 +46,6 @@ module handle_holes(h = 100) //! Drills holes for the screws
|
|||||||
drill(screw_clearance_radius(screw), h);
|
drill(screw_clearance_radius(screw), h);
|
||||||
|
|
||||||
module handle_stl() { //! generate the STL
|
module handle_stl() { //! generate the STL
|
||||||
stl("handle");
|
|
||||||
|
|
||||||
module end(end)
|
module end(end)
|
||||||
translate([end * pitch / 2, 0])
|
translate([end * pitch / 2, 0])
|
||||||
rotate_extrude()
|
rotate_extrude()
|
||||||
@ -59,23 +57,24 @@ module handle_stl() { //! generate the STL
|
|||||||
square([dia / 2 + 1, dia + 1]);
|
square([dia / 2 + 1, dia + 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
translate_z(dia / 2)
|
stl("handle")
|
||||||
union() {
|
translate_z(dia / 2)
|
||||||
hull() {
|
union() {
|
||||||
end(-1);
|
hull() {
|
||||||
|
end(-1);
|
||||||
|
|
||||||
end(1);
|
end(1);
|
||||||
}
|
|
||||||
|
|
||||||
handle_screw_positions()
|
|
||||||
render() difference() {
|
|
||||||
h = height + dia / 2;
|
|
||||||
cylinder(d = dia, h = h);
|
|
||||||
|
|
||||||
translate_z(h)
|
|
||||||
insert_hole(insert, 6);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
handle_screw_positions()
|
||||||
|
render() difference() {
|
||||||
|
h = height + dia / 2;
|
||||||
|
cylinder(d = dia, h = h);
|
||||||
|
|
||||||
|
translate_z(h)
|
||||||
|
insert_hole(insert, 6);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
//! Place inserts in the bottom of the posts and push them home with a soldering iron with a conical bit heated to 200°C.
|
//! Place inserts in the bottom of the posts and push them home with a soldering iron with a conical bit heated to 200°C.
|
||||||
|
@ -66,35 +66,35 @@ module pcb_mount_washer_stl() //! A plastic washer to clamp a PCB
|
|||||||
pcb_mount_ring();
|
pcb_mount_ring();
|
||||||
|
|
||||||
module pcb_mount(pcb, height = 5, washers = true) { //! Make the STL of a pcb mount for the specified PCB.
|
module pcb_mount(pcb, height = 5, washers = true) { //! Make the STL of a pcb mount for the specified PCB.
|
||||||
stl(str("pcb_mount_", pcb[0], "_", height));
|
|
||||||
|
|
||||||
y_pitch = pcb_width(pcb) > 4 * pillar_r + 4 ? pillar_r + 1
|
y_pitch = pcb_width(pcb) > 4 * pillar_r + 4 ? pillar_r + 1
|
||||||
: pcb_width(pcb) / 2 + frame_w + 1 + pillar_r;
|
: pcb_width(pcb) / 2 + frame_w + 1 + pillar_r;
|
||||||
|
|
||||||
if(washers)
|
stl(str("pcb_mount_", pcb[0], "_", height)) union() {
|
||||||
for(x = [-1, 1], y = [-1, 1])
|
if(washers)
|
||||||
translate([x * (pillar_r + 1), y * y_pitch, 0])
|
for(x = [-1, 1], y = [-1, 1])
|
||||||
pcb_mount_washer_stl();
|
translate([x * (pillar_r + 1), y * y_pitch, 0])
|
||||||
|
pcb_mount_washer_stl();
|
||||||
|
|
||||||
for(x = [-1, 1])
|
for(x = [-1, 1])
|
||||||
translate([x * pillar_x_pitch(pcb) / 2, 0, frame_t / 2])
|
translate([x * pillar_x_pitch(pcb) / 2, 0, frame_t / 2])
|
||||||
cube([frame_w, pillar_y_pitch(pcb) - 2 * wall, frame_t], center = true);
|
cube([frame_w, pillar_y_pitch(pcb) - 2 * wall, frame_t], center = true);
|
||||||
|
|
||||||
for(y = [-1, 1])
|
for(y = [-1, 1])
|
||||||
translate([0, y * pillar_y_pitch(pcb) / 2, frame_t / 2])
|
translate([0, y * pillar_y_pitch(pcb) / 2, frame_t / 2])
|
||||||
cube([pillar_x_pitch(pcb) - 2 * wall, frame_w, frame_t], center = true);
|
cube([pillar_x_pitch(pcb) - 2 * wall, frame_w, frame_t], center = true);
|
||||||
|
|
||||||
pcb_mount_screw_positions(pcb)
|
pcb_mount_screw_positions(pcb)
|
||||||
linear_extrude(height)
|
linear_extrude(height)
|
||||||
pcb_mount_ring();
|
|
||||||
|
|
||||||
linear_extrude(height + pcb_thickness(pcb) - layer_height)
|
|
||||||
difference() {
|
|
||||||
pcb_mount_screw_positions(pcb)
|
|
||||||
pcb_mount_ring();
|
pcb_mount_ring();
|
||||||
|
|
||||||
square([pcb_length(pcb) + 2 * clearance, pcb_width(pcb) + 2 * clearance], center = true);
|
linear_extrude(height + pcb_thickness(pcb) - layer_height)
|
||||||
}
|
difference() {
|
||||||
|
pcb_mount_screw_positions(pcb)
|
||||||
|
pcb_mount_ring();
|
||||||
|
|
||||||
|
square([pcb_length(pcb) + 2 * clearance, pcb_width(pcb) + 2 * clearance], center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module pcb_mount_assembly(pcb, thickness, height = 5) { //! A PCB mount assembly with fasteners
|
module pcb_mount_assembly(pcb, thickness, height = 5) { //! A PCB mount assembly with fasteners
|
||||||
|
@ -129,28 +129,27 @@ module pbox_outer_shape(type) //! 2D outer shape of the box
|
|||||||
offset(pbox_wall(type) / 2) pbox_mid_shape(type);
|
offset(pbox_wall(type) / 2) pbox_mid_shape(type);
|
||||||
|
|
||||||
module pbox_base(type) { //! Generate the STL for the base
|
module pbox_base(type) { //! Generate the STL for the base
|
||||||
stl(str(pbox_name(type),"_base"));
|
|
||||||
t = pbox_base(type);
|
t = pbox_base(type);
|
||||||
difference() {
|
|
||||||
union() {
|
|
||||||
linear_extrude(t)
|
|
||||||
offset(base_outset - 0.2)
|
|
||||||
pbox_inner_shape(type);
|
|
||||||
|
|
||||||
if($children > 0)
|
stl(str(pbox_name(type),"_base"))
|
||||||
children(0);
|
difference() {
|
||||||
|
union() {
|
||||||
|
linear_extrude(t)
|
||||||
|
offset(base_outset - 0.2)
|
||||||
|
pbox_inner_shape(type);
|
||||||
|
|
||||||
|
if($children > 0)
|
||||||
|
children(0);
|
||||||
|
}
|
||||||
|
pbox_screw_positions(type)
|
||||||
|
poly_cylinder(r = screw_clearance_radius(pbox_screw(type)), h = 2 * t + eps, center = true);
|
||||||
|
|
||||||
|
if($children > 1)
|
||||||
|
children(1);
|
||||||
}
|
}
|
||||||
pbox_screw_positions(type)
|
|
||||||
poly_cylinder(r = screw_clearance_radius(pbox_screw(type)), h = 2 * t + eps, center = true);
|
|
||||||
|
|
||||||
if($children > 1)
|
|
||||||
children(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module pbox(type) { //! Generate the STL for the main case
|
module pbox(type) { //! Generate the STL for the main case
|
||||||
stl(pbox_name(type));
|
|
||||||
|
|
||||||
height = pbox_height(type);
|
height = pbox_height(type);
|
||||||
total_height = pbox_total_height(type);
|
total_height = pbox_total_height(type);
|
||||||
top_thickness = pbox_top(type);
|
top_thickness = pbox_top(type);
|
||||||
@ -159,60 +158,61 @@ module pbox(type) { //! Generate the STL for the main case
|
|||||||
ledge_inset = base_outset - base_overlap;
|
ledge_inset = base_outset - base_overlap;
|
||||||
ledge_h = pbox_base(type) ? (ledge_outset - ledge_inset) * 2 : 0;
|
ledge_h = pbox_base(type) ? (ledge_outset - ledge_inset) * 2 : 0;
|
||||||
|
|
||||||
difference() {
|
stl(pbox_name(type))
|
||||||
union() {
|
|
||||||
linear_extrude(total_height)
|
|
||||||
pbox_outer_shape(type);
|
|
||||||
|
|
||||||
if($children > 2)
|
|
||||||
children(2);
|
|
||||||
}
|
|
||||||
difference() {
|
difference() {
|
||||||
translate_z(top_thickness)
|
union() {
|
||||||
union() {
|
linear_extrude(total_height)
|
||||||
linear_extrude(height + eps)
|
pbox_outer_shape(type);
|
||||||
offset(-wall / 2) pbox_mid_shape(type);
|
|
||||||
|
|
||||||
translate_z(height) // Recess for the base
|
if($children > 2)
|
||||||
linear_extrude(total_height - height)
|
children(2);
|
||||||
offset(base_outset)
|
}
|
||||||
pbox_inner_shape(type);
|
difference() {
|
||||||
}
|
translate_z(top_thickness)
|
||||||
// Ledge to support the lid
|
union() {
|
||||||
if(ledge_h)
|
linear_extrude(height + eps)
|
||||||
translate_z(top_thickness + height - ledge_h)
|
offset(-wall / 2) pbox_mid_shape(type);
|
||||||
difference() {
|
|
||||||
rounded_rectangle([pbox_width(type) + 2 * outset, pbox_depth(type) + 2 * outset, ledge_h], 1, center = false);
|
|
||||||
|
|
||||||
hull() {
|
translate_z(height) // Recess for the base
|
||||||
linear_extrude(ledge_h + eps)
|
linear_extrude(total_height - height)
|
||||||
offset(ledge_inset)
|
offset(base_outset)
|
||||||
pbox_inner_shape(type);
|
pbox_inner_shape(type);
|
||||||
|
|
||||||
linear_extrude(eps)
|
|
||||||
offset(ledge_outset)
|
|
||||||
pbox_inner_shape(type);
|
|
||||||
}
|
|
||||||
pbox_screw_positions(type)
|
|
||||||
insert_hole(pbox_insert(type));
|
|
||||||
}
|
}
|
||||||
|
// Ledge to support the lid
|
||||||
|
if(ledge_h)
|
||||||
|
translate_z(top_thickness + height - ledge_h)
|
||||||
|
difference() {
|
||||||
|
rounded_rectangle([pbox_width(type) + 2 * outset, pbox_depth(type) + 2 * outset, ledge_h], 1, center = false);
|
||||||
|
|
||||||
// Corner lugs for inserts
|
hull() {
|
||||||
outset = wall + pbox_ridges(type).y;
|
linear_extrude(ledge_h + eps)
|
||||||
or = pbox_radius(type) + outset;
|
offset(ledge_inset)
|
||||||
inset = pbox_screw_inset(type) + outset;
|
pbox_inner_shape(type);
|
||||||
br = insert_boss_radius(pbox_insert(type), wall);
|
|
||||||
ext = sqrt(2) * inset - or * (sqrt(2) - 1) - br;
|
|
||||||
translate_z(height + top_thickness)
|
|
||||||
pbox_screw_positions(type)
|
|
||||||
insert_lug(pbox_insert(type), wall, counter_bore = 0, extension = ext, corner_r = or);
|
|
||||||
|
|
||||||
if($children > 0)
|
linear_extrude(eps)
|
||||||
children(0);
|
offset(ledge_outset)
|
||||||
|
pbox_inner_shape(type);
|
||||||
|
}
|
||||||
|
pbox_screw_positions(type)
|
||||||
|
insert_hole(pbox_insert(type));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Corner lugs for inserts
|
||||||
|
outset = wall + pbox_ridges(type).y;
|
||||||
|
or = pbox_radius(type) + outset;
|
||||||
|
inset = pbox_screw_inset(type) + outset;
|
||||||
|
br = insert_boss_radius(pbox_insert(type), wall);
|
||||||
|
ext = sqrt(2) * inset - or * (sqrt(2) - 1) - br;
|
||||||
|
translate_z(height + top_thickness)
|
||||||
|
pbox_screw_positions(type)
|
||||||
|
insert_lug(pbox_insert(type), wall, counter_bore = 0, extension = ext, corner_r = or);
|
||||||
|
|
||||||
|
if($children > 0)
|
||||||
|
children(0);
|
||||||
|
}
|
||||||
|
if($children > 1)
|
||||||
|
children(1);
|
||||||
}
|
}
|
||||||
if($children > 1)
|
|
||||||
children(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module pbox_inserts(type) //! Place the inserts for the base screws
|
module pbox_inserts(type) //! Place the inserts for the base screws
|
||||||
|
@ -93,7 +93,6 @@ module printed_pulley(type) { //! Draw a printable pulley
|
|||||||
or = pulley_od(type) / 2;
|
or = pulley_od(type) / 2;
|
||||||
screw_z = pulley_screw_z(type);
|
screw_z = pulley_screw_z(type);
|
||||||
|
|
||||||
stl(str("printed_pulley_", type[0]));
|
|
||||||
|
|
||||||
module core() {
|
module core() {
|
||||||
translate_z(pulley_hub_length(type) + ft)
|
translate_z(pulley_hub_length(type) + ft)
|
||||||
@ -129,54 +128,55 @@ module printed_pulley(type) { //! Draw a printable pulley
|
|||||||
circle(d = pulley_bore(type));
|
circle(d = pulley_bore(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
translate_z(printed_pulley_inverted(type) ? - hl : 0) {
|
stl(str("printed_pulley_", type[0]))
|
||||||
// hub
|
translate_z(printed_pulley_inverted(type) ? - hl : 0) {
|
||||||
if(hl)
|
// hub
|
||||||
translate_z(printed_pulley_inverted(type) ? hl + w + 2 * ft : 0)
|
if(hl)
|
||||||
if(screw_z && screw_z < hl)
|
translate_z(printed_pulley_inverted(type) ? hl + w + 2 * ft : 0)
|
||||||
render()
|
if(screw_z && screw_z < hl)
|
||||||
difference() {
|
render()
|
||||||
hub();
|
difference() {
|
||||||
|
hub();
|
||||||
|
|
||||||
|
screw_holes();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
hub();
|
||||||
|
|
||||||
|
// bottom flange
|
||||||
|
translate_z(hl)
|
||||||
|
linear_extrude(ft)
|
||||||
|
difference() {
|
||||||
|
circle(d = pulley_flange_dia(type));
|
||||||
|
circle(d = pulley_bore(type));
|
||||||
|
}
|
||||||
|
|
||||||
|
// top flange
|
||||||
|
translate_z(hl + ft + w) {
|
||||||
|
// inner part, supported by core
|
||||||
|
linear_extrude(ft)
|
||||||
|
difference() {
|
||||||
|
circle(r = or);
|
||||||
|
circle(d = pulley_bore(type));
|
||||||
|
}
|
||||||
|
// outer part at 45 degrees for printing
|
||||||
|
rotate_extrude()
|
||||||
|
translate([or - eps, ft])
|
||||||
|
vflip()
|
||||||
|
right_triangle(ft, ft);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(screw_z && screw_z > hl)
|
||||||
|
render()
|
||||||
|
difference() { // T5 pulleys have screws through the teeth
|
||||||
|
core();
|
||||||
|
|
||||||
|
translate_z(printed_pulley_inverted(type) ? pulley_height(type) + hl - 2 * screw_z : 0)
|
||||||
screw_holes();
|
screw_holes();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
hub();
|
|
||||||
|
|
||||||
// bottom flange
|
|
||||||
translate_z(hl)
|
|
||||||
linear_extrude(ft)
|
|
||||||
difference() {
|
|
||||||
circle(d = pulley_flange_dia(type));
|
|
||||||
circle(d = pulley_bore(type));
|
|
||||||
}
|
|
||||||
|
|
||||||
// top flange
|
|
||||||
translate_z(hl + ft + w) {
|
|
||||||
// inner part, supported by core
|
|
||||||
linear_extrude(ft)
|
|
||||||
difference() {
|
|
||||||
circle(r = or);
|
|
||||||
circle(d = pulley_bore(type));
|
|
||||||
}
|
|
||||||
// outer part at 45 degrees for printing
|
|
||||||
rotate_extrude()
|
|
||||||
translate([or - eps, ft])
|
|
||||||
vflip()
|
|
||||||
right_triangle(ft, ft);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(screw_z && screw_z > hl)
|
|
||||||
render()
|
|
||||||
difference() { // T5 pulleys have screws through the teeth
|
|
||||||
core();
|
core();
|
||||||
|
}
|
||||||
translate_z(printed_pulley_inverted(type) ? pulley_height(type) + hl - 2 * screw_z : 0)
|
|
||||||
screw_holes();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
core();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module printed_pulley_assembly(type, colour = pp1_colour) //! Draw a printed pulley with its grub screws in place
|
module printed_pulley_assembly(type, colour = pp1_colour) //! Draw a printed pulley with its grub screws in place
|
||||||
|
@ -79,8 +79,6 @@ module psu_shroud_holes(type, cable_d, cables = 1) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module psu_shroud(type, cable_d, name, cables = 1) { //! Generate the STL file for a specified ssr and cable
|
module psu_shroud(type, cable_d, name, cables = 1) { //! Generate the STL file for a specified ssr and cable
|
||||||
stl(str("psu_shroud_", name));
|
|
||||||
|
|
||||||
extent = psu_shroud_extent(type);
|
extent = psu_shroud_extent(type);
|
||||||
depth = psu_shroud_depth(type);
|
depth = psu_shroud_depth(type);
|
||||||
width = psu_shroud_width(type);
|
width = psu_shroud_width(type);
|
||||||
@ -109,38 +107,40 @@ module psu_shroud(type, cable_d, name, cables = 1) { //! Generate the STL file f
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// base and sides
|
stl(str("psu_shroud_", name)) {
|
||||||
translate([centre_x, -centre_y]) {
|
// base and sides
|
||||||
rounded_rectangle([depth - eps, width - eps, top], rad, center = false);
|
translate([centre_x, -centre_y]) {
|
||||||
|
rounded_rectangle([depth - eps, width - eps, top], rad, center = false);
|
||||||
|
|
||||||
linear_extrude(height)
|
linear_extrude(height)
|
||||||
difference() {
|
difference() {
|
||||||
|
shape();
|
||||||
|
|
||||||
|
translate([depth / 2, width / 2 - 5])
|
||||||
|
square([2 * (depth - extent + terminal_clearance), 10], center = true);
|
||||||
|
}
|
||||||
|
linear_extrude(height - terminal_block_height(tb) - psu_terminal_block_z(type) - terminal_clearance)
|
||||||
shape();
|
shape();
|
||||||
|
|
||||||
translate([depth / 2, width / 2 - 5])
|
|
||||||
square([2 * (depth - extent + terminal_clearance), 10], center = true);
|
|
||||||
}
|
}
|
||||||
linear_extrude(height - terminal_block_height(tb) - psu_terminal_block_z(type) - terminal_clearance)
|
// cable slots
|
||||||
shape();
|
for(i = [0 : 1 : cables - 1])
|
||||||
}
|
translate([centre_x - depth / 2 + wall / 2, -centre_y + (i - cables / 2 + 0.5) * psu_shroud_cable_pitch(cable_d), height / 2])
|
||||||
// cable slots
|
rotate([90, 0, 90])
|
||||||
for(i = [0 : 1 : cables - 1])
|
linear_extrude(wall, center = true)
|
||||||
translate([centre_x - depth / 2 + wall / 2, -centre_y + (i - cables / 2 + 0.5) * psu_shroud_cable_pitch(cable_d), height / 2])
|
difference() {
|
||||||
rotate([90, 0, 90])
|
square([cable_d + eps, height], center = true);
|
||||||
linear_extrude(wall, center = true)
|
|
||||||
difference() {
|
|
||||||
square([cable_d + eps, height], center = true);
|
|
||||||
|
|
||||||
translate([0, height / 2])
|
translate([0, height / 2])
|
||||||
vertical_tearslot(h = 0, r = cable_d / 2, l = cable_d);
|
vertical_tearslot(h = 0, r = cable_d / 2, l = cable_d);
|
||||||
}
|
}
|
||||||
// insert lugs
|
// insert lugs
|
||||||
mirror([0, 1, 0])
|
mirror([0, 1, 0])
|
||||||
psu_shroud_hole_positions(type)
|
psu_shroud_hole_positions(type)
|
||||||
translate_z(height)
|
translate_z(height)
|
||||||
rotate($side * 90)
|
rotate($side * 90)
|
||||||
insert_lug(insert, wall, counter_bore);
|
insert_lug(insert, wall, counter_bore);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
module psu_shroud_assembly(type, cable_d, name, cables = 1) //! The printed parts with inserts fitted
|
module psu_shroud_assembly(type, cable_d, name, cables = 1) //! The printed parts with inserts fitted
|
||||||
assembly(str("PSU_shroud_", name), ngb = true) {
|
assembly(str("PSU_shroud_", name), ngb = true) {
|
||||||
|
@ -47,7 +47,6 @@ module ribbon_clamp_holes(ways, h = 20, screw = screw) //! Drill screw holes
|
|||||||
|
|
||||||
module ribbon_clamp(ways, screw = screw) { //! Generate STL for given number of ways
|
module ribbon_clamp(ways, screw = screw) { //! Generate STL for given number of ways
|
||||||
screw_d = screw_radius(screw) * 2;
|
screw_d = screw_radius(screw) * 2;
|
||||||
stl(str("ribbon_clamp_", ways, screw_d != 3 ? str("_", screw_d) : ""));
|
|
||||||
|
|
||||||
pitch = ribbon_clamp_hole_pitch(ways, screw);
|
pitch = ribbon_clamp_hole_pitch(ways, screw);
|
||||||
d = ribbon_clamp_width(screw);
|
d = ribbon_clamp_width(screw);
|
||||||
@ -55,30 +54,31 @@ module ribbon_clamp(ways, screw = screw) { //! Generate STL for given number of
|
|||||||
t = round_to_layer(ribbon_clamp_slot_depth() + wall);
|
t = round_to_layer(ribbon_clamp_slot_depth() + wall);
|
||||||
insert = screw_insert(screw);
|
insert = screw_insert(screw);
|
||||||
|
|
||||||
difference() {
|
stl(str("ribbon_clamp_", ways, screw_d != 3 ? str("_", screw_d) : ""))
|
||||||
union() {
|
difference() {
|
||||||
hull() {
|
union() {
|
||||||
translate_z(h - t / 2)
|
hull() {
|
||||||
cube([ribbon_clamp_hole_pitch(ways, screw), d, t], center = true);
|
translate_z(h - t / 2)
|
||||||
|
cube([ribbon_clamp_hole_pitch(ways, screw), d, t], center = true);
|
||||||
|
|
||||||
translate_z(1)
|
translate_z(1)
|
||||||
cube([pitch, max(wall, d - 2 * (h - t)), 2], center = true);
|
cube([pitch, max(wall, d - 2 * (h - t)), 2], center = true);
|
||||||
|
}
|
||||||
|
ribbon_clamp_hole_positions(ways, screw, -1)
|
||||||
|
cylinder(d = d, h = h);
|
||||||
|
|
||||||
|
ribbon_clamp_hole_positions(ways, screw, 1)
|
||||||
|
cylinder(d = d, h = h);
|
||||||
}
|
}
|
||||||
ribbon_clamp_hole_positions(ways, screw, -1)
|
|
||||||
cylinder(d = d, h = h);
|
|
||||||
|
|
||||||
ribbon_clamp_hole_positions(ways, screw, 1)
|
|
||||||
cylinder(d = d, h = h);
|
|
||||||
}
|
|
||||||
|
|
||||||
translate_z(h)
|
|
||||||
cube([ribbon_clamp_slot(ways), d + 1, ribbon_clamp_slot_depth() * 2], center = true);
|
|
||||||
|
|
||||||
ribbon_clamp_hole_positions(ways, screw)
|
|
||||||
translate_z(h)
|
translate_z(h)
|
||||||
rotate(22.5)
|
cube([ribbon_clamp_slot(ways), d + 1, ribbon_clamp_slot_depth() * 2], center = true);
|
||||||
insert_hole(insert, ribbon_clamp_screw_depth(screw) - insert_length(insert));
|
|
||||||
}
|
ribbon_clamp_hole_positions(ways, screw)
|
||||||
|
translate_z(h)
|
||||||
|
rotate(22.5)
|
||||||
|
insert_hole(insert, ribbon_clamp_screw_depth(screw) - insert_length(insert));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module ribbon_clamp_assembly(ways, screw = screw) pose([55, 180, 25]) //! Printed part with inserts in place
|
module ribbon_clamp_assembly(ways, screw = screw) pose([55, 180, 25]) //! Printed part with inserts in place
|
||||||
|
@ -34,27 +34,26 @@ knob_height = knob_stem_h + knob_thickness;
|
|||||||
function knob_height() = knob_height;
|
function knob_height() = knob_height;
|
||||||
|
|
||||||
module screw_knob(screw) { //! Generate the STL for a knob to fit the specified hex screw
|
module screw_knob(screw) { //! Generate the STL for a knob to fit the specified hex screw
|
||||||
stl(str("screw_knob_M", screw_radius(screw) * 20));
|
|
||||||
|
|
||||||
knob_stem_r = nut_trap_radius(screw_nut(screw)) + knob_wall;
|
knob_stem_r = nut_trap_radius(screw_nut(screw)) + knob_wall;
|
||||||
|
|
||||||
function wave(a) = knob_r + sin(a * knob_waves) * knob_wave;
|
function wave(a) = knob_r + sin(a * knob_waves) * knob_wave;
|
||||||
|
|
||||||
union() {
|
stl(str("screw_knob_M", screw_radius(screw) * 20))
|
||||||
render() difference() {
|
union() {
|
||||||
cylinder(r = knob_stem_r, h = knob_thickness + knob_stem_h);
|
render() difference() {
|
||||||
|
cylinder(r = knob_stem_r, h = knob_thickness + knob_stem_h);
|
||||||
|
|
||||||
hanging_hole(knob_nut_trap_depth(screw), screw_clearance_radius(screw))
|
hanging_hole(knob_nut_trap_depth(screw), screw_clearance_radius(screw))
|
||||||
rotate(45)
|
rotate(45)
|
||||||
circle(r = nut_trap_radius(screw_nut(screw)), $fn = 6);
|
circle(r = nut_trap_radius(screw_nut(screw)), $fn = 6);
|
||||||
}
|
|
||||||
linear_extrude(knob_thickness, convexity = 3)
|
|
||||||
difference() {
|
|
||||||
polygon(points = [for(a = [0 : 359]) [wave(a) * sin(a), wave(a) * cos(a)]]);
|
|
||||||
|
|
||||||
circle(knob_stem_r - eps);
|
|
||||||
}
|
}
|
||||||
}
|
linear_extrude(knob_thickness, convexity = 3)
|
||||||
|
difference() {
|
||||||
|
polygon(points = [for(a = [0 : 359]) [wave(a) * sin(a), wave(a) * cos(a)]]);
|
||||||
|
|
||||||
|
circle(knob_stem_r - eps);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Place the screw through the printed part
|
//! Place the screw through the printed part
|
||||||
|
@ -41,7 +41,6 @@ height = base_thickness + box_height;
|
|||||||
function socket_box_depth() = height; //! Outside depth of the backbox
|
function socket_box_depth() = height; //! Outside depth of the backbox
|
||||||
|
|
||||||
module socket_box(type) { //! Generate STL of the backbox for the specified socket
|
module socket_box(type) { //! Generate STL of the backbox for the specified socket
|
||||||
stl(str("socket_box_",type[0]));
|
|
||||||
|
|
||||||
screw = mains_socket_screw(type);
|
screw = mains_socket_screw(type);
|
||||||
screw_clearance_radius = screw_clearance_radius(screw);
|
screw_clearance_radius = screw_clearance_radius(screw);
|
||||||
@ -51,37 +50,38 @@ module socket_box(type) { //! Generate STL of the backbox for the specified sock
|
|||||||
insert_boss = mains_socket_insert_boss(type);
|
insert_boss = mains_socket_insert_boss(type);
|
||||||
insert_hole_radius = insert_hole_radius(insert);
|
insert_hole_radius = insert_hole_radius(insert);
|
||||||
|
|
||||||
difference() {
|
stl(str("socket_box_",type[0]))
|
||||||
linear_extrude(height, convexity = 5)
|
|
||||||
face_plate(type);
|
|
||||||
|
|
||||||
difference() {
|
difference() {
|
||||||
translate_z(base_thickness)
|
linear_extrude(height, convexity = 5)
|
||||||
linear_extrude(height, convexity = 5)
|
face_plate(type);
|
||||||
offset(-wall) offset(1) face_plate(type);
|
|
||||||
|
|
||||||
for(side = [-1, 1])
|
difference() {
|
||||||
hull()
|
translate_z(base_thickness)
|
||||||
for(x = [1, 2])
|
linear_extrude(height, convexity = 5)
|
||||||
translate([side * mains_socket_pitch(type) / x, 0])
|
offset(-wall) offset(1) face_plate(type);
|
||||||
cylinder(d = insert_boss, h = 100);
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// Socket holes
|
|
||||||
//
|
|
||||||
translate_z(height)
|
|
||||||
mains_socket_hole_positions(type) {
|
|
||||||
poly_cylinder(r = screw_clearance_radius, h = 2 * box_height, center = true);
|
|
||||||
|
|
||||||
poly_cylinder(r = insert_hole_radius, h = 2 * insert_length, center = true);
|
for(side = [-1, 1])
|
||||||
|
hull()
|
||||||
|
for(x = [1, 2])
|
||||||
|
translate([side * mains_socket_pitch(type) / x, 0])
|
||||||
|
cylinder(d = insert_boss, h = 100);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Cable hole
|
// Socket holes
|
||||||
//
|
//
|
||||||
translate([cable_x, cable_y(type), cable_z])
|
translate_z(height)
|
||||||
rotate([90, 0, 0])
|
mains_socket_hole_positions(type) {
|
||||||
teardrop_plus(r = cable_d / 2, h = 30);
|
poly_cylinder(r = screw_clearance_radius, h = 2 * box_height, center = true);
|
||||||
}
|
|
||||||
|
poly_cylinder(r = insert_hole_radius, h = 2 * insert_length, center = true);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// Cable hole
|
||||||
|
//
|
||||||
|
translate([cable_x, cable_y(type), cable_z])
|
||||||
|
rotate([90, 0, 0])
|
||||||
|
teardrop_plus(r = cable_d / 2, h = 30);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module socket_box_MKLOGIC_stl() socket_box(MKLOGIC);
|
module socket_box_MKLOGIC_stl() socket_box(MKLOGIC);
|
||||||
|
@ -61,49 +61,50 @@ module ssr_shroud_holes(type, cable_d) { //! Drill the screw and ziptie holes
|
|||||||
}
|
}
|
||||||
|
|
||||||
module ssr_shroud(type, cable_d, name) { //! Generate the STL file for a specified ssr and cable
|
module ssr_shroud(type, cable_d, name) { //! Generate the STL file for a specified ssr and cable
|
||||||
stl(str("ssr_shroud_", name));
|
|
||||||
|
|
||||||
width = ssr_shroud_width(type);
|
width = ssr_shroud_width(type);
|
||||||
depth = ssr_length(type) / 3 + ssr_shroud_extent(type, cable_d);
|
depth = ssr_length(type) / 3 + ssr_shroud_extent(type, cable_d);
|
||||||
height = ssr_shroud_height(type);
|
height = ssr_shroud_height(type);
|
||||||
cable_x = ssr_shroud_cable_x(type, cable_d);
|
cable_x = ssr_shroud_cable_x(type, cable_d);
|
||||||
center_x = -ssr_length(type) / 6 - depth / 2;
|
center_x = -ssr_length(type) / 6 - depth / 2;
|
||||||
|
|
||||||
// base and sides
|
|
||||||
translate([center_x, 0]) {
|
|
||||||
rounded_rectangle([depth - eps, width - eps, top], rad, center = false);
|
|
||||||
|
|
||||||
linear_extrude(height) difference() {
|
stl(str("ssr_shroud_", name)) {
|
||||||
round(or = wall / 2 - eps, ir = 0) difference() {
|
// base and sides
|
||||||
rounded_square([depth, width], rad);
|
translate([center_x, 0]) {
|
||||||
|
rounded_rectangle([depth - eps, width - eps, top], rad, center = false);
|
||||||
|
|
||||||
rounded_square([depth - 2 * wall, width - 2 * wall], rad - wall);
|
linear_extrude(height) difference() {
|
||||||
|
round(or = wall / 2 - eps, ir = 0) difference() {
|
||||||
|
rounded_square([depth, width], rad);
|
||||||
|
|
||||||
translate([depth / 2, 0])
|
rounded_square([depth - 2 * wall, width - 2 * wall], rad - wall);
|
||||||
square([2 * rad, width], center = true);
|
|
||||||
|
|
||||||
|
translate([depth / 2, 0])
|
||||||
|
square([2 * rad, width], center = true);
|
||||||
|
|
||||||
|
}
|
||||||
|
translate([cable_x - center_x, 0])
|
||||||
|
square([cable_d, width + 1], center = true);
|
||||||
}
|
}
|
||||||
translate([cable_x - center_x, 0])
|
|
||||||
square([cable_d, width + 1], center = true);
|
|
||||||
}
|
}
|
||||||
}
|
// cable slots
|
||||||
// cable slots
|
for(side = [-1, 1])
|
||||||
for(side = [-1, 1])
|
translate([cable_x, side * (width / 2 - wall / 2), height / 2])
|
||||||
translate([cable_x, side * (width / 2 - wall / 2), height / 2])
|
rotate([90, 0, 0])
|
||||||
rotate([90, 0, 0])
|
linear_extrude(wall, center = true)
|
||||||
linear_extrude(wall, center = true)
|
difference() {
|
||||||
difference() {
|
square([cable_d + eps, height], center = true);
|
||||||
square([cable_d + eps, height], center = true);
|
|
||||||
|
|
||||||
translate([0, height / 2])
|
translate([0, height / 2])
|
||||||
vertical_tearslot(h = 0, r = cable_d / 2, l = cable_d);
|
vertical_tearslot(h = 0, r = cable_d / 2, l = cable_d);
|
||||||
}
|
}
|
||||||
// insert boss
|
// insert boss
|
||||||
ssr_shroud_hole_positions(type)
|
ssr_shroud_hole_positions(type)
|
||||||
vflip()
|
vflip()
|
||||||
translate_z(height)
|
translate_z(height)
|
||||||
rotate($side * 90)
|
rotate($side * 90)
|
||||||
insert_lug(insert, wall, counter_bore);
|
insert_lug(insert, wall, counter_bore);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module ssr_shroud_assembly(type, cable_d, name) //! The printed parts with inserts fitted
|
module ssr_shroud_assembly(type, cable_d, name) //! The printed parts with inserts fitted
|
||||||
|
@ -75,32 +75,29 @@ module strap_holes(length, type = strap, h = 100) //! The panel cut outs
|
|||||||
strap_boss_shape(type);
|
strap_boss_shape(type);
|
||||||
|
|
||||||
module strap(length, type = strap) { //! Generate the STL for the rubber strap
|
module strap(length, type = strap) { //! Generate the STL for the rubber strap
|
||||||
stl("strap");
|
|
||||||
|
|
||||||
len = length - 2 * (wall + clearance);
|
len = length - 2 * (wall + clearance);
|
||||||
w = strap_width(type);
|
w = strap_width(type);
|
||||||
|
|
||||||
linear_extrude(strap_thickness(type), convexity = 3)
|
stl("strap")
|
||||||
difference() {
|
linear_extrude(strap_thickness(type), convexity = 3)
|
||||||
rounded_square([len, w], w / 2 - eps);
|
difference() {
|
||||||
|
rounded_square([len, w], w / 2 - eps);
|
||||||
|
|
||||||
for(end = [-1, 1])
|
for(end = [-1, 1])
|
||||||
translate([end * (len / 2 - strap_min_width(type) - strap_boss_r(type) - clearance), 0])
|
translate([end * (len / 2 - strap_min_width(type) - strap_boss_r(type) - clearance), 0])
|
||||||
rotate(end * 90 + 90)
|
rotate(end * 90 + 90)
|
||||||
hull() {
|
hull() {
|
||||||
offset(clearance)
|
|
||||||
strap_boss_shape(type);
|
|
||||||
|
|
||||||
translate([strap_extension(type) / 2, 0])
|
|
||||||
offset(clearance)
|
offset(clearance)
|
||||||
strap_boss_shape(type);
|
strap_boss_shape(type);
|
||||||
}
|
|
||||||
}
|
translate([strap_extension(type) / 2, 0])
|
||||||
|
offset(clearance)
|
||||||
|
strap_boss_shape(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module strap_end(type = strap) { //! Generate the STL for end piece
|
module strap_end(type = strap) { //! Generate the STL for end piece
|
||||||
stl("strap_end");
|
|
||||||
|
|
||||||
z1 = strap_height(type) - strap_thickness(type) - clearance;
|
z1 = strap_height(type) - strap_thickness(type) - clearance;
|
||||||
z2 = strap_height(type) + strap_key(type);
|
z2 = strap_height(type) + strap_key(type);
|
||||||
r1 = strap_boss_r(type) - 1;
|
r1 = strap_boss_r(type) - 1;
|
||||||
@ -121,42 +118,43 @@ module strap_end(type = strap) { //! Generate the STL for end piece
|
|||||||
circle(r1);
|
circle(r1);
|
||||||
}
|
}
|
||||||
|
|
||||||
union() {
|
stl("strap_end")
|
||||||
linear_extrude(z1)
|
union() {
|
||||||
with_hole()
|
linear_extrude(z1)
|
||||||
outer();
|
with_hole()
|
||||||
|
|
||||||
translate_z(z1)
|
|
||||||
linear_extrude(strap_height(type) - z1)
|
|
||||||
difference() {
|
|
||||||
outer();
|
outer();
|
||||||
|
|
||||||
hull() {
|
translate_z(z1)
|
||||||
translate([0, -strap_width(type) / 2 - clearance])
|
linear_extrude(strap_height(type) - z1)
|
||||||
square([strap_boss_r(type) + overlap, strap_width(type) + 2 * clearance]);
|
difference() {
|
||||||
|
outer();
|
||||||
|
|
||||||
translate([-strap_extension(type) / 2, 0])
|
hull() {
|
||||||
circle(d = strap_width(type) + 2 * clearance);
|
translate([0, -strap_width(type) / 2 - clearance])
|
||||||
|
square([strap_boss_r(type) + overlap, strap_width(type) + 2 * clearance]);
|
||||||
|
|
||||||
|
translate([-strap_extension(type) / 2, 0])
|
||||||
|
circle(d = strap_width(type) + 2 * clearance);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
linear_extrude(strap_height(type) - layer_height)
|
linear_extrude(strap_height(type) - layer_height)
|
||||||
with_hole()
|
with_hole()
|
||||||
strap_boss_shape(type);
|
strap_boss_shape(type);
|
||||||
|
|
||||||
linear_extrude(z2)
|
linear_extrude(z2)
|
||||||
with_hole()
|
with_hole()
|
||||||
offset(cnc_bit_r)
|
offset(cnc_bit_r)
|
||||||
offset(-step - cnc_bit_r)
|
offset(-step - cnc_bit_r)
|
||||||
strap_boss_shape(type);
|
strap_boss_shape(type);
|
||||||
|
|
||||||
render() difference() {
|
render() difference() {
|
||||||
cylinder(r = r1 + eps, h = z2);
|
cylinder(r = r1 + eps, h = z2);
|
||||||
|
|
||||||
translate_z(z2)
|
translate_z(z2)
|
||||||
insert_hole(strap_insert(type), counterbore);
|
insert_hole(strap_insert(type), counterbore);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
//! * Place the insert into the hole and push home with a soldering iron with a tapered bit heated to 200°C.
|
//! * Place the insert into the hole and push home with a soldering iron with a tapered bit heated to 200°C.
|
||||||
|
Loading…
Reference in New Issue
Block a user