Commit 49e96d95 authored by György Kurucz's avatar György Kurucz
Browse files

SD card holder, spice holder, screw box

parent 547e8982
......@@ -50,6 +50,7 @@ module _screw_thread(N=10, R=10, R_min=12, R_maj=15, P=3, taper=true) {
}
function metric_screw_d_min(P, D_maj, tol=0) = 2 * (D_maj/2+tol-5/16*sqrt(3)*P);
function metric_screw_d_maj(P, D_min, tol=0) = D_min + 5/8*sqrt(3)*P - 2*tol;
/*
P: pitch
......
......@@ -6,13 +6,15 @@ use <../include/screw.scad>;
h: total outside height
w: top wall thickness
g: inside gap
tol: tolerance on thread
nt: number of threads
txt: text
txt_size: text size
$mark_cap: generate cap part
$mark_aside: offset generated part
$mark_aside: offset generated part by this amount
$mark_flat: rotate part to lay flat
*/
module screw_box(R = 10, r = -1, h = 10, w = 1, g = 0,
module screw_box(R = 10, r = -1, h = 10, w = 1, g = 0, tol = 0.7, nt = 2,
txt = "", txt_size = 0) {
module flower2(r = 10, v = .2, n = 15) {
......@@ -22,41 +24,46 @@ module screw_box(R = 10, r = -1, h = 10, w = 1, g = 0,
}
h2 = h / 2;
_r = r < 0 ? R * 0.9 : r;
P = (h2-w-g)/2;
tol = 0.7;
d_min = metric_screw_d_min(P = P, D_maj = 2*_r,
tol = tol);
_r = r < 0 ? R * 0.8 : r;
P = (h2-w-g)/nt;
// tol = 0.7;
d_min = 2*_r;
d_maj = metric_screw_d_maj(P = P, D_min = d_min, tol = 0);
module shape() { flower2(r = R, v = R * 0.025); }
module screw(tol = 0) {
intersection() {
translate([0,0,h-w-g])
rotate([180,0,0])
metric_screw(P=P,
D_maj=_r*2,tol=tol,taper=true);
rotate([180,0,0])
metric_screw(P=P, D_maj=d_maj,tol=tol,taper=true);
translate([-R,-R,0])
cube([R*2,R*2, h-w]);
cube([R*2,R*2, h-w]);
}
}
module rounding() {
corner_r = 4;
minkowski() {
translate([0,0,corner_r])
cylinder(r=R - corner_r, h=h - corner_r * 2, $fn=70);
sphere(r=corner_r, $fn=50);
}
}
module base() {
intersection() {
union() {
linear_extrude(h2) shape();
screw();
}
corner_r = 6;
minkowski() {
translate([0,0,corner_r])
cylinder(r=R - corner_r, h=h, $fn=70);
sphere(r=corner_r, $fn=50);
screw(tol = 0);
}
rounding();
}
}
module cap() {
difference() {
translate([0,0,h2]) linear_extrude(h2)
shape();
screw(tol = 0.7);
intersection() {
translate([0,0,h2]) linear_extrude(h2)
shape();
rounding();
}
screw(tol = tol);
cylinder(d=d_min, h = h-w, $fn=100);
translate([0,0,h-w/2]) linear_extrude(w)
text(txt, halign="center",
......@@ -66,7 +73,7 @@ module screw_box(R = 10, r = -1, h = 10, w = 1, g = 0,
cap = !is_undef($mark_cap);
flat = !is_undef($mark_flat);
aside = !is_undef($mark_aside);
translate([aside ? 2*R : 0, 0, 0])
translate([aside ? 2*R + $mark_aside : 0, 0, 0])
if (!cap) { base(); } else {
if (flat) {
translate([0,0,h]) rotate([180,0,0]) cap();
......
tol = [.5, .5, .5];
size = [57.5, 18.5, 87.2] + tol;
wall = 1.5;
corner_r = 1.3;
module base_box() {
difference() {
translate([corner_r, corner_r, corner_r]) minkowski() {
cube(size + 2*[wall, wall, wall]
- 2*[corner_r, corner_r, corner_r]);
sphere(corner_r, $fn=30);
}
translate([wall, wall, wall]) cube(size);
}
}
h = size.z * (3/4);
overlap = size.z * .12;
module bottom() {
intersection() {
base_box();
union() {
cube([200, 200, h-overlap]);
translate([wall,wall]/2)
cube([size.x+wall, size.y+wall, h]);
}
}
}
module top() {
th = size.z - h;
intersection() {
base_box();
difference() {
translate([0,0,h-overlap]) cube([200, 200, 200]);
wt = .2;
translate([wall-wt,wall-wt]/2)
cube([size.x+wall+wt, size.y+wall+wt, h]);
}
}
}
//bottom();
translate([0,0,overlap+10]) top();
\ No newline at end of file
......@@ -58,8 +58,8 @@ module assembled() {
}
module print() {
translate([1,0,0]) {
$mark_aside = true; $mark_flat = true; cap(); }
translate([0,0,0]) {
$mark_aside = 1; $mark_flat = true; cap(); }
base();
}
......
use <../include/screw_box.scad>;
use <../include/short.scad>;
V_H = 35 + .5; // vial height
V_D = 16 + .5; // vial diameter
V_C = 10; // vial cap height
V_N = 9; // number of vials
R_I = (V_N * V_D) / (2 * PI) + V_D/2 + 2.5;
echo(R_I*2);
R_O = R_I + 5;
W0 = 3; // bottom wall
W1 = 1; // top wall
H = V_H + W0 + W1;
module screw_box_params() {
screw_box(R = R_O, r = R_I, h = H, w = W1, g = V_C, tol = 0.7);
}
module vials() {
$fn = 100;
for (i=[1:V_N]) {
rZ(360/V_N*i) tXZ(R_I-V_D/2 - 1, W0) cylinder(h=V_H, d=V_D);
}
tZ(W0) cylinder(h=V_H, r=R_I-V_D - 1.8);
}
module cap() {
$mark_cap = 1;
//$mark_aside = 1;
$mark_flat = 1;
screw_box_params();
}
cap();
//intersection() {
//diff() {
// screw_box_params();
// #vials();
//}
//tXYZ(-5, 15, 20) cube([20,19,40]);
//}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment