use use use ctr_pt = [ 19.5/2, 29/2, 0]; //center point of base skew=3; //offset from center of base dim0 = [19.5, 29, 0]; //base footprint coords pts0 =[ [0,0,dim0[2]], [0,dim0[1],dim0[2]], [dim0[0],dim0[1],dim0[2]], [dim0[0],0,dim0[2]] ]; dim1 = [19.5-4, 29-4, 1.5]; //1st slice coords pts1 =[ [0,0,dim1[2]], [0,dim1[1],dim1[2]], [dim1[0],dim1[1],dim1[2]], [dim1[0],0,dim1[2]] ]; dim2 = [8, 12, 1.5+10.5]; //2nd slice coords pts2 =[ [0,0,dim2[2]], [0,dim2[1],dim2[2]], [dim2[0],dim2[1],dim2[2]], [dim2[0],0,dim2[2]] ]; dim3 = [7+5/16, 11, 1.5+10.5+12]; //3rd slice coords pts3 =[ [0,0,dim3[2]], [0,dim3[1],dim3[2]], [dim3[0],dim3[1],dim3[2]], [dim3[0],0,dim3[2]] ]; dim4 = [6+3/4, 10+3/8, 1.5+10.5+10+12+12]; //4th slice coords pts4 =[ [0,0,dim4[2]], [0,dim4[1],dim4[2]], [dim4[0],dim4[1],dim4[2]], [dim4[0],0,dim4[2]] ]; dim5 = [6+3/16, 9+5/8, 1.5+10.5+10+12+12+12]; //5th slice coords pts5 =[ [0,0,dim5[2]], [0,dim5[1],dim5[2]], [dim5[0],dim5[1],dim5[2]], [dim5[0],0,dim5[2]] ]; dim6 = [5+5/8, 9+5/8, 1.5+10.5+10+12+12+12+12]; //6th slice coords pts6 =[ [0,0,dim6[2]], [0,dim6[1],dim6[2]], [dim6[0],dim6[1],dim6[2]], [dim6[0],0,dim6[2]] ]; dim7 = [6+5/10, 9+7/8, 1.5+10.5+10+12+12+12+12+1.5]; //top slice coords pts7 =[ [0,0,dim7[2]], [0,dim7[1],dim7[2]], [dim7[0],dim7[1],dim7[2]], [dim7[0],0,dim7[2]] ]; //vertical edges patha=[ pts0[0], pts1[0]+[ctr_pt[0]-dim1[0]/2, ctr_pt[1]-dim1[1]/2, 0], pts2[0]+[ctr_pt[0]-dim2[0]/2, ctr_pt[1]-dim2[1]/2-skew, 0], pts3[0]+[ctr_pt[0]-dim3[0]/2, ctr_pt[1]-dim3[1]/2-skew, 0], pts4[0]+[ctr_pt[0]-dim4[0]/2, ctr_pt[1]-dim4[1]/2-skew, 0], pts5[0]+[ctr_pt[0]-dim5[0]/2, ctr_pt[1]-dim5[1]/2-skew, 0], pts6[0]+[ctr_pt[0]-dim6[0]/2, ctr_pt[1]-dim6[1]/2-skew, 0]]; pathb=[ pts0[1], pts1[1]+[ctr_pt[0]-dim1[0]/2, ctr_pt[1]-dim1[1]/2, 0], pts2[1]+[ctr_pt[0]-dim2[0]/2, ctr_pt[1]-dim2[1]/2-skew, 0], pts3[1]+[ctr_pt[0]-dim3[0]/2, ctr_pt[1]-dim3[1]/2-skew, 0], pts4[1]+[ctr_pt[0]-dim4[0]/2, ctr_pt[1]-dim4[1]/2-skew, 0], pts5[1]+[ctr_pt[0]-dim5[0]/2, ctr_pt[1]-dim5[1]/2-skew, 0], pts6[1]+[ctr_pt[0]-dim6[0]/2, ctr_pt[1]-dim6[1]/2-skew, 0]]; pathc=[ pts0[2], pts1[2]+[ctr_pt[0]-dim1[0]/2, ctr_pt[1]-dim1[1]/2, 0], pts2[2]+[ctr_pt[0]-dim2[0]/2, ctr_pt[1]-dim2[1]/2-skew, 0], pts3[2]+[ctr_pt[0]-dim3[0]/2, ctr_pt[1]-dim3[1]/2-skew, 0], pts4[2]+[ctr_pt[0]-dim4[0]/2, ctr_pt[1]-dim4[1]/2-skew, 0], pts5[2]+[ctr_pt[0]-dim5[0]/2, ctr_pt[1]-dim5[1]/2-skew, 0], pts6[2]+[ctr_pt[0]-dim6[0]/2, ctr_pt[1]-dim6[1]/2-skew, 0]]; pathd=[ pts0[3], pts1[3]+[ctr_pt[0]-dim1[0]/2, ctr_pt[1]-dim1[1]/2, 0], pts2[3]+[ctr_pt[0]-dim2[0]/2, ctr_pt[1]-dim2[1]/2-skew, 0], pts3[3]+[ctr_pt[0]-dim3[0]/2, ctr_pt[1]-dim3[1]/2-skew, 0], pts4[3]+[ctr_pt[0]-dim4[0]/2, ctr_pt[1]-dim4[1]/2-skew, 0], pts5[3]+[ctr_pt[0]-dim5[0]/2, ctr_pt[1]-dim5[1]/2-skew, 0], pts6[3]+[ctr_pt[0]-dim6[0]/2, ctr_pt[1]-dim6[1]/2-skew, 0]]; //profiles of 4 sides ctrl_pts1=[ //[ patha[0], pathb[0] ], [ patha[1], pathb[1] ], [ patha[2], pathb[2] ], [ patha[3], pathb[3] ], [ patha[4], pathb[4] ], [ patha[5], pathb[5] ], [ patha[6], pathb[6] ] ]; ctrl_pts2=[ //[ pathb[0], pathc[0] ], [ pathb[1], pathc[1] ], [ pathb[2], pathc[2] ], [ pathb[3], pathc[3] ], [ pathb[4], pathc[4] ], [ pathb[5], pathc[5] ], [ pathb[6], pathc[6] ] ]; ctrl_pts3=[ //[ pathc[0], pathd[0] ], [ pathc[1], pathd[1] ], [ pathc[2], pathd[2] ], [ pathc[3], pathd[3] ], [ pathc[4], pathd[4] ], [ pathc[5], pathd[5] ], [ pathc[6], pathd[6] ] ]; ctrl_pts4=[ //[ pathd[0], patha[0] ], [ pathd[1], patha[1] ], [ pathd[2], patha[2] ], [ pathd[3], patha[3] ], [ pathd[4], patha[4] ], [ pathd[5], patha[5] ], [ pathd[6], patha[6] ] ]; //start of assembly code ... thickness = 0.1; t_step = 0.05; bezier = function(points) bezier_curve(t_step, points); cube([dim0[0], dim0[1], dim1[2]]); //base plate sf_thicken(sf_splines(ctrl_pts1, bezier), thickness); sf_thicken(sf_splines(ctrl_pts2, bezier), thickness); sf_thicken(sf_splines(ctrl_pts3, bezier), thickness); sf_thicken(sf_splines(ctrl_pts4, bezier), thickness); translate([ctr_pt[0]-dim7[0]/2, ctr_pt[1]-dim2[1]/2-(dim7[1]-dim6[1])/2-1.75, 68.25+1.5]) cube([6+5/10, 9+7/8, 1], center=false); //top pate