OpenSCAD for bowl handle

From Wildsong
Jump to navigationJump to search
id = 36;
od = id + 15;
ih = 3;
oh = ih+3;
pin_t = 3;
wall_t = 3;

module knob(d,hgt,mink) {
	translate([0,0,mink])
	minkowski() {
		cylinder(r=d/2, h=hgt);
		sphere(mink);
	}
}

module tube(od,id,hgt) {
    difference() {
        cylinder(r=od/2,h=hgt);
        translate([0,0,-0.1]) cylinder(r=id/2,h=hgt + 0.2);
    };
}

module hollow_knob() {
	difference() {
		knob(od,ih,4);
		union(){	
			translate([0,0,oh-ih+.1]) cylinder(r=od/2-4, h=20); // hollow
			translate([0,0,-1])cylinder(r=16,h=20); // hole in top
		}
	}
}
module partone() {
	hollow_knob();
	translate([0,0,.1]) tube(id+pin_t+wall_t+3, 40, 15);
}

module pins(hgt) {
	for (r = [-180, -150, -120, -90, -60, -30, 0, 30, 60, 90, 120, 150, 180]) 
		rotate([0,0,r]) translate([id/2, 0, hgt/2]) cube([pin_t,8,hgt],true);
}

module strip(hgt) {
	$fs=.1;
	idl = id + 3;
	difference() {
		for (r = [1,2,3,4,5,6,7,8,9,10])
			translate([(r-4)*12-19,0,pin_t/2+1])cube([5,hgt,pin_t],true);
		scale([1,1,1.3]) translate([-75,2,3]) rotate([0,90,0]) cylinder(r=1.5,h=150);
	}
	translate([0,0,1/2])cube([idl*3.14,hgt,1],true);
}

module inner_circle() {
	$fs=.1;
	l = id*5;
	difference() {
		pins(11);
		translate([0,0,3]) knob(id-2,2,2);
	}
	tube(id+2,id-8,3);
}

module model() {
	base_h = 3.5;
	cylinder(r=30/2, h=base_h);
	translate([0,0,base_h])cylinder(r=id/2, h=3);
}


print_pla = 1;
print_nylon = 1;

color("DarkGrey") model();
translate([0,0,11+4])rotate([180,0,0])
union() {
   if (print_pla == 1) {
		translate([0,0,-50]) color("LightBlue") partone();
	}
   if (print_nylon == 1) {
//		color("White") translate([0,0,4]) strip(11);
		translate([0,0,-25]) color("Yellow") translate([0,0,4]) inner_circle(11);
   }
}