(dp1 S'shapes' p2 (lp3 sS'text' p4 Vfrom koko.lib.shapes import *\u000a\u000a# Render boundaries\u000acad.xmin = 0\u000acad.xmax = 4*12\u000acad.ymin = 0\u000acad.ymax = 8*12\u000acad.mm_per_unit = 25.4 # inch units\u000a\u000azstock = .43 # this wound up being a bit too loose\u000ase = .125 # extends the slot, to account for tool radius\u000abase_height = 3.1\u000abase_length = 3.8*12\u000atop_height = 7.5\u000atop_length = 3.7*12\u000atop_offset = 4\u000astaple_wid = 6\u000aangle = 5\u000astaple_up = 5\u000awidth = 10\u000aslot_space = [1, 1.5+(width-2)/3, 1.5+2*(width-2)/3, width-1]\u000acham = .05\u000adc = .1\u000a\u000atr = triangle(0,0,0,top_offset+top_height, base_length/2,0)\u000aside = move(rotate(rectangle(0,top_length, 0,top_height), angle), 0, top_offset)\u000aside = side+rectangle(0,base_length, 0,base_height)\u000aside = side+tr-rectangle(-10, 0, 0, 20)\u000aTwoSides = 17+top_offset+top_height\u000a\u000a\u000aslant_height = top_height*cos(angle*2*pi/360)\u000aNstaples = 8\u000adstaple = 2\u000atabs = rectangle(0,0,0,0)\u000afor i in range(Nstaples):\u000a i = i+1\u000a x = base_length - 2-i*dstaple\u000a step = x*sin(angle*2*pi/360)/cos(angle*2*pi/360)\u000a height = top_offset+slant_height+step\u000a staple_len = height-staple_up\u000a staple = rectangle(0, slant_height, 0, width)\u000a stab = rectangle(slant_height, staple_len, width/2-staple_wid/2, width/2+staple_wid/2)\u000a staple = staple + stab\u000a sls = rectangle(0,0,0,0)\u000a for j in [0, 3]:\u000a sls = sls+slot(slant_height, slot_space[j], zstock, slant_height/2+se, -90, cham)\u000a for j in [1, 2]:\u000a sls = sls+slot(staple_len, slot_space[j], zstock, slant_height/2+staple_len-slant_height+se, -90, cham)\u000a staple = staple - sls\u000a sl = slot(x,height+dc, zstock, slant_height/2+se, chamfer = cham)\u000a side = side-sl\u000a if i <5:\u000a tabs = tabs+move(staple, 1+(staple_len+2)*(i-1), 2*TwoSides+1)\u000a else:\u000a tabs = tabs+move(staple, 1+(staple_len+2)*(i-5), 2*TwoSides+width+2)\u000a\u000a\u000aNplates = 4\u000adplate = 2\u000aplates = rectangle(0,0,0,0); \u000afor i in range(Nplates):\u000a i = i+1\u000a x = i*(dplate)\u000a step = x*sin(angle*2*pi/360)/cos(angle*2*pi/360)\u000a y = top_offset+slant_height+step\u000a plate = rectangle(0,width, 0,y)\u000a plate = plate + rectangle(0, width, y+.5, y+.5+base_height)\u000a sls = rectangle(0,0,0,0)\u000a sls1 = rectangle(0,0,0,0)\u000a for j in range(4):\u000a sls = sls+slot(slot_space[j], y, zstock, y/2+se, 0, cham)\u000a sls1 = sls1+slot(slot_space[j], y+.5, zstock, base_height/2+se, 180, cham*4)\u000a plate = plate-sls-sls1\u000a plates = plates+move(plate, 1+(i-1)*(width+1), 8*12-y-1-base_height)\u000a sl = slot(x,y+dc, zstock, y/2+dc+se, chamfer = cham)\u000a sl = sl+slot(base_length-x, base_height+dc, zstock, base_height/2+dc+se, 0, cham*4)\u000a side = side-sl\u000a\u000a\u000asides = move(side, 1,1)\u000asides = sides+move(rotate(side, 180), base_length+1, 17+top_offset+top_height)\u000asides = sides+move(sides, 0, TwoSides)\u000aparts = sides+tabs+plates\u000astock = rectangle(0, 4*12, 0, 8*12)\u000ah = parts\u000acad.function = h#move(plates, 0, -(8*12-y-1-base_height)+1)\u000a#move(tabs,0,-2*TwoSides+1)#move(rotate(side, 180), base_length+1, 17+top_offset+top_height)#h#move(side,1,1) p5 s.