mirror of
https://github.com/nophead/Mendel90.git
synced 2025-09-01 09:03:00 +02:00
New light and camera scheme.
Removed some assigns and child for new OpenScad. Now renders the sheets for more responsive preview.
This commit is contained in:
@@ -78,6 +78,7 @@ include <../vitamins/bars.scad>
|
||||
include <../vitamins/pullies.scad>
|
||||
include <../vitamins/extruders.scad>
|
||||
include <../vitamins/light_strips.scad>
|
||||
include <../vitamins/raspberry_pi.scad>
|
||||
|
||||
module rod(d , l) {
|
||||
vitamin(str("RD", d, round(l), ": Smooth rod ", d, "mm x ", round(l), "mm"));
|
||||
|
@@ -13,10 +13,13 @@ wall = 2;
|
||||
width = 8;
|
||||
hinge = 5;
|
||||
rim = 1.2;
|
||||
function frame_edge_clamp_pitch(length) = length - 2 * nut_flat_radius(M3_nut) - 2 * wall;
|
||||
min_length = 2 * nut_flat_radius(M3_nut) + 2 * wall;
|
||||
function frame_edge_clamp_pitch(length) = length - min_length;
|
||||
|
||||
clamp_back_thickness = 2;
|
||||
clamp_thickness = 2 + M3_nut_trap_depth;
|
||||
nut_trap_depth = screw_head_height(M3_hex_screw);
|
||||
|
||||
clamp_thickness = 2 + nut_trap_depth;
|
||||
clearance = 0.2;
|
||||
|
||||
screw_d = 3;
|
||||
@@ -28,88 +31,93 @@ pivot_h = 1.2;
|
||||
|
||||
function frame_edge_clamp_width() = total_width;
|
||||
function frame_edge_clamp_thickness() = clamp_thickness;
|
||||
|
||||
function frame_edge_clamp_hinge() = total_width - width;
|
||||
|
||||
module frame_edge_clamp_front_stl(length = 20) {
|
||||
|
||||
l = length ? length : min_length;
|
||||
w = total_width;
|
||||
|
||||
difference() {
|
||||
union() {
|
||||
translate([0, 0, clamp_thickness / 2])
|
||||
cube([length, w, clamp_thickness], center = true);
|
||||
translate([-l / 2, -frame_edge_clamp_hinge(), 0])
|
||||
cube([l, w, clamp_thickness]);
|
||||
|
||||
if($children)
|
||||
child();
|
||||
children();
|
||||
}
|
||||
|
||||
for(side = [-1, 1])
|
||||
translate([side * frame_edge_clamp_pitch(length) / 2, w / 2 - width - screw_d / 2, clamp_thickness])
|
||||
translate([side * frame_edge_clamp_pitch(l) / 2, -screw_d / 2, clamp_thickness])
|
||||
rotate([0, 0, 90])
|
||||
nut_trap(M3_clearance_radius, nut_radius(M3_nut), M3_nut_trap_depth);
|
||||
nut_trap(M3_clearance_radius, nut_radius(M3_nut), nut_trap_depth);
|
||||
|
||||
translate([0, - w / 2 + hinge / 2, 0])
|
||||
cube([pivot_l(length) + 2 * clearance, pivot_w + 2 * clearance, pivot_h * 2], center = true);
|
||||
translate([0, -frame_edge_clamp_hinge() + hinge / 2, 0])
|
||||
cube([pivot_l(l) + 2 * clearance, pivot_w + 2 * clearance, pivot_h * 2], center = true);
|
||||
}
|
||||
}
|
||||
|
||||
module frame_edge_clamp_back_stl(length = 20, gap = sheet_thickness(frame)) {
|
||||
l = length;
|
||||
l = length ? length : min_length;
|
||||
w = total_width;
|
||||
|
||||
union() {
|
||||
difference() {
|
||||
translate([-l / 2, -w / 2, 0])
|
||||
translate([-l / 2, -frame_edge_clamp_hinge(), 0])
|
||||
cube([l, w, clamp_back_thickness + gap - layer_height]);
|
||||
|
||||
translate([-l / 2 + wall, -w / 2 + hinge, clamp_back_thickness])
|
||||
translate([-l / 2 + wall, -frame_edge_clamp_hinge() + hinge, clamp_back_thickness])
|
||||
cube([l - 2 * wall, w, clamp_back_thickness + gap - layer_height]);
|
||||
|
||||
translate([-l, w / 2 - width, clamp_back_thickness])
|
||||
translate([-l, 0, clamp_back_thickness])
|
||||
cube([2 * l, w, clamp_back_thickness + gap - layer_height]);
|
||||
|
||||
for(side = [-1, 1])
|
||||
translate([side * frame_edge_clamp_pitch(l) / 2, w / 2 - width - screw_d / 2, clamp_thickness])
|
||||
translate([side * frame_edge_clamp_pitch(l) / 2, -screw_d / 2, clamp_thickness])
|
||||
rotate([0, 0, 90])
|
||||
poly_cylinder(M3_clearance_radius, h = 100, center = true);
|
||||
}
|
||||
|
||||
translate([0, - w / 2 + hinge / 2, clamp_back_thickness + gap])
|
||||
translate([0, -frame_edge_clamp_hinge() + hinge / 2, clamp_back_thickness + gap])
|
||||
cube([pivot_l(l), pivot_w, pivot_h * 2], center = true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module frame_edge_clamp_assembly(length = 20, gap = sheet_thickness(frame), left = true) {
|
||||
kids = $children;
|
||||
|
||||
module frame_edge_clamp_assembly(length = 20, gap = sheet_thickness(frame), hex_head = true, kids = false) {
|
||||
l = length ? length : min_length;
|
||||
screw_length = screw_longer_than(washer_thickness(M3_washer)
|
||||
+ clamp_back_thickness
|
||||
+ gap
|
||||
+ clamp_thickness
|
||||
- M3_nut_trap_depth
|
||||
- nut_trap_depth
|
||||
+ nut_thickness(M3_nut, true));
|
||||
|
||||
color(left ? "lime" : "red") render() {
|
||||
frame_edge_clamp_front_stl(length = length)
|
||||
if(kids)
|
||||
child();
|
||||
}
|
||||
|
||||
translate([0, 0, -gap - clamp_back_thickness])
|
||||
color(left ? "red" : "lime") render() frame_edge_clamp_back_stl(length, gap);
|
||||
color("lime") render() frame_edge_clamp_back_stl(l, gap);
|
||||
|
||||
for(side = [-1, 1])
|
||||
translate([side * frame_edge_clamp_pitch(length) / 2, total_width / 2 - width - screw_d / 2, -gap - clamp_back_thickness])
|
||||
translate([side * frame_edge_clamp_pitch(l) / 2, -screw_d / 2, -gap - clamp_back_thickness])
|
||||
rotate([0, 0, 90]) {
|
||||
rotate([180, 0, 0])
|
||||
screw_and_washer(M3_cap_screw, max(screw_length, 16));
|
||||
if(hex_head)
|
||||
nut_and_washer(M3_nut, true);
|
||||
else
|
||||
screw_and_washer(M3_cap_screw, screw_length);
|
||||
|
||||
translate([0, 0, clamp_thickness + gap + clamp_back_thickness - M3_nut_trap_depth])
|
||||
nut(M3_nut, true);
|
||||
translate([0, 0, clamp_thickness + gap + clamp_back_thickness - nut_trap_depth])
|
||||
if(hex_head)
|
||||
screw(M3_hex_screw, screw_length);
|
||||
else
|
||||
nut(M3_nut, true);
|
||||
}
|
||||
|
||||
|
||||
color("red") render() {
|
||||
frame_edge_clamp_front_stl(length = l)
|
||||
if(kids)
|
||||
children();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module frame_edge_clamp_stl() {
|
||||
|
@@ -5,29 +5,41 @@
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// Bracket to mount RPI
|
||||
// Bracket to mount an LED light strip behind the gantry
|
||||
//
|
||||
include <conf/config.scad>
|
||||
use <spool_holder.scad>
|
||||
use <fixing-block.scad>
|
||||
use <light_strip_clip.scad>
|
||||
include <positions.scad>
|
||||
|
||||
light = light_strip ? light_strip : SPS125;
|
||||
wall = 2;
|
||||
|
||||
light = light_strip ? light_strip : RIGID5050_290;
|
||||
|
||||
use_screws = light_strip_has_holes(light);
|
||||
use_clips = !use_screws;
|
||||
z_offset = use_clips ? wall : 0;
|
||||
y_offset = use_clips ? light_strip_clip_length(light) / 2 : light_strip_width(light) / 2;
|
||||
|
||||
x = (left_stay_x + right_stay_x) / 2;
|
||||
y = gantry_Y + sheet_thickness(frame) + spool_holder_gap();
|
||||
z = height - gantry_thickness + light_strip_set_back(light);
|
||||
|
||||
angle = atan2(Y0 - y, z - bed_height);
|
||||
bracket_z = z + light_strip_thickness(light) + z_offset;
|
||||
|
||||
hypot = sqrt(sqr(bracket_z - bed_height) + sqr(Y0 - y));
|
||||
angle = atan2(Y0 - y, bracket_z - bed_height) + asin(y_offset / hypot);
|
||||
|
||||
clearance = 0.5;
|
||||
boss_r = nut_radius(M3_nut) + 2;
|
||||
nut_trap_meat = 2;
|
||||
|
||||
bracket_thickness = 3;
|
||||
bracket_width = spool_holder_gap() - clearance;
|
||||
bracket_length = (right_stay_x - left_stay_x - sheet_thickness(frame) - light_strip_hole_pitch(light)) / 2 + boss_r;
|
||||
bracket_height = height - z - light_strip_thickness(light);
|
||||
bracket_thickness = use_screws ? nut_trap_meat + nut_thickness(M3_nut, true) : 3;
|
||||
bracket_width = min(spool_holder_gap() - clearance, light_strip_clip_length(light) * cos(angle));
|
||||
bracket_length = use_screws ? (right_stay_x - left_stay_x - sheet_thickness(frame) - light_strip_hole_pitch(light)) / 2 + boss_r
|
||||
: (right_stay_x - left_stay_x - sheet_thickness(frame) - light_strip_length(light)) / 2 + light_strip_clip_depth(light);
|
||||
bracket_height = height - z - light_strip_thickness(light) - (use_clips ? wall : 0);
|
||||
bracket_stem = bracket_width - fixing_block_height();
|
||||
|
||||
stem_thickness = 3;
|
||||
@@ -60,19 +72,10 @@ module light_strip_bracket() {
|
||||
cube([stem_thickness, bracket_height, bracket_stem]);
|
||||
|
||||
translate([stem_thickness, bracket_thickness, 0])
|
||||
right_triangle(width = bracket_length - bracket_thickness, height = bracket_width, h = bracket_thickness, center = false);
|
||||
right_triangle(width = bracket_length - stem_thickness, height = bracket_width, h = stem_thickness, center = false);
|
||||
|
||||
translate([-sheet_thickness(frame) - hook + hook_w / 2, bracket_height - hook_overlap + hook_h / 2, 0])
|
||||
rounded_rectangle([hook_w, hook_h, bracket_stem], center = false, r = hook_r);
|
||||
|
||||
hull() {
|
||||
rotate([angle, 0, 0])
|
||||
translate([bracket_length - boss_r, 0, light_strip_width(light) / 2])
|
||||
rotate([-90, 0, 0])
|
||||
cylinder(r = boss_r - eta, h = nut_trap_meat + nut_thickness(M3_nut, true));
|
||||
translate([bracket_length - 2 * boss_r, bracket_thickness, 0])
|
||||
cube([2 * (boss_r - eta), nut_trap_meat + nut_thickness(M3_nut, true) - bracket_thickness, 1]);
|
||||
}
|
||||
}
|
||||
translate([-slot, bracket_height - bracket_thickness - hook_overlap, -1])
|
||||
cube([slot, bracket_thickness + hook_overlap, bracket_stem + 2]);
|
||||
@@ -81,11 +84,13 @@ module light_strip_bracket() {
|
||||
translate([0, -5, 0])
|
||||
cube([100, 10, 100], center = true);
|
||||
|
||||
translate([bracket_length - boss_r, nut_trap_meat + M3_nut_trap_depth, light_strip_width(light) / 2])
|
||||
rotate([90, 0, 0])
|
||||
nut_trap(M3_clearance_radius, M3_nut_radius, M3_nut_trap_depth, horizontal = true);
|
||||
if(use_screws)
|
||||
translate([bracket_length - boss_r, nut_trap_meat + M3_nut_trap_depth,
|
||||
light_strip_width(light) / 2 + light_strip_hole_pitch2(light) / 2])
|
||||
rotate([90, 0, 0])
|
||||
nut_trap(M3_clearance_radius, M3_nut_radius, M3_nut_trap_depth, horizontal = true);
|
||||
|
||||
translate([stem_thickness + wire_hole_r + layer_height, nut_trap_meat + M3_nut_trap_depth, light_strip_width(light) / 2])
|
||||
translate([stem_thickness + wire_hole_r + layer_height, bracket_thickness + 1, light_strip_width(light) / 2])
|
||||
rotate([90, 0, 0])
|
||||
teardrop_plus(r = wire_hole_r, h = 100);
|
||||
}
|
||||
@@ -106,39 +111,59 @@ module light_strip_brackets_stl() {
|
||||
light_strip_bracket_left_stl();
|
||||
translate([-2 - 2 * (hook + sheet_thickness(frame)), 0, 0])
|
||||
light_strip_bracket_right_stl();
|
||||
|
||||
if(use_clips)
|
||||
for(i = [0,1])
|
||||
translate([-2, (i + 0.5) * (light_strip_clip_length(light) + 2), 0])
|
||||
rotate([0, 0, 90])
|
||||
light_strip_clip(light);
|
||||
}
|
||||
|
||||
module light_strip_assembly() {
|
||||
assembly("light_strip_assembly");
|
||||
translate([x, y, z + light_strip_thickness(light)])
|
||||
rotate([angle, 0, 0])
|
||||
translate([0, -light_strip_width(light) / 2, - light_strip_thickness(light)])
|
||||
light_strip(light);
|
||||
translate([x, y, bracket_z])
|
||||
rotate([angle, 0, 0]) {
|
||||
translate([0, -y_offset, -z_offset])
|
||||
rotate([180, 0, 0])
|
||||
light_strip(light);
|
||||
|
||||
translate([left_stay_x + sheet_thickness(frame) / 2, y, z + light_strip_thickness(light)])
|
||||
if(use_clips)
|
||||
for(side = [-1, 1])
|
||||
translate([side * (light_strip_length(light) / 2), -y_offset, 0])
|
||||
rotate([-90, 0, side * 90])
|
||||
color(side < 0 ? "red": "lime") render() light_strip_clip(light);
|
||||
}
|
||||
|
||||
translate([left_stay_x + sheet_thickness(frame) / 2, y, bracket_z])
|
||||
rotate([90, 0, 0])
|
||||
color("lime") render() light_strip_bracket_left_stl();
|
||||
|
||||
translate([right_stay_x - sheet_thickness(frame) / 2, y, z + light_strip_thickness(light)])
|
||||
translate([right_stay_x - sheet_thickness(frame) / 2, y, bracket_z])
|
||||
rotate([90, 0, 0])
|
||||
color("red") render() light_strip_bracket_right_stl();
|
||||
|
||||
for(side = [-1,1])
|
||||
translate([x + side * light_strip_hole_pitch(light) / 2, y, z + light_strip_thickness(light)])
|
||||
if(use_screws)
|
||||
translate([x, y, bracket_z])
|
||||
rotate([angle - 180, 0, 0])
|
||||
translate([0, light_strip_width(light) / 2, light_strip_thickness(light)]) {
|
||||
screw_and_washer(M3_cap_screw, 10);
|
||||
translate([0, 0, -nut_trap_meat - light_strip_thickness(light)])
|
||||
rotate([180, 0, 0])
|
||||
nut(M3_nut, true);
|
||||
}
|
||||
translate([0, light_strip_width(light) / 2, light_strip_thickness(light)])
|
||||
light_strip_hole_positions(light) group() {
|
||||
screw_and_washer(M3_cap_screw, 10);
|
||||
|
||||
*hull() { // light ray, should point at center of Y axis.
|
||||
translate([x, y -light_strip_width(light) / 2, z])
|
||||
sphere();
|
||||
translate([x, Y0, bed_height])
|
||||
sphere();
|
||||
}
|
||||
translate([0, 0, -light_strip_thickness(light) - nut_trap_meat])
|
||||
rotate([180, 0, 0])
|
||||
nut(M3_nut, true);
|
||||
}
|
||||
|
||||
if(show_rays)
|
||||
%hull() { // light ray, should point at center of Y axis.
|
||||
translate([x, y, bracket_z])
|
||||
rotate([angle, 0, 0])
|
||||
translate([0, -y_offset, z - bracket_z])
|
||||
sphere();
|
||||
|
||||
translate([x, Y0, bed_height])
|
||||
sphere();
|
||||
}
|
||||
end("light_strip_assembly");
|
||||
}
|
||||
|
||||
@@ -146,7 +171,7 @@ module light_strip_assembly() {
|
||||
if(1)
|
||||
light_strip_assembly();
|
||||
else
|
||||
if(1)
|
||||
if(0)
|
||||
light_strip_bracket();
|
||||
else
|
||||
light_strip_brackets_stl();
|
||||
|
33
scad/light_strip_clip.scad
Normal file
33
scad/light_strip_clip.scad
Normal file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// Mendel90
|
||||
//
|
||||
// GNU GPL v2
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// Clip to fit around light strip profile
|
||||
//
|
||||
include <conf/config.scad>
|
||||
|
||||
wall = 2;
|
||||
function light_strip_clip_depth(light) = 10;
|
||||
function light_strip_clip_length(light) = light_strip_slot(light) + 2 * wall;
|
||||
function light_strip_clip_width(light) = 2 + light_strip_thickness(light) + wall;
|
||||
function light_strip_slot(light) = light_strip_width(light) + 0.2;
|
||||
function light_strip_clip_gap(light) = light_strip_width(light) - 4;
|
||||
|
||||
module light_strip_clip(light) {
|
||||
linear_extrude(height = light_strip_clip_depth(light), convexity = 2)
|
||||
difference() {
|
||||
translate([-light_strip_clip_length(light) / 2, 0])
|
||||
square([light_strip_clip_length(light), light_strip_clip_width(light)]);
|
||||
|
||||
translate([-light_strip_slot(light) / 2, wall])
|
||||
square([light_strip_slot(light), light_strip_thickness(light)]);
|
||||
|
||||
translate([-light_strip_clip_gap(light) / 2, wall])
|
||||
square([light_strip_clip_gap(light),100]);
|
||||
}
|
||||
}
|
||||
|
||||
light_strip_clip(RIGID5050_290);
|
@@ -247,7 +247,7 @@ module y_rail_holes() {
|
||||
|
||||
module y_carriage() {
|
||||
difference() {
|
||||
sheet(Y_carriage, Y_carriage_width, Y_carriage_depth, [3,3,3,3]);
|
||||
sheet(Y_carriage, Y_carriage_width, Y_carriage_depth, [Y_carriage_rad, Y_carriage_rad, Y_carriage_rad, Y_carriage_rad]);
|
||||
|
||||
translate([0, ribbon_clamp_y, 0])
|
||||
rotate([180, 0, 0])
|
||||
@@ -490,52 +490,56 @@ module fixing_blocks(holes = false) {
|
||||
h = fixing_block_height();
|
||||
t = sheet_thickness(frame);
|
||||
|
||||
assign($upper = true) { // all screws into frame
|
||||
{ // all screws into frame
|
||||
$upper = true;
|
||||
translate([left_stay_x + t / 2, gantry_Y + t, stay_height - base_clearance - h - w / 2]) // top
|
||||
rotate([0,-90,-90])
|
||||
child();
|
||||
children();
|
||||
|
||||
translate([right_stay_x - t / 2, gantry_Y + t, stay_height - base_clearance - h - w / 2]) // top
|
||||
rotate([0,90, 90])
|
||||
child();
|
||||
children();
|
||||
|
||||
translate([left_stay_x + t / 2, gantry_Y + t, base_clearance + h + w / 2]) // front
|
||||
rotate([0,-90,-90])
|
||||
child();
|
||||
children();
|
||||
|
||||
translate([right_stay_x - t / 2, gantry_Y + t, base_clearance + h + w / 2]) // front
|
||||
rotate([0,90, 90])
|
||||
child();
|
||||
children();
|
||||
}
|
||||
assign($upper = false) { // one screw in the base
|
||||
assign($rear = true) {
|
||||
{ // one screw in the base
|
||||
$upper = true;
|
||||
{
|
||||
$rear = true;
|
||||
translate([left_stay_x + t / 2, base_depth / 2 - base_clearance - w / 2, 0]) // back
|
||||
rotate([0, 0,-90])
|
||||
child();
|
||||
children();
|
||||
|
||||
translate([right_stay_x - t / 2, base_depth / 2 - base_clearance - w / 2, 0]) // back
|
||||
rotate([0, 0, 90])
|
||||
child();
|
||||
children();
|
||||
}
|
||||
|
||||
assign($rear = false) {
|
||||
{
|
||||
$rear = false;
|
||||
for(x = [-base_width/2 + base_clearance + w /2,
|
||||
base_width/2 - base_clearance - w /2,
|
||||
-base_width/2 - base_clearance - w /2 + left_w,
|
||||
right_stay_x + sheet_thickness(frame) / 2 + w / 2 + base_clearance])
|
||||
translate([x, gantry_Y + t, 0])
|
||||
child();
|
||||
children();
|
||||
|
||||
|
||||
// extra holes for bars
|
||||
if(holes && base_nuts) {
|
||||
translate([left_stay_x + t / 2, -base_depth / 2 + base_clearance + w / 2, 0]) // front
|
||||
rotate([0, 0,-90])
|
||||
child();
|
||||
children();
|
||||
|
||||
translate([right_stay_x - t / 2, -base_depth / 2 + base_clearance + w / 2, 0]) // front
|
||||
rotate([0,0, 90])
|
||||
child();
|
||||
children();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -702,12 +706,12 @@ module frame_gantry() {
|
||||
}
|
||||
}
|
||||
|
||||
module frame_stay(left, bodge = 0) {
|
||||
module frame_stay(left) {
|
||||
x = left ? left_stay_x : right_stay_x;
|
||||
|
||||
difference() {
|
||||
translate([x, gantry_Y + sheet_thickness(frame) + stay_depth / 2, stay_height / 2])
|
||||
rotate([90,0,90])
|
||||
rotate([90, 0, 90])
|
||||
sheet(frame, stay_depth, stay_height, [0, frame_corners, 0, 0]);
|
||||
|
||||
fixing_block_holes();
|
||||
@@ -717,7 +721,7 @@ module frame_stay(left, bodge = 0) {
|
||||
if(left)
|
||||
translate([x + (sheet_thickness(frame) + fan_depth(case_fan)) / 2, fan_y, fan_z])
|
||||
rotate([0,90,0])
|
||||
scale([1 + bodge, 1 + bodge, 1]) fan_holes(case_fan); // scale prevents OpenCSG z buffer artifacts
|
||||
fan_holes(case_fan);
|
||||
|
||||
else {
|
||||
//
|
||||
@@ -855,7 +859,8 @@ module frame_assembly(show_gantry = true) {
|
||||
|
||||
place_cable_clips();
|
||||
|
||||
frame_base();
|
||||
color(sheet_colour(base)) render() frame_base();
|
||||
|
||||
if(base_nuts) {
|
||||
for(side = [ left_stay_x + fixing_block_height() / 2 + sheet_thickness(frame) / 2,
|
||||
right_stay_x - fixing_block_height() / 2 - sheet_thickness(frame) / 2])
|
||||
@@ -869,9 +874,9 @@ module frame_assembly(show_gantry = true) {
|
||||
fixing_blocks()
|
||||
fixing_block_assembly($upper, $rear);
|
||||
|
||||
frame_stay(true, eta);
|
||||
frame_stay(false);
|
||||
frame_gantry();
|
||||
color(sheet_colour(frame)) render() frame_stay(true);
|
||||
color(sheet_colour(frame)) render() frame_stay(false);
|
||||
color(sheet_colour(frame)) render() frame_gantry();
|
||||
}
|
||||
|
||||
end("frame_assembly");
|
||||
@@ -890,7 +895,7 @@ module machine_assembly(show_bed = true, show_heatshield = true, show_spool = tr
|
||||
raspberry_pi_assembly();
|
||||
|
||||
if(raspberry_pi_camera)
|
||||
raspberry_pi_camera_assembly(light_strip);
|
||||
raspberry_pi_camera_assembly();
|
||||
|
||||
if(show_spool) {
|
||||
spool_assembly(left_stay_x, right_stay_x);
|
||||
|
@@ -11,23 +11,12 @@ include <conf/config.scad>
|
||||
use <pcb_spacer.scad>
|
||||
include <positions.scad>
|
||||
|
||||
pi_width = 56;
|
||||
pi_length = 85;
|
||||
pi_clearance = 0.25;
|
||||
pi_thickness = 1.6;
|
||||
|
||||
overlap = 1.5;
|
||||
|
||||
pi_base_width = pi_width + 2 * pi_clearance + 2 * min_wall;
|
||||
pi_base_length = pi_length+ 2 * pi_clearance + 2 * min_wall;
|
||||
rim_width = overlap + pi_clearance + min_wall;
|
||||
|
||||
module pi_holes()
|
||||
for(hole = [[25.5, 18], [pi_length-5, pi_width-12.5]])
|
||||
translate([pi_width / 2 - hole[1], hole[0] - pi_length / 2, 0])
|
||||
child();
|
||||
|
||||
|
||||
pi_lift = 10; // space underneath for 12mm screw
|
||||
|
||||
standoffs = 4;
|
||||
@@ -35,9 +24,9 @@ pi_base = 2;
|
||||
nut_depth = nut_thickness(M2p5_nut, true) + 0.5;
|
||||
rim_height = pi_lift + pi_thickness;
|
||||
margin = 2;
|
||||
x_offset = psu_height(psu) - raspberry_pi_width() / 2 - margin;
|
||||
|
||||
function raspberry_pi_width() = pi_width;
|
||||
|
||||
x_offset = psu_height(psu) - raspberry_pi_width() / 2 - margin;
|
||||
|
||||
back_height = controller_z - (psu_z + psu_length(psu) / 2);
|
||||
screw_z = back_height + controller_hole_inset(controller);
|
||||
@@ -46,18 +35,26 @@ slot_length = 2;
|
||||
|
||||
wall = 2.5;
|
||||
|
||||
card_width = 30.3;
|
||||
card_thickness = 4;
|
||||
card_offset = 11.5;
|
||||
|
||||
back_width = screw_pitch + 2 * (M3_clearance_radius + wall);
|
||||
|
||||
module raspberry_pi() {
|
||||
vitamin("RASPBERY: Raspberry PI model B");
|
||||
color("green")
|
||||
rotate([0, 0, 90])
|
||||
translate([-pi_length / 2, - pi_width / 2, 0])
|
||||
import("../imported_stls/R-Pi.stl");
|
||||
module rpi_position() {
|
||||
rpi_x = pi_on_psu() ? psu_x + x_offset : right_stay_x + sheet_thickness(frame) / 2;
|
||||
rpi_y = pi_on_psu() ? psu_y : gantry_Y + sheet_thickness(frame) + pi_card_clearance + pi_length / 2;
|
||||
rpi_z = pi_on_psu() ? psu_z + psu_length(psu) /2 : fixing_block_height() + pi_base_width / 2;
|
||||
|
||||
translate([rpi_x, rpi_y, rpi_z]) rotate([0, pi_on_psu() ? 0 : 90, 0])
|
||||
children();
|
||||
}
|
||||
|
||||
module rpi_bracket_holes() {
|
||||
inset = overlap + (washer_diameter(M3_washer) + 1) / 2;
|
||||
|
||||
for(side = [-1,1], end = [-1, 1]) {
|
||||
nudge = end > 0 && side < 0;
|
||||
translate([side * (pi_width / 2 - inset),
|
||||
end * (pi_length / 2 - inset) - (nudge ? 5 : 0), pi_base])
|
||||
children();
|
||||
}
|
||||
}
|
||||
|
||||
module rpi_bracket_stl() {
|
||||
@@ -84,20 +81,21 @@ module rpi_bracket_stl() {
|
||||
cube([card_width + 2, rim_width * 2 + 1, card_thickness * 2], center = true);
|
||||
}
|
||||
|
||||
translate([-x_offset, controller_y - psu_y + controller_width(controller) / 2 - back_width / 2, 0]) {
|
||||
cube([x_offset - pi_width / 2 + eta, back_width, 4]);
|
||||
cube([pcb_spacer_height(), back_width, back_height]);
|
||||
if(pi_on_psu())
|
||||
translate([-x_offset, controller_y - psu_y + controller_width(controller) / 2 - back_width / 2, 0]) {
|
||||
cube([x_offset - pi_width / 2 + eta, back_width, 4]);
|
||||
cube([pcb_spacer_height(), back_width, back_height]);
|
||||
|
||||
for(side = [-1, 1])
|
||||
translate([0, side * screw_pitch / 2 + back_width / 2, screw_z + slot_length / 2])
|
||||
hull() {
|
||||
rotate([0, 90, 0])
|
||||
cylinder(r = M3_clearance_radius + wall, h = 2 * pcb_spacer_height());
|
||||
for(side = [-1, 1])
|
||||
translate([0, side * screw_pitch / 2 + back_width / 2, screw_z + slot_length / 2])
|
||||
hull() {
|
||||
rotate([0, 90, 0])
|
||||
cylinder(r = M3_clearance_radius + wall, h = 2 * pcb_spacer_height());
|
||||
|
||||
translate([0, -(M3_clearance_radius + wall), -screw_z])
|
||||
cube([2 * pcb_spacer_height(), 2 * (M3_clearance_radius + wall), 1]);
|
||||
}
|
||||
}
|
||||
translate([0, -(M3_clearance_radius + wall), -screw_z])
|
||||
cube([2 * pcb_spacer_height(), 2 * (M3_clearance_radius + wall), 1]);
|
||||
}
|
||||
}
|
||||
|
||||
pi_holes() union() {
|
||||
cylinder(r = corrected_radius(M2p5_clearance_radius) + 2, h = pi_lift);
|
||||
@@ -107,10 +105,14 @@ module rpi_bracket_stl() {
|
||||
pi_holes()
|
||||
nut_trap(M2p5_clearance_radius, nut_radius(M2p5_nut), nut_depth, supported = true);
|
||||
|
||||
for(side = [-1, 1])
|
||||
translate([-x_offset, controller_y - psu_y + controller_width(controller) / 2 + side * screw_pitch / 2, screw_z])
|
||||
rotate([90, 0, 90])
|
||||
vertical_tearslot(h = 4 * pcb_spacer_height() + 1, r = M3_clearance_radius, l = slot_length);
|
||||
if(pi_on_psu())
|
||||
for(side = [-1, 1])
|
||||
translate([-x_offset, controller_y - psu_y + controller_width(controller) / 2 + side * screw_pitch / 2, screw_z])
|
||||
rotate([90, 0, 90])
|
||||
vertical_tearslot(h = 4 * pcb_spacer_height() + 1, r = M3_clearance_radius, l = slot_length);
|
||||
else
|
||||
rpi_bracket_holes()
|
||||
poly_cylinder(r = M3_clearance_radius, h = 100, center = true);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -118,7 +120,7 @@ module rpi_bracket_stl() {
|
||||
module raspberry_pi_assembly() {
|
||||
assembly("raspberry_pi_assembly");
|
||||
|
||||
translate([psu_x + x_offset, psu_y, psu_z + psu_length(psu) /2]) {
|
||||
rpi_position() group() {
|
||||
color("lime") render() rpi_bracket_stl();
|
||||
|
||||
explode([80, 0, 0])
|
||||
@@ -134,6 +136,17 @@ module raspberry_pi_assembly() {
|
||||
explode([0, 0, 30])
|
||||
translate([0, 0, pi_lift + pi_thickness])
|
||||
screw_and_washer(M2p5_pan_screw, 12);
|
||||
|
||||
if(!pi_on_psu())
|
||||
rpi_bracket_holes() group() {
|
||||
screw_and_washer(M3_cap_screw,
|
||||
screw_longer_than(2 * washer_thickness(M3_washer) + pi_base + sheet_thickness(frame) + nut_thickness(M3_nut,true)));
|
||||
|
||||
translate([0, 0, -pi_base - sheet_thickness(frame)])
|
||||
rotate([180, 0, 0])
|
||||
nut_and_washer(M3_nut, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
end("raspberry_pi_assembly");
|
||||
|
@@ -9,11 +9,11 @@
|
||||
//
|
||||
include <conf/config.scad>
|
||||
include <positions.scad>
|
||||
use <light_strip_clip.scad>
|
||||
use <frame_edge_clamp.scad>
|
||||
|
||||
light = light_strip ? light_strip : SPS125;
|
||||
|
||||
show_rays = false;
|
||||
light = light_strip ? light_strip : RIGID5050_290;
|
||||
light2 = light_strip == RIGID5050_290 ? RIGID5050_208 : false;
|
||||
|
||||
wall = 2;
|
||||
clearance = 0.2;
|
||||
@@ -44,71 +44,82 @@ pi_cam_back_length = pi_cam_hole_pitch + 2 * (nut_flat_radius(M2_nut) + min_wall
|
||||
pi_cam_back_width = pi_cam_width + (pi_cam_back_length - pi_cam_length) / 2;
|
||||
pi_cam_centreline = -pi_cam_width / 2 + 9.5;
|
||||
|
||||
function round_to_layer(z) = ceil(z / layer_height) * layer_height;
|
||||
|
||||
pi_cam_front_clearance = 1.6;
|
||||
pi_cam_front_wall = 2;
|
||||
pi_cam_front_depth = pi_cam_back_depth + pi_cam_thickness + pi_cam_front_clearance + wall;
|
||||
pi_cam_front_length = pi_cam_back_length + 2 * (pi_cam_front_wall + clearance);
|
||||
pi_cam_front_width = pi_cam_back_width + 2 * (pi_cam_front_wall + clearance);
|
||||
|
||||
bar_dia = 12;
|
||||
bar_gap = 2;
|
||||
bar_wall = 3;
|
||||
left = left_stay_x + sheet_thickness(frame) / 2;
|
||||
right = right_stay_x - sheet_thickness(frame) / 2;
|
||||
|
||||
X_build = min(X_travel, bed_holes[0] - screw_head_radius(M3_cap_screw) * 2); // sturdy travel exceeds the bed so max object is smaller
|
||||
Y_build = min(Y_travel, bed_holes[1] - screw_head_radius(M3_cap_screw) * 2);
|
||||
|
||||
y_limit = Y0 + (Y_travel + Y_build) / 2 + 1;
|
||||
bar_z = 240;
|
||||
bar_y = y_limit + bar_dia / 2 + wall + 2;
|
||||
|
||||
cam_offset = pi_cam_front_width / 2 - pi_cam_width / 2 + pi_cam_back_width / 2 - pi_cam_centreline + bar_dia / 2;
|
||||
cam_x = X_origin;
|
||||
cam_y = bar_y - bar_dia / 2 - pi_cam_front_wall;
|
||||
cam_z = bar_z - cam_offset;
|
||||
pivot_screw_length = 16;
|
||||
end_cap_nut_boss_r = nut_trap_radius(M3_nut, horizontal = false) + 3 * filament_width;
|
||||
end_cap_nut_boss = pivot_screw_length - washer_thickness(M3_washer) - frame_edge_clamp_thickness() - 2;
|
||||
|
||||
hypot = sqrt(sqr(bar_z - bed_height) + sqr(bar_y - Y0));
|
||||
angle = atan2(bar_z - bed_height, bar_y - Y0) - asin(cam_offset / hypot);
|
||||
pivot_offset = frame_edge_clamp_hinge() + washer_diameter(M3_washer) / 2;
|
||||
pivot_y = base_depth / 2 + pivot_offset;
|
||||
|
||||
left = left_stay_x + sheet_thickness(frame) / 2;
|
||||
right = right_stay_x - sheet_thickness(frame) / 2;
|
||||
light2_z_top = light_strip_clip_length(light) / 2 + (light2 ? light_strip_clip_length(light2) - wall : 0);
|
||||
light2_distance = sqrt(sqr(Z_travel) + sqr(y_limit - Y0));
|
||||
max_light_angle = atan2(Z_travel, y_limit - Y0) - asin(light2_z_top / light2_distance);
|
||||
max_pivot_z = bed_height + tan(max_light_angle) * (pivot_y - Y0);
|
||||
pivot_z = 240;
|
||||
|
||||
bar_length = right - left - 2;
|
||||
bar_overlap = 2 * (cam_x -(right + left) / 2);
|
||||
clamp_length = bar_dia - frame_edge_clamp_pitch(0) + 2 * nut_flat_radius(M3_nut) + clearance * 2;
|
||||
|
||||
band_width = 2 * (nut_trap_radius(M3_nut) + wall);
|
||||
band_tab_h = 2 * (nut_trap_flat_radius(M3_nut) + wall);
|
||||
band_ir = bar_dia / 2;
|
||||
band_or = band_ir + pi_cam_front_wall;
|
||||
band_y = pi_cam_front_width / 2 - pi_cam_width / 2 + pi_cam_back_width / 2 - pi_cam_front_wall + band_or + eta;
|
||||
|
||||
band_tab_t = M3_nut_trap_depth + wall;
|
||||
band_slit = 1;
|
||||
band_tab_d = max(2 * band_tab_t + band_slit, 16 - washer_thickness(M3_washer) - nut_thickness(M3_nut, true) + M3_nut_trap_depth - 0.5);
|
||||
band_tab_height = band_tab_h + sqrt(sqr(band_or) - sqr(band_tab_d / 2));
|
||||
pivot_light2_distance = sqrt(sqr(bed_height + Z_travel - max_pivot_z) + sqr(y_limit - pivot_y));
|
||||
pivot_max_distance = sqrt(sqr(max_pivot_z - bed_height) + sqr(pivot_y - Y0));
|
||||
|
||||
light_x = (left + right) / 2;
|
||||
light_z = bar_z + bar_dia / 2 + light_strip_width(light) / 2 + pi_cam_front_wall + clearance;
|
||||
bar_z_offset = light_z - bar_z;
|
||||
light_y = pivot_y - end_cap_nut_boss_r;
|
||||
light_angle = atan2(pivot_z - bed_height, pivot_y - Y0);
|
||||
|
||||
light_angle = atan2(bar_z - bed_height, bar_y - Y0) + asin(bar_z_offset / hypot);
|
||||
hinge_screw = M2_cap_screw;
|
||||
hinge_nut = screw_nut(hinge_screw);
|
||||
hinge_screw_length = 12;
|
||||
|
||||
light_incursion = max(0, y_limit + sin(light_angle) * (bar_z_offset + light_strip_width(light) / 2) - bar_y);
|
||||
hinge_r = nut_trap_radius(hinge_nut) + 3 * filament_width;
|
||||
hinge_h = max(wall + nut_trap_depth(hinge_nut), light_strip_clip_depth(light) / 2);
|
||||
cam_hinge_h = light_strip_clip_depth(light) - hinge_h;
|
||||
|
||||
bar_y_offset = (light_strip_thickness(light) + light_incursion) / cos(light_angle);
|
||||
light_y = bar_y + bar_y_offset;
|
||||
light_hinge_offset = hinge_r + 0.5;
|
||||
light_hinge_z_offset = light_strip_clip_length(light) / 2 + light_hinge_offset * cos(light_angle);
|
||||
light_hinge_y_offset = light_strip_clip_width(light) + light_hinge_offset * sin(light_angle);
|
||||
|
||||
light_band_tab_h = 2 * (nut_trap_radius(M3_nut) + wall);
|
||||
light_band_tab_height = light_band_tab_h + sqrt(sqr(band_or) - sqr(band_tab_d / 2));
|
||||
hinge_y = light_y + wall - light_hinge_y_offset;
|
||||
hinge_z = pivot_z - light_hinge_z_offset;
|
||||
|
||||
cam_hinge_z_offset = pi_cam_front_width / 2 + hinge_r - pi_cam_width / 2 + pi_cam_back_width / 2 - pi_cam_centreline + 0.5;
|
||||
cam_hinge_y_offset = hinge_r;
|
||||
|
||||
cam_x = X_origin;
|
||||
cam_y = hinge_y - cam_hinge_y_offset;
|
||||
cam_z = hinge_z - cam_hinge_z_offset;
|
||||
|
||||
light2_z_offset = light2_z_top - light_strip_clip_length(light2) / 2;
|
||||
light2_x_offset = cam_x - light_x;
|
||||
dy = sqrt(sqr(pivot_light2_distance) - sqr(light2_z_top));
|
||||
light2_y_offset = -(pivot_y - light_y) + wall - light_strip_clip_width(light2) + (light2_distance < pivot_max_distance ? dy : -dy);
|
||||
|
||||
clamp_length = 20;
|
||||
|
||||
hypot = sqrt(sqr(pivot_z - bed_height) + sqr(pivot_y - Y0));
|
||||
adj = hypot - (pivot_y - hinge_y);
|
||||
alpha = atan2(light_hinge_z_offset, adj);
|
||||
hypot2 = sqrt(sqr(adj) + sqr(light_hinge_z_offset));
|
||||
beta = asin(cam_hinge_z_offset / hypot2);
|
||||
cam_angle = light_angle - alpha - beta;
|
||||
|
||||
module pi_cam_holes(mid_only = false) {
|
||||
ypos = [pi_cam_centreline, pi_cam_width / 2 - 2];
|
||||
for(y = mid_only ? [ ypos[0] ] : ypos)
|
||||
for(x = [-pi_cam_length / 2 + 2, pi_cam_length / 2 - 2])
|
||||
translate([x, y, 0])
|
||||
child();
|
||||
children();
|
||||
}
|
||||
|
||||
module raspberry_pi_camera() {
|
||||
@@ -138,6 +149,10 @@ module raspberry_pi_camera() {
|
||||
|
||||
color("red")
|
||||
render() translate(pi_cam_led_pos) cube(center = true);
|
||||
|
||||
if(show_rays)
|
||||
translate([0, pi_cam_centreline, pi_cam_thickness])
|
||||
%cylinder(r = 1, h = 100);
|
||||
}
|
||||
|
||||
module rpi_camera_focus_ring_stl() {
|
||||
@@ -150,8 +165,6 @@ module rpi_camera_focus_ring_stl() {
|
||||
x = rad / (sin(angle / 2) + cos(angle / 2));
|
||||
r = x * sin(angle / 2);
|
||||
|
||||
stl("rpi_camera_focus_ring");
|
||||
|
||||
difference() {
|
||||
linear_extrude(height = thickness, convexity = 5)
|
||||
difference() {
|
||||
@@ -184,17 +197,8 @@ module rpi_camera_back_stl() {
|
||||
|
||||
stl("rpi_camera_back");
|
||||
translate([0, 0, pi_cam_back_depth]) rotate([0, 180, 0]) difference() {
|
||||
union() {
|
||||
translate([0, -pi_cam_width / 2 + pi_cam_back_width / 2, pi_cam_back_depth / 2])
|
||||
cube([pi_cam_back_length, pi_cam_back_width, pi_cam_back_depth], center = true);
|
||||
|
||||
*translate([0, pi_cam_centreline, pi_cam_back_depth + lug_height - lug_rad])
|
||||
rotate([0, 90, 90])
|
||||
cylinder(r = lug_rad, h = lug_width, center = true);
|
||||
|
||||
*translate([ - lug_rad, pi_cam_centreline - lug_width / 2, 0])
|
||||
cube([lug_rad * 2, lug_width, lug_height - lug_rad + pi_cam_back_depth]);
|
||||
}
|
||||
translate([0, -pi_cam_width / 2 + pi_cam_back_width / 2, pi_cam_back_depth / 2])
|
||||
cube([pi_cam_back_length, pi_cam_back_width, pi_cam_back_depth], center = true);
|
||||
|
||||
translate([0, -pi_cam_back_overlap, 0])
|
||||
cube([pi_cam_length - 2 * pi_cam_back_overlap, pi_cam_width, 2 * pi_cam_back_clearance], center = true);
|
||||
@@ -207,20 +211,11 @@ module rpi_camera_back_stl() {
|
||||
rotate([180, 0, 90])
|
||||
nut_trap(M2_clearance_radius, nut_radius(M2_nut), M2_nut_trap_depth, supported = true);
|
||||
|
||||
*translate([0, 0, pi_cam_back_clearance + layer_height])
|
||||
rotate([0, 0, 90])
|
||||
poly_cylinder(r = M2_clearance_radius, h = 100);
|
||||
}
|
||||
|
||||
*translate([0, pi_cam_centreline, pi_cam_back_depth + lug_height - lug_rad])
|
||||
rotate([90, 0, 0])
|
||||
teardrop_plus(r = lug_hole_r, h = lug_width + 1, center = true);
|
||||
}
|
||||
}
|
||||
|
||||
module rpi_camera_front_stl() {
|
||||
stl("rpi_camera_front");
|
||||
|
||||
shelf = pi_cam_front_depth - pi_cam_back_depth;
|
||||
connector_slot = pi_cam_connector_height + 2 * layer_height;
|
||||
rad = pi_cam_front_wall;
|
||||
@@ -243,24 +238,19 @@ module rpi_camera_front_stl() {
|
||||
|
||||
cylinder(r = rad * (sqrt(2) - 1), h = eta);
|
||||
}
|
||||
//
|
||||
// bar clamp
|
||||
//
|
||||
hull() {
|
||||
translate([0, band_y, band_or])
|
||||
rotate([-90, 0, 90])
|
||||
teardrop(r = band_or, h = band_width, center = true); // clamp band to go round bar
|
||||
|
||||
translate([-band_width / 2, pi_cam_front_length / 2 - rad, 0])
|
||||
cube([band_width, 1, 1]);
|
||||
}
|
||||
translate([-light_strip_clip_depth(light) / 2 + hinge_h, cam_hinge_z_offset + pi_cam_centreline, cam_hinge_y_offset])
|
||||
hull() {
|
||||
rotate([-90, 0, -90])
|
||||
teardrop(r = hinge_r, h = cam_hinge_h);
|
||||
|
||||
translate([0, band_y, band_or + band_tab_height / 2])
|
||||
cube([band_width, band_tab_d, band_tab_height], center = true); // tab for screw
|
||||
translate([0, -hinge_r - 10, - hinge_r])
|
||||
cube([cam_hinge_h, hinge_r + 10, 2 * hinge_r]);
|
||||
}
|
||||
}
|
||||
translate([0, band_y, band_or])
|
||||
translate([0, cam_hinge_z_offset + pi_cam_centreline, cam_hinge_y_offset])
|
||||
rotate([90, 0, 90])
|
||||
teardrop(r = band_ir, h = band_width + 1, center = true);
|
||||
teardrop_plus(r = screw_clearance_radius(hinge_screw), h = 100, center = true);
|
||||
|
||||
translate([0, -pi_cam_width / 2 + pi_cam_back_width / 2, pi_cam_front_depth / 2 + shelf - layer_height]) // recess for the back
|
||||
cube([pi_cam_back_length + 2 * clearance, pi_cam_back_width + 2 * clearance, pi_cam_front_depth], center = true);
|
||||
@@ -289,190 +279,218 @@ module rpi_camera_front_stl() {
|
||||
cube(pi_cam_turret + 2 * clearance, center = true); // hole for lens
|
||||
|
||||
rotate([0, 180, 0]) translate(pi_cam_led_pos) cylinder(r = led_hole_r, h = 100, center = true); // hole for led
|
||||
//
|
||||
// bar clamp
|
||||
//
|
||||
translate([-50, band_y - band_slit / 2, band_or + band_ir + 5 * layer_height / 4])
|
||||
cube([100, band_slit, 100]);
|
||||
|
||||
translate([0, band_y + band_tab_d / 2, band_or + band_tab_height - band_tab_h / 2])
|
||||
rotate([90, 0, 0])
|
||||
nut_trap(M3_clearance_radius, nut_radius(M3_nut), M3_nut_trap_depth, horizontal = true);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module camera_bar(male = false) {
|
||||
length = bar_length / 2 + (male ? -bar_overlap / 2 : bar_overlap / 2);
|
||||
|
||||
translate([0, base_depth / 2 - bar_y, 0])
|
||||
module pivot_lug() {
|
||||
linear_extrude(height = frame_edge_clamp_thickness(), convexity = 2)
|
||||
difference() {
|
||||
union() {
|
||||
tube(or = bar_dia / 2, ir = bar_dia / 2 - bar_wall, h = length, center = false);
|
||||
if(male)
|
||||
translate([0, 0, length - 6 * layer_height])
|
||||
cylinder(r = bar_dia / 2 - wall - 0.1, h = bar_overlap + 6 * layer_height);
|
||||
}
|
||||
if(!male)
|
||||
translate([0, 0, length])
|
||||
cylinder(r = bar_dia / 2 - wall, h = 2 * bar_overlap + 2, center = true);
|
||||
hull() {
|
||||
translate([-clamp_length / 2, -frame_edge_clamp_hinge()])
|
||||
square([clamp_length, eta]);
|
||||
|
||||
*translate([-100, 0, 0])
|
||||
cube([200, 200, 200]);
|
||||
}
|
||||
translate([0, -pivot_offset])
|
||||
circle(washer_diameter(M3_washer)/ 2 + 1);
|
||||
}
|
||||
translate([0, -pivot_offset])
|
||||
poly_circle(M3_clearance_radius);
|
||||
}
|
||||
}
|
||||
|
||||
module rpi_light_clamp_stl() {
|
||||
|
||||
thickness = 3;
|
||||
overlap = 1;
|
||||
length = light_strip_width(light) + 2 * wall;
|
||||
gap = light_strip_width(light) + clearance;
|
||||
|
||||
stl("rpi_light_clamp");
|
||||
module light_strip_end_cap_stl() {
|
||||
base_thickness = (right - left - 2 * frame_edge_clamp_thickness() - 1 - light_strip_length(light)) / 2;
|
||||
|
||||
difference() {
|
||||
union() {
|
||||
translate([-length / 2, - bar_y_offset, 0])
|
||||
cube([length, thickness + bar_y_offset, band_width]);
|
||||
linear_extrude(height = base_thickness, convexity = 2)
|
||||
hull() {
|
||||
translate([-light_strip_clip_length(light) / 2, end_cap_nut_boss_r - wall])
|
||||
square([light_strip_clip_length(light), light_strip_clip_width(light)]);
|
||||
|
||||
translate([0, 0, band_width / 2 + eta])
|
||||
rotate([-90, 0, 0])
|
||||
teardrop(r = nut_trap_radius(M3_nut) + wall, h = wall + M3_nut_trap_depth);
|
||||
circle(end_cap_nut_boss_r);
|
||||
}
|
||||
|
||||
cylinder(r = end_cap_nut_boss_r, h = end_cap_nut_boss);
|
||||
|
||||
translate([bar_z_offset, -bar_y_offset, 0]) {
|
||||
cylinder(r = band_or, h = band_width);
|
||||
|
||||
translate([light_band_tab_height / 2, 0, band_width / 2])
|
||||
cube([light_band_tab_height, band_tab_d, band_width], center = true); // tab for screw
|
||||
}
|
||||
translate([0, end_cap_nut_boss_r - wall, base_thickness - eta])
|
||||
light_strip_clip(light);
|
||||
}
|
||||
translate([-gap / 2, - bar_y_offset * 2, -1])
|
||||
cube([gap, bar_y_offset * 2, band_width + 2]);
|
||||
translate([0, 0, end_cap_nut_boss])
|
||||
nut_trap(M3_clearance_radius, M3_nut_radius, M3_nut_trap_depth);
|
||||
|
||||
translate([-gap / 2 - wall - 1, -bar_y_offset -overlap, -1])
|
||||
cube([wall + 2, bar_y_offset, band_width + 2]);
|
||||
translate([-(light_strip_clip_gap(light) - eta) / 2, end_cap_nut_boss_r + eta, -1]) // extend the slot for wires
|
||||
cube([light_strip_clip_gap(light) - 2 * eta, 100, 100]);
|
||||
|
||||
translate([bar_z_offset, -bar_y_offset, 0])
|
||||
cylinder(r = band_ir, h = 100, center = true);
|
||||
|
||||
|
||||
translate([0, wall + M3_nut_trap_depth, band_width / 2])
|
||||
rotate([90, 0, 0])
|
||||
nut_trap(M3_clearance_radius, nut_radius(M3_nut), M3_nut_trap_depth, horizontal = true);
|
||||
//
|
||||
// bar clamp
|
||||
//
|
||||
translate([bar_z_offset, -bar_y_offset, 0]) {
|
||||
translate([0, -band_slit / 2, -1])
|
||||
cube([100, band_slit, band_width + 2]);
|
||||
|
||||
translate([light_band_tab_height - light_band_tab_h / 2, -band_tab_d / 2, band_width / 2])
|
||||
rotate([90, 0, 0])
|
||||
nut_trap(M3_clearance_radius, nut_radius(M3_nut), M3_nut_trap_depth, horizontal = true);
|
||||
}
|
||||
}
|
||||
translate([50, end_cap_nut_boss_r - wall - eta, end_cap_nut_boss + eta]) // truncate back to level of screw boss when is short
|
||||
rotate([0, 0, 180])
|
||||
cube([100, 100, 100]);
|
||||
}
|
||||
}
|
||||
|
||||
module rpi_camera_bracket_stl(include_support = true) {
|
||||
difference() {
|
||||
union() {
|
||||
light_strip_clip(light);
|
||||
|
||||
module raspberry_pi_camera_assembly(light_strip = true) {
|
||||
assembly("raspberry_pi_camera_assembly");
|
||||
translate([light_hinge_z_offset, light_hinge_y_offset, 0]) union() {
|
||||
cylinder(r = hinge_r, h = hinge_h);
|
||||
|
||||
translate([0, bar_y, bar_z]) {
|
||||
rotate([angle, 0, 0])
|
||||
translate([cam_x, cam_y - bar_y, cam_z - bar_z]) rotate([90, 0, 0]) translate([0, -pi_cam_centreline, 0]) {
|
||||
color("lime") render()
|
||||
translate([0, 0, - pi_cam_front_depth - 40 * exploded])
|
||||
rpi_camera_back_stl();
|
||||
rotate([0, 0, 180 + light_angle])
|
||||
translate([0, - wall / 2, 0])
|
||||
cube([light_hinge_offset + wall, wall, hinge_h]);
|
||||
}
|
||||
}
|
||||
translate([light_hinge_z_offset, light_hinge_y_offset, 0])
|
||||
nut_trap(screw_clearance_radius(hinge_screw), nut_radius(hinge_nut), nut_trap_depth(hinge_nut), supported = include_support);
|
||||
}
|
||||
}
|
||||
|
||||
color("blue") render()
|
||||
rotate([0, 180, 0])
|
||||
rpi_camera_front_stl();
|
||||
module light_strip_piggy_back_clip() {
|
||||
union() {
|
||||
light_strip_clip(light);
|
||||
|
||||
translate([0, 0, pi_cam_back_depth - pi_cam_front_depth - 23 * exploded])
|
||||
raspberry_pi_camera();
|
||||
translate([light2_z_offset, light2_y_offset, 0]) {
|
||||
difference() {
|
||||
translate([-light_strip_clip_length(light2) / 2, 0, 0])
|
||||
cube([light_strip_clip_length(light2), light_strip_clip_width(light2), wall]);
|
||||
|
||||
pi_cam_holes(mid_only = true) group() {
|
||||
screw_and_washer(M2_cap_screw, 12);
|
||||
|
||||
translate([0, 0, -pi_cam_front_depth + M2_nut_trap_depth - 40 * exploded])
|
||||
rotate([0, 180, 90])
|
||||
nut(M2_nut, true);
|
||||
translate([-(light_strip_clip_gap(light2) - eta) / 2, wall, -1]) // extend the slot for wires
|
||||
cube([light_strip_clip_gap(light2) - 2 * eta, 100, 100]);
|
||||
}
|
||||
|
||||
translate([0, (band_y - band_tab_d / 2), -(band_or + band_tab_height - band_tab_h / 2)]) {
|
||||
rotate([90, 0, 0])
|
||||
screw_and_washer(M3_cap_screw, 16);
|
||||
|
||||
translate([0, band_tab_d - M3_nut_trap_depth, 0])
|
||||
rotate([-90, 0, 0])
|
||||
nut(M3_nut, true);
|
||||
}
|
||||
|
||||
translate([0, pi_cam_centreline, 1.5 + 10 * exploded]) color("lime") render() rpi_camera_focus_ring_stl();
|
||||
translate([0, 0, wall - eta])
|
||||
light_strip_clip(light2);
|
||||
}
|
||||
|
||||
if(light_strip)
|
||||
rotate([light_angle, 0, 0])
|
||||
translate([light_x, bar_y_offset, bar_z_offset]) {
|
||||
rotate([90, 0, 0])
|
||||
light_strip(light);
|
||||
translate([light_strip_clip_length(light) / 2, 0, 0])
|
||||
rotate([0, 0, 180])
|
||||
cube([wall, -light2_y_offset, light_strip_clip_depth(light2)]);
|
||||
}
|
||||
}
|
||||
|
||||
for(side = [-1, 1])
|
||||
translate([side * light_strip_hole_pitch(light) / 2, 0, 0]) {
|
||||
translate([-band_width / 2, 0, 0])
|
||||
rotate([0, 90, 0])
|
||||
color("blue") render() rpi_light_clamp_stl();
|
||||
module light_strip_piggy_back_clips_stl() {
|
||||
|
||||
translate([0, -light_strip_thickness(light), 0])
|
||||
rotate([90, 0, 0])
|
||||
screw_and_washer(M3_cap_screw, 10);
|
||||
offset = -(light_strip_clip_length(light) / 2 + light_strip_clip_length(light2) - wall);
|
||||
translate([offset, -light_strip_clip_width(light) - 1, 0])
|
||||
light_strip_piggy_back_clip();
|
||||
|
||||
translate([0, wall, 0])
|
||||
rotate([-90, 90, 0])
|
||||
nut(M3_nut, true);
|
||||
translate([offset, light_strip_clip_width(light) + 1, 0])
|
||||
rotate([180, 0, 0])
|
||||
mirror([0, 0, 1])
|
||||
light_strip_piggy_back_clip();
|
||||
}
|
||||
|
||||
translate([0, -bar_y_offset, -bar_z_offset]) {
|
||||
translate([0, band_tab_d / 2, -light_band_tab_height + light_band_tab_h / 2])
|
||||
rotate([-90, 0, 0])
|
||||
screw_and_washer(M3_cap_screw, 16);
|
||||
module raspberry_pi_camera_assembly() {
|
||||
assembly("raspberry_pi_camera_assembly");
|
||||
|
||||
translate([0, -band_tab_d / 2 + M3_nut_trap_depth,
|
||||
-light_band_tab_height + light_band_tab_h / 2])
|
||||
rotate([90, 90, 0])
|
||||
nut(M3_nut, true);
|
||||
}
|
||||
stl("rpi_camera_case");
|
||||
translate([0, pivot_y, pivot_z]) {
|
||||
rotate([light_angle, 0, 0])
|
||||
translate([0, hinge_y - pivot_y, hinge_z - pivot_z])
|
||||
rotate([cam_angle - light_angle, 0, 0])
|
||||
translate([cam_x, cam_y - hinge_y, cam_z - hinge_z - pi_cam_centreline]) rotate([90, 0, 0]) {
|
||||
color("lime") render()
|
||||
translate([0, 0, - pi_cam_front_depth - 40 * exploded])
|
||||
rpi_camera_back_stl();
|
||||
|
||||
color("red") render()
|
||||
rotate([0, 180, 0])
|
||||
rpi_camera_front_stl();
|
||||
|
||||
translate([0, 0, pi_cam_back_depth - pi_cam_front_depth - 23 * exploded])
|
||||
raspberry_pi_camera();
|
||||
|
||||
pi_cam_holes(mid_only = true) group() {
|
||||
screw_and_washer(M2_cap_screw, 12);
|
||||
|
||||
translate([0, 0, -pi_cam_front_depth + M2_nut_trap_depth - 40 * exploded])
|
||||
rotate([0, 180, 90])
|
||||
nut(M2_nut, true);
|
||||
}
|
||||
}
|
||||
|
||||
translate([0, pi_cam_centreline, 1.5 + 10 * exploded])
|
||||
color("lime") render()
|
||||
rpi_camera_focus_ring_stl();
|
||||
}
|
||||
}
|
||||
|
||||
stl("rpi_camera_bar");
|
||||
stl("light_and_camera_brackets");
|
||||
stl("rear_light_brackets");
|
||||
|
||||
for(side = [-1, 1])
|
||||
translate([side < 0 ? left : right, base_depth / 2, bar_z])
|
||||
translate([0, pivot_y, pivot_z])
|
||||
rotate([light_angle, 0, 0]) {
|
||||
translate([light_x, light_y - pivot_y, 0]) {
|
||||
rotate([90, 0, 0]) {
|
||||
light_strip(light);
|
||||
|
||||
if(light2) {
|
||||
translate([light2_x_offset, light2_z_offset, light2_y_offset])
|
||||
light_strip(light2);
|
||||
|
||||
for(side = [-1, 1])
|
||||
translate([light2_x_offset + side * (light_strip_length(light2) / 2 + wall), 0, -wall])
|
||||
rotate([90, 0, 90])
|
||||
mirror([0, 0, side > 0 ? 1 : 0])
|
||||
color("lime") render()
|
||||
light_strip_piggy_back_clip();
|
||||
}
|
||||
}
|
||||
|
||||
translate([cam_x - light_x + light_strip_clip_depth(light) / 2, wall, 0])
|
||||
rotate([180, 90, 0]) {
|
||||
color("lime") render()
|
||||
rpi_camera_bracket_stl(false);
|
||||
|
||||
translate([light_hinge_z_offset, light_hinge_y_offset, 0]) {
|
||||
translate([0, 0, hinge_h + cam_hinge_h])
|
||||
screw_and_washer(hinge_screw, hinge_screw_length);
|
||||
|
||||
translate([0, 0, nut_trap_depth(hinge_nut)])
|
||||
rotate([180, 0, 0])
|
||||
nut(hinge_nut, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(side = [-1, 1])
|
||||
translate([side < 0 ? left : right, base_depth / 2, pivot_z])
|
||||
explode([20 * side, 0, 0])
|
||||
rotate([0, side * 90, 180])
|
||||
frame_edge_clamp_assembly(length = clamp_length, left = side < 0)
|
||||
camera_bar(side > 0);
|
||||
rotate([0, side * 90, 180]) {
|
||||
frame_edge_clamp_assembly(length = clamp_length, kids = true)
|
||||
pivot_lug();
|
||||
|
||||
translate([0, -pivot_offset, 0]) {
|
||||
rotate([180, 0, 0])
|
||||
screw_and_washer(M3_cap_screw, pivot_screw_length);
|
||||
|
||||
translate([0, 0, frame_edge_clamp_thickness() + end_cap_nut_boss - M3_nut_trap_depth])
|
||||
rotate([0, 0, -side * light_angle])
|
||||
nut(M3_nut, true);
|
||||
}
|
||||
|
||||
translate([0, -pivot_offset, frame_edge_clamp_thickness()])
|
||||
rotate([0, 0, -side * light_angle])
|
||||
color("lime") render()
|
||||
light_strip_end_cap_stl();
|
||||
}
|
||||
|
||||
if(show_rays) {
|
||||
%hull() { // light ray, should point at centre of Y axis.
|
||||
translate([0, bar_y, bar_z])
|
||||
rotate([angle, 0, 0])
|
||||
translate([cam_x, cam_y - bar_y, cam_z - bar_z])
|
||||
sphere();
|
||||
translate([0, pivot_y, pivot_z])
|
||||
rotate([light_angle, 0, 0])
|
||||
translate([0, hinge_y - pivot_y, hinge_z - pivot_z])
|
||||
rotate([cam_angle - light_angle, 0, 0])
|
||||
translate([cam_x, cam_y - hinge_y, cam_z - hinge_z])
|
||||
sphere();
|
||||
|
||||
translate([X_origin, Y0, bed_height])
|
||||
sphere();
|
||||
}
|
||||
|
||||
%hull() { // light ray, should point at centre of Y axis.
|
||||
translate([0, bar_y, bar_z])
|
||||
translate([0, pivot_y, pivot_z])
|
||||
rotate([light_angle, 0, 0])
|
||||
translate([X_origin, bar_y_offset - light_strip_thickness(light), bar_z_offset])
|
||||
translate([X_origin, -(pivot_y - light_y) - light_strip_thickness(light), 0])
|
||||
sphere();
|
||||
|
||||
translate([X_origin, Y0, bed_height])
|
||||
@@ -486,16 +504,31 @@ module raspberry_pi_camera_assembly(light_strip = true) {
|
||||
end("raspberry_pi_camera_assembly");
|
||||
}
|
||||
|
||||
module rpi_camera_bar_stl() {
|
||||
|
||||
for(side = [-1, 1])
|
||||
module rear_light_brackets_stl() {
|
||||
for(side = [-1, 1]) {
|
||||
translate([side * (clamp_length / 2 + 1), 0, 0]) {
|
||||
frame_edge_clamp_front_stl(length = clamp_length)
|
||||
camera_bar(side > 0);
|
||||
translate([0, -frame_edge_clamp_width() + frame_edge_clamp_hinge() - 2, 0])
|
||||
frame_edge_clamp_front_stl(length = clamp_length)
|
||||
pivot_lug();
|
||||
|
||||
translate([0, frame_edge_clamp_width() + 2, 0])
|
||||
translate([0, frame_edge_clamp_hinge(), 0])
|
||||
frame_edge_clamp_back_stl(length = clamp_length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module light_and_camera_brackets_stl() {
|
||||
for(side = [-1, 1])
|
||||
translate([side * (light_strip_clip_length(light) / 2 + 1), end_cap_nut_boss_r + 2, 0])
|
||||
light_strip_end_cap_stl();
|
||||
|
||||
rotate([0, 0, 180])
|
||||
rpi_camera_bracket_stl();
|
||||
|
||||
if(light2)
|
||||
translate([0, light_strip_clip_width(light) + 2 * end_cap_nut_boss_r - wall + 4, 0])
|
||||
rotate([0, 0, -90])
|
||||
light_strip_piggy_back_clips_stl();
|
||||
}
|
||||
|
||||
module rpi_camera_case_stl() {
|
||||
@@ -503,12 +536,16 @@ module rpi_camera_case_stl() {
|
||||
|
||||
translate([pi_cam_front_length, 0, 0])
|
||||
rpi_camera_back_stl();
|
||||
|
||||
translate([0, -pi_cam_front_width / 2 - 9, 0])
|
||||
rpi_camera_focus_ring_stl();
|
||||
}
|
||||
|
||||
if(1)
|
||||
raspberry_pi_camera_assembly();
|
||||
else if(1)
|
||||
light_and_camera_brackets_stl();
|
||||
else if(0)
|
||||
rpi_camera_case_stl();
|
||||
else
|
||||
if(1)
|
||||
rpi_camera_case_stl();
|
||||
else
|
||||
rpi_camera_bar_stl();
|
||||
rear_light_brackets_stl();
|
||||
|
@@ -7,14 +7,35 @@
|
||||
//
|
||||
// LED light strips
|
||||
//
|
||||
SPS125 = ["SPS125: Sanken SPS125 light strip", 300, 20, 0, 1.6, 260, 3.5];
|
||||
SPS125 = ["SPS125: Sanken SPS125 light strip" , 300, 20.0, 2.8, 1.6, 260, 0, 3.5];
|
||||
Rigid5050_290 = ["RDG5050: Rigid 5050 light strip x 290mm", 290, 14.4, 0, 7, 0, 0, 0];
|
||||
Rigid5050_208 = ["RDG5050: Rigid 5050 light strip x 208mm", 208, 14.4, 0, 7, 0, 0, 0];
|
||||
RIGID5050_290 = ["RDG5050: Rigid 5050 light strip x 290mm", 290, 14.4, 0, 8.6, 0, 0, 0];
|
||||
RIGID5050_208 = ["RDG5050: Rigid 5050 light strip x 208mm", 208, 14.4, 0, 8.6, 0, 0, 0];
|
||||
FSRP3W = ["FSRP3W: F-SRP-3W-250LM-CW-ND-300MM" , 278, 20.0, 5.4, 3.0, 295, 15, 3.0];
|
||||
|
||||
function light_strip_length(type) = type[1];
|
||||
function light_strip_width(type) = type[2];
|
||||
function light_strip_set_back(type) = type[3];
|
||||
function light_strip_thickness(type) = type[4];
|
||||
function light_strip_hole_pitch(type) = type[5];
|
||||
function light_strip_hole_dia(type) = type[6];
|
||||
function light_strip_hole_pitch2(type)= type[6];
|
||||
function light_strip_hole_dia(type) = type[7];
|
||||
function light_strip_has_holes(type) = light_strip_hole_pitch(type) > 0;
|
||||
|
||||
module light_strip_hole_positions(type, all = false) {
|
||||
if(light_strip_has_holes(type))
|
||||
for(end = [-1, 1])
|
||||
if(light_strip_hole_pitch2(type)) {
|
||||
for(side = [-1, 1])
|
||||
if(all || side > 0)
|
||||
translate([end * light_strip_hole_pitch(type) / 2, side * light_strip_hole_pitch2(type) / 2 - wall, 0])
|
||||
children();
|
||||
}
|
||||
else
|
||||
translate([end * light_strip_hole_pitch(type) / 2, 0, 0])
|
||||
children();
|
||||
}
|
||||
|
||||
module light_strip(type) {
|
||||
vitamin(type[0]);
|
||||
@@ -22,8 +43,13 @@ module light_strip(type) {
|
||||
translate([0, 0, light_strip_thickness(type) / 2])
|
||||
cube([light_strip_length(type), light_strip_width(type), light_strip_thickness(type)], center = true);
|
||||
|
||||
for(side = [-1, 1])
|
||||
translate([side * light_strip_hole_pitch(type) / 2, 0, 0])
|
||||
cylinder(r = light_strip_hole_dia(type) / 2, h = 100, center = true);
|
||||
light_strip_hole_positions(type, true)
|
||||
cylinder(r = light_strip_hole_dia(type) / 2, h = 100, center = true);
|
||||
|
||||
}
|
||||
if(show_rays)
|
||||
%cylinder(r = 1, h = 150);
|
||||
|
||||
translate([0, 0, light_strip_thickness(type) + light_strip_set_back(type) / 2])
|
||||
%cube([light_strip_length(type), light_strip_width(type), light_strip_set_back(type)], center = true);
|
||||
}
|
||||
|
34
scad/vitamins/raspberry_pi.scad
Normal file
34
scad/vitamins/raspberry_pi.scad
Normal file
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// Mendel90
|
||||
//
|
||||
// GNU GPL v2
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// Raspberry PI model
|
||||
//
|
||||
pi_width = 56;
|
||||
pi_length = 85;
|
||||
pi_clearance = 0.25;
|
||||
pi_thickness = 1.6;
|
||||
|
||||
module pi_holes()
|
||||
for(hole = [[25.5, 18], [pi_length-5, pi_width-12.5]])
|
||||
translate([pi_width / 2 - hole[1], hole[0] - pi_length / 2, 0])
|
||||
children();
|
||||
|
||||
function raspberry_pi_width() = pi_width;
|
||||
function pi_on_psu() = atx_psu(psu);
|
||||
|
||||
card_width = 30.3;
|
||||
card_thickness = 4;
|
||||
card_offset = 11.5;
|
||||
pi_card_clearance = 20;
|
||||
|
||||
module raspberry_pi() {
|
||||
vitamin("RASPBERY: Raspberry PI model B");
|
||||
color("green")
|
||||
rotate([0, 0, 90])
|
||||
translate([-pi_length / 2, - pi_width / 2, 0])
|
||||
import("../imported_stls/R-Pi.stl");
|
||||
}
|
Reference in New Issue
Block a user