1
0
mirror of https://github.com/nophead/Mendel90.git synced 2025-01-17 12:58:16 +01:00
Mendel90/scad/vitamins/ziptie.scad
2012-03-12 01:13:07 +00:00

37 lines
985 B
OpenSCAD

//
// Mendel90
//
// GNU GPL v2
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// Zipties
//
small_ziptie = [2.3, 1, [4.7, 4.25, 3], [1,1,1], 20];
function ziptie_width(type) = type[0];
function ziptie_thickness(type) = type[1];
module ziptie(type, r)
{
latch = type[2];
length = ceil(2 * PI * r + type[4] + latch[2] + 1);
vitamin(str("ZT00", length, ": Ziptie ",length));
angle = asin((latch[0] / 2) / r) - asin(ziptie_thickness(type) / latch[0]);
color(type[3]) render() union() {
tube(ir = r, or = r + ziptie_thickness(type), h = ziptie_width(type));
translate([0, -r, - latch[1] / 2])
rotate([90, 0, angle]) {
union() {
cube(latch);
translate([latch[0] / 2, latch[1] / 2, (latch[2] + 1) / 2])
cube([ziptie_thickness(type), ziptie_width(type), latch[2] + 1], center = true);
}
}
}
}
//ziptie(small_ziptie, 10);