All pastes #3568267 Raw Edit

Anonymous

public unlisted javascript v1 · immutable
#3568267 ·published 2016-04-22 18:43 UTC
rendered paste body
// create the tool options// for alum//var tool = {units:'mm',diameter:6.35/2,passDepth:1,step:1,rapid:2000,plunge:50,cut:180,zClearance:5,returnHome:true};// for plastic//var tool = {units:'mm',diameter:6.35/2,passDepth:3,step:1,rapid:2000,plunge:150,cut:400,zClearance:5,returnHome:true};// for waterjetvar tool = {units:'mm',diameter:.5/2,passDepth:1,step:1,rapid:2000,plunge:50,cut:180,zClearance:0,returnHome:true};// setup a new Millcrum object with that toolvar mc = new Millcrum(tool);// set the surface dimensions for the viewer// 4x8 sheet//mc.surface(2438,1219);mc.surface(90,90);// the plate is 10mm thick// aluminum plate is precisely 10mm thick, so a fullCut of 12 and a tabHeight of 3 leaves 1mm thick tabs// for plastic sheets, I find that they are closer to 9mm thick, so it's safer to increase tabHeight to 3.8var fullCut = 1;var tabHeight = 1;var useTabs = false;// for abs the 1/4" mica rods fit tightly with a 6.45mm hole// for aluminum they need a 6.55mm holemicaRodD = 6.55;// there are 6 pieces for a complete hotend// (2) heaterBlock// (2) sidePlate// verticalPlate// topPlatevar c = 0;var v = 0;// loop if you want to cut a full 4x8 sheet of them, waterjetters//for (c=0; c<27; c++) {	// horizontal 27	//for (v=0; v<13; v++) {		// vertical		heaterBlock((c*90)+0,(v*90)+0);		heaterBlock((c*90)+30,(v*90)+0);		heaterBlock((c*90)+60,(v*90)+0);		sidePlate((c*90)+0,(v*90)+25);		sidePlate((c*90)+45,(v*90)+25);		verticalPlate((c*90)+0,(v*90)+65);		topPlate((c*90)+0,(v*90)+50);	//}//}// there are 3 pieces for a complete extruder// extruderPlate// filamentTensioner// bowdenPlate//extruderPlate(10,120);//extruderPlate(10,170);//filamentTensioner(100,10);//filamentTensioner(85,70);// get the gcodemc.get();function sidePlate(x,y) {	// this holds the mica rods which mount the hotends	// screw holes	var h = {type: 'circle', r:6.35/4};	h.r = micaRodD/2;	mc.cut('inside', h, fullCut, [x+35-5,y+6]);	mc.cut('inside', h, fullCut, [x+15,y+6]);	var sideplate = {type:'rect',name:'side plate',xLen:36,yLen:20};	mc.cut('outside', sideplate, fullCut, [x,y], {tabs: useTabs, tabHeight: tabHeight});}function extruderPlate(x,y) {	// this is a plate for a bowden extruder	// screw holes	var h = {type: 'circle', r:6.35/4};	// extruder mount plate holes	// to mount plate	mc.cut('inside', h, fullCut, [x+10,y+(42/2)-(31/2)]);	mc.cut('inside', h, fullCut, [x+10,y+(42/2)+(31/2)]);	h.r = 6/2;	mc.cut('inside', h, fullCut, [x+10,y+(42/2)-(31/2)]);	mc.cut('inside', h, fullCut, [x+10,y+(42/2)+(31/2)]);	// to mount stepper	// center of nozzle is (23/2)+17=28.5 to center from mount side	// 4 mount holes for stepper, 31mm center to center	h.r = 6.35/4;	mc.cut('inside', h, fullCut, [x+38.5-(31/2),y+(42/2)-(31/2)]);	mc.cut('inside', h, fullCut, [x+38.5-(31/2),y+(42/2)+(31/2)]);	mc.cut('inside', h, fullCut, [x+38.5+(31/2),y+(42/2)-(31/2)]);	mc.cut('inside', h, fullCut, [x+38.5+(31/2),y+(42/2)+(31/2)]);	// countersink these by 3mm and you can use 10mm screws to hold the steppers instead of 12	h.r = 6/2;	mc.cut('inside', h, 3, [x+38.5-(31/2),y+(42/2)-(31/2)]);	mc.cut('inside', h, 3, [x+38.5-(31/2),y+(42/2)+(31/2)]);	mc.cut('inside', h, 3, [x+38.5+(31/2),y+(42/2)-(31/2)]);	mc.cut('inside', h, 3, [x+38.5+(31/2),y+(42/2)+(31/2)]);	// this is the radius of the point at which the extruder gear touches the filament	// you can change this when using a different extruder gear	var extruderGearRadius = 6.1/2;	// center of stepper	h.r = 23/2;	mc.cut('inside', h, fullCut, [x+38.5,y+(42/2)]);	// sliding filament tightener which moves bearing	var slider = {type:'rect',xLen:15,yLen:5,name:'slider',cornerRadius:2};	mc.cut('inside', slider, fullCut, [x+65,y+(42/2)-(slider.yLen/2)-10]);	mc.cut('inside', slider, fullCut, [x+65,y+(42/2)-(slider.yLen/2)+10]);	var eplate = {type:'rect',name:'extruder plate',xLen:90,yLen:42};	mc.cut('outside', eplate, fullCut, [x,y], {tabs: useTabs, tabHeight: tabHeight});}function heaterBlock(x,y) {	// screw holes	var h = {type: 'circle', r:6.35/4};	// mica rods in heater block, at the top to dissapate the maximum amount of heat around the bowden	h.r = micaRodD/2;	mc.cut('inside', h, fullCut, [x+25-5,y+20-6]);	mc.cut('inside', h, fullCut, [x+5,y+20-6]);	// thermistor is drilled on the side of the plate with a press	// it goes on the opposite side of the heater block	// heater cartridge in heater block	// 6mm in diameter	h.r = 6/2;	mc.cut('inside', h, fullCut, [x+5,y+5]);	// heater block 25x20mm	var hb = {type:'rect',xLen:25,yLen:20,name:'heater block'};	mc.cut('outside', hb, fullCut, [x,y], {tabs: useTabs, tabHeight: tabHeight});}function topPlate(x,y) {	// this plate acts as a stress relief for the bowden tubes	// screw holes	var h = {type: 'circle', r:6.35/4};	// top plate holes	// these are for the plates which hold the steppers	mc.cut('inside', h, fullCut, [x+5,y+5]);	mc.cut('inside', h, fullCut, [x+64-5,y+5]);	if (fullCut > 1) {		// they need to be countersunk		h.r = 6/2;		mc.cut('inside', h, 4, [x+5,y+5]);		mc.cut('inside', h, 4, [x+64-5,y+5]);	}	// these are for the bowden tubes, chamfer them	h.r = 4.1/2;	mc.cut('inside', h, fullCut, [x+21,y+5]);	mc.cut('inside', h, fullCut, [x+64-21,y+5]);	// vertical mount	var hb = {type:'rect',xLen:64,yLen:10,name:'vertical mount'};	mc.cut('outside', hb, fullCut, [x,y], {tabs: useTabs, tabHeight: tabHeight});}function verticalPlate(x,y) {	// screw holes	var h = {type: 'circle', r:6.35/4};	// vertical plate holes	// these are for the plates which hold the steppers	mc.cut('inside', h, fullCut, [x+5,y+5]);	mc.cut('inside', h, fullCut, [x+64-5,y+5]);	mc.cut('inside', h, fullCut, [x+5,y+20-5]);	mc.cut('inside', h, fullCut, [x+64-5,y+20-5]);	if (fullCut > 1) {		// they need to be countersunk		h.r = 6/2;		mc.cut('inside', h, 4, [x+5,y+5]);		mc.cut('inside', h, 4, [x+64-5,y+5]);		mc.cut('inside', h, 4, [x+5,y+20-5]);		mc.cut('inside', h, 4, [x+64-5,y+20-5]);	}	// these are for actually mounting the vertical plate to the machine	// they are 34mm center to center	h.r = 3.175/2;	mc.cut('inside', h, fullCut, [x+15,y+5]);	mc.cut('inside', h, fullCut, [x+64-15,y+5]);	mc.cut('inside', h, fullCut, [x+15,y+20-5]);	mc.cut('inside', h, fullCut, [x+64-15,y+20-5]);	// vertical mount	var hb = {type:'rect',xLen:64,yLen:20,name:'vertical mount'};	mc.cut('outside', hb, fullCut, [x,y], {tabs: useTabs, tabHeight: tabHeight});}function filamentTensioner(x,y) {	// screw holes	var h = {type: 'circle', r:6.35/4};	// m3 bearing hole	mc.cut('inside', h, fullCut, [x+39,y+21]);	// it's countersunk so that the m3 head can sit between the tensioner plate and the extruder mount plate	// then a nylock goes on the outside to hold the bearing in place	h.r = 6/2;	mc.cut('inside', h, 4, [x+39,y+21]);	h.r = 5/2;	mc.cut('inside', h, fullCut, [x+42-28,y+(42/2)-10]);	mc.cut('inside', h, fullCut, [x+42-28,y+(42/2)+10]);	// t plate	var t = {type:'polygon',name:'tensioner plate',points:[[0,10],[10,0],[17,0],[27,10],[27,16],[42,16],[42,26],[27,26],[27,32],[17,42],[10,42],[0,32]]};	mc.cut('outside', t, fullCut, [x,y], {tabs: useTabs, tabHeight: tabHeight});}