PinePhoneBoy/src/common.scad

23 wiersze
555 B
OpenSCAD

2021-01-20 14:55:17 +00:00
use <BOSL/shapes.scad>
include <BOSL/constants.scad>
module cubi(s, fillet=0, edges=EDGES_ALL) {
if ($preview) {
cube(s, center=true);
} else {
cuboid(s, fillet=fillet, edges=edges);
}
}
2021-01-21 21:06:48 +00:00
module screwhole(d, h, head=true) {
$fn=$preview ? 5 : 20;
translate([0, 0, h]) cylinder(d=d*1.5, h=d*0.5);
split=h*0.5;
translate([0, 0, split]) cylinder(d=d, h=(h-split));
cylinder(d2=d, d1=d*0.1, h=split);
cylinder(d2=d*0.6, d1=d*0.6, h=split/2);
}
2021-01-21 08:59:55 +00:00
function vec_sum(v, w) = [v.x + w.x, v.y + w.y, v.z + w.z];