#Trying to make some nice and interesting curves to laser cut for press fit kit #Figure out what image type to export as...and how to add the notches after #probably bring an image into Inkscape then deal with it. #aa=width #bb=depth bmp(filename = "C:/Users/LLPstudent/Desktop/cosine.bmp", width = 850, height = 480) #aa is the width of the cut #bb is the depth of the cut aa<-.3 bb<-.55 shift<-2 xmin<--2*pi-pi/2 xmax<-2*pi+3*pi/2 curve(cos(x), xmin, xmax, ylim=c(-1, 6.5), axes=FALSE, xlab="", ylab="") #curve(cos(x), xmin, xmax, ylim=c(-1, 6.5)) curve(shift+cos(x), xmin, xmax, add=TRUE) for (i in c(-3:3)){ rect(pi*i-aa/2, cos(pi*i), pi*i+aa/2, cos(pi*i)+bb, col="black") rect(pi*i-aa/2, shift+cos(pi*i)-bb, pi*i+aa/2, shift+cos(pi*i), col="black") } segments(xmin, cos(xmin), xmin, cos(xmin)+shift) segments(xmax, cos(xmax), xmax, cos(xmax)+shift) rect(xmin, cos(xmin)+shift/2-aa/2, xmin+bb, cos(xmin)+shift/2+aa/2, col="black") rect(xmax-bb, cos(xmax)+shift/2-aa/2, xmax, cos(xmax)+shift/2+aa/2, col="black") #Also make some random rectangles that will help us connect these if we so choose #should have the width of 2*sloth depth and not too much height (a bit more than slot width) #just put it somewhere somewhat out of the way x1<-2.2*bb y1<-3.3 for (i in -3:3) rect(x1*i, y1, x1*i+2*bb, y1+1.75*aa) #Make some long rectangles too of the correct width (slot depth times two) #Eventually these should maybe have some notches in them y2<-4.1 rect(xmin, y2, xmax, y2+2*bb) y2<-5.3 rect(xmin, y2, xmax, y2+2*bb) dev.off() #