164 lines
3.6 KiB
OpenSCAD
164 lines
3.6 KiB
OpenSCAD
|
|
// The following should be editable within reason to adjust for container and phone size
|
|
|
|
$fn=50; // number of facets to the cylinders - basically level of detail
|
|
|
|
drink_rad = 46; // radius of drink container - allow some wiggle room
|
|
phone_width = 90/2; // width of phone - allow some wiggle room
|
|
phone_depth = 8; // 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,48.99])
|
|
difference() {
|
|
cylinder(r=holder_rad,h=90,center=true);
|
|
// cut to hollow out cup
|
|
cylinder(r=drink_rad,h=91,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,54])
|
|
rotate([0,10,10])
|
|
cube([5,20,95],center=true);
|
|
|
|
// cut other side slot for strap
|
|
translate([0,-drink_rad,54])
|
|
rotate([0,-10,10])
|
|
cube([5,20,95],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,34.99])
|
|
difference() {
|
|
cylinder_cube(cr1=2,cr2=2,ch=61,cx=phone_width+5,cy=phone_depth+5);
|
|
translate([1,0,.1])
|
|
cylinder_cube(cr1=3,cr2=3,ch=62,cx=phone_width,cy=phone_depth);
|
|
}
|
|
|
|
}
|
|
|
|
// 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();
|