droidcam-with-octoprint/phone-mount/phone mount.scad
2023-10-01 14:40:20 +02:00

63 lines
1.9 KiB
OpenSCAD

$fn = 25;
width = 153;
height = 80;
depth = 10;
holder_width = 50;
thickness = 2;
hole_diameter = 21;
hole_depth = 30;
angle = 7.5;
// stolen from openscad wiki
module prism(l, w, h) {
polyhedron(//pt 0 1 2 3 4 5
points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],
faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]
);
}
// iphone
// # cube([width, depth, height]);
translate([holder_width / 2, -thickness, -thickness]) {
cube([holder_width, thickness, height + 2*thickness]);
// Top grabber
translate([0, 0, height + thickness]) {
cube([holder_width, depth+ 2*thickness, thickness]);
translate([0, depth + thickness, -thickness]) {
cube([holder_width, thickness, 2*thickness]);
}
}
// Bottom grabber
translate([0, 0, 0]) {
cube([holder_width, depth+ 2*thickness, thickness]);
translate([0, depth + thickness, 0]) {
cube([holder_width, thickness, 2*thickness]);
}
}
// Hole
w = (hole_depth) * sin(angle) / sin(90 - angle);
rotate([-angle, 0, 0])
translate([holder_width / 2, -(hole_diameter + thickness*2) / 2 - w, hole_depth / 2]) {
difference() {
group() {
cylinder(d = hole_diameter + thickness*2, h = hole_depth, center = true);
rotate([180, 180, 0])
translate([-(hole_diameter + thickness*2) / 2, -(hole_diameter + thickness*2) / 2, -hole_depth / 2]) {
cube([hole_diameter + thickness*2, (hole_diameter + thickness*2) / 2, hole_depth]);
translate([0, -w, 0]) {
prism(l = hole_diameter + thickness*2, w = w, h = 30);
}
}
}
translate([0, 0, -thickness*2]) {
cylinder(d = hole_diameter, h = hole_depth, center = true);
}
}
}
}