171 lines
3.9 KiB
OpenSCAD
171 lines
3.9 KiB
OpenSCAD
|
|
// The following should be editable within reason to adjust for container and phone size
|
|
|
|
$fn=360; // number of facets to the cylinders - basically level of detail
|
|
|
|
// drink radius, phone width, phone thickness
|
|
tab = [46, 100, 8]; // Ojrzan
|
|
tab = [46, 100, 16]; // oliwka
|
|
|
|
phone_h = 120;
|
|
drink_h = 120;
|
|
|
|
drink_rad = tab[0]; // radius of drink container - allow some wiggle room
|
|
phone_width = tab[1]/2; // width of phone - allow some wiggle room
|
|
phone_depth = tab[2]; // depth of phone - allow some wiggle room
|
|
|
|
|
|
// not intended to be changed
|
|
holder_rad = drink_rad + 5;
|
|
base_rad = holder_rad + 5;
|
|
|
|
|
|
module cup_holder_base_shape() {
|
|
|
|
// basic shape for cup holder
|
|
|
|
union() {
|
|
|
|
// lower base
|
|
cylinder(h=2,r=base_rad,center=true);
|
|
|
|
// upper base
|
|
translate([0,0,2.99])
|
|
cylinder(r2=holder_rad,r1=base_rad,h=5,center=true);
|
|
|
|
// holder
|
|
translate([0,0,drink_h/2 + 3.99])
|
|
difference() {
|
|
cylinder(r=holder_rad,h=drink_h,center=true);
|
|
// cut to hollow out cup
|
|
cylinder(r=drink_rad,h=drink_h,center=true);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
//cup_holder_base_shape();
|
|
|
|
|
|
|
|
module cup_holder_finished() {
|
|
|
|
// cut features from basic cup holder shape
|
|
|
|
difference() {
|
|
cup_holder_base_shape();
|
|
|
|
// cut side slot for strap
|
|
translate([0,drink_rad,drink_h+5])
|
|
rotate([0,5,10])
|
|
cube([5,20,drink_h*2],center=true);
|
|
|
|
// cut other side slot for strap
|
|
translate([0,-drink_rad,drink_h + 5])
|
|
rotate([0,-5,10])
|
|
cube([5,20,drink_h*2],center=true);
|
|
|
|
// cut bottom slot for strap
|
|
translate([0,0,6.5])
|
|
rotate([90,0,13])
|
|
cylinder(r=2.75,h=120,center=true);
|
|
|
|
// cut drainage holes
|
|
translate([0,0,0])
|
|
cylinder(r=6,h=40,center=true);
|
|
|
|
translate([20,5,0])
|
|
cylinder(r=4,h=40,center=true);
|
|
|
|
translate([-20,-5,0])
|
|
cylinder(r=4,h=40,center=true);
|
|
}
|
|
}
|
|
|
|
//cup_holder_finished();
|
|
|
|
|
|
|
|
|
|
module cylinder_cube(cr1=4,cr2=4,ch=5,cx=50,cy=10) {
|
|
|
|
// makes a cube rounded on 4 sides
|
|
// can be narrower at top (used this for the beveled section)
|
|
// cr1 - bottom corner radius
|
|
// cr2 - top corner radius
|
|
// ch - height
|
|
// cx - length
|
|
// cy - width
|
|
|
|
hull() {
|
|
|
|
translate([cx-cr1,cy-cr1,0])
|
|
cylinder(r1=cr1,r2=cr2,h=ch,center=true);
|
|
|
|
translate([cx-cr1,-cy+cr1,0])
|
|
cylinder(r1=cr1,r2=cr2,h=ch,center=true);
|
|
|
|
translate([-cx+cr1,cy-cr1,0])
|
|
cylinder(r1=cr1,r2=cr2,h=ch,center=true);
|
|
|
|
translate([-cx+cr1,-cy+cr1,0])
|
|
cylinder(r1=cr1,r2=cr2,h=ch,center=true);
|
|
}
|
|
|
|
}
|
|
|
|
//cylinder_cube();
|
|
|
|
|
|
|
|
|
|
module phone_holder() {
|
|
difference() {
|
|
union() {
|
|
|
|
//lower base
|
|
cylinder_cube(cr1=6,cr2=6,ch=2,cx=phone_width+10,cy=phone_depth+10);
|
|
|
|
// upper base
|
|
translate([0,0,2.99])
|
|
cylinder_cube(cr1=6,cr2=2,ch=5,cx=phone_width+9,cy=phone_depth+9);
|
|
|
|
//holder
|
|
translate([0,0,phone_h/2 + 3.99])
|
|
difference() {
|
|
cylinder_cube(cr1=2,cr2=2,ch=phone_h,cx=phone_width+5,cy=phone_depth+5);
|
|
translate([1,0,.1])
|
|
cylinder_cube(cr1=3,cr2=3,ch=phone_h+1,cx=phone_width,cy=phone_depth, anchor=BOT);
|
|
}
|
|
|
|
}
|
|
|
|
// cut drainage hole
|
|
translate([0,0,.1])
|
|
cylinder_cube(cr1=2,cr2=2,ch=30,cx=20,cy=3);
|
|
|
|
}
|
|
}
|
|
|
|
//phone_holder();
|
|
|
|
|
|
|
|
|
|
module combo_holder() {
|
|
|
|
// merge the two pieces
|
|
|
|
union(){
|
|
|
|
rotate([0,0,-12])
|
|
cup_holder_finished();
|
|
translate([holder_rad + phone_width,0,0])
|
|
phone_holder();
|
|
}
|
|
|
|
}
|
|
|
|
combo_holder();
|