initial work for integrating sbc model framework v2

This commit is contained in:
Edward Kisiel
2024-01-29 17:40:12 -05:00
parent d5674f9f24
commit adf72494a1
29 changed files with 5959 additions and 6978 deletions

48
lib/fastener.scad Normal file
View File

@@ -0,0 +1,48 @@
/*
m_insert(type="M3", icolor = "#ebdc8b")
*/
module m_insert(type="M3", icolor = "#ebdc8b") { //#f4e6c3, #ebdc8b
odiam = type == "M3" ? 4.2 : 3.5;
idiam = type == "M3" ? 3 : 2.5;
iheight = 4;
difference() {
color(icolor,.6) cylinder(d=odiam, h=iheight);
color(icolor,.6) translate([0,0,-1]) cylinder(d=idiam, h=iheight+2);
}
for(bearing = [0:10:360]) {
color(icolor) translate([-.25+(odiam/2)*cos(bearing),-.25+(odiam/2)*sin(bearing),iheight-1.5])
rotate([0,0,0]) cube([.5,.5,1.5]);
}
}
// General purpose screw
// screw(screw[d, l, style])
// d - thread diameter
// l - thread length
// style - screw head style
//
// Styles:
// 0 - Mushroom head, 5mm diameter
module screw(screw_type) {
d = screw_type[0];
l = screw_type[1];
style = screw_type[2];
// Head
if(style == 0) {
difference() {
translate([ 0, 0, -0.3]) sphere(2.7);
translate([-10,-10,-10]) cube([20,20,10]);
translate([-10,-10, 2]) cube([20,20,10]);
}
}
// Thread
rotate([180,0,0]) cylinder(d=d, h=l);
}