// This a generator for a comb to measure the optimal clearance for friction fit joints. // Author: Roland Grichnik (r.grichnik@googlemail.com) // Date of Creation: 2022-02-12 use <../laserSlot/laserSlot.scad> //length = 100; overcut = 0.00005; //needed to fix kerfs not cut all the way to the edge all the time when edges are incidental width = 50; outlineFilletRadius = 3; nSlots = 10; materialType = "Cardboard, corrugated"; materialWidth = 1.51; laserKerf = 0.21; increment = 0.025; incrementStart = -5; baseWidth = materialWidth+(incrementStart)*increment; spacing = max(10,baseWidth*2); combTextEdgeClearance = 2; labelTextEdgeClearance = 3; combTextScaling = 1.01; combTextSize = 3*combTextScaling; labelTextSize = 3; labelTextLineSpacing = 2.0; linesOfText = 3; labelTextLength = linesOfText*labelTextSize+(linesOfText-1)*(labelTextLineSpacing-1)*labelTextSize; labelArea = true; length = spacing*(nSlots+1)+(labelArea?labelTextLength:0)+labelTextEdgeClearance; cornerCircleDiameter = 1.01; chamferAngle = 60; chamferLength = 1.5; module laserClearanceComb(offsetForKerf=false){ module outline(){ offset(outlineFilletRadius,$fn=16) offset(-outlineFilletRadius) square([length,width]); } module slots(){ for(i=[1:nSlots]){ translate([-baseWidth/2+i*spacing,-overcut]) rotate(-90) #slot(width=baseWidth+(i-1)*increment,length=width/2,chamferLength=chamferLength,chamferAngle=chamferAngle,cornerCircleDiameter=cornerCircleDiameter,flipX=false); } } module slotLabels(){ for(i=[1:nSlots]){ value = (i-1+incrementStart)*increment; textString = str(materialWidth+value," (",value<=0?"":"+",value,")"); translate([-baseWidth/2+i*spacing-combTextSize/2,width/2+combTextEdgeClearance]) rotate(-90) text(textString,size=combTextSize,halign="right"); } } difference(){ offset(offsetForKerf?laserKerf/2:0,$fn=16) difference(){ outline(); slots(); } slotLabels(); textBlock = [materialType, str("h = ", materialWidth, " mm"), str("kerf = ", laserKerf, " mm")]; echo(textBlock); textString = textBlock[0]; echo(textString); for(i=[0:len(textBlock)-1]){ translate([length-labelTextSize-(i)*labelTextSize*labelTextLineSpacing-labelTextEdgeClearance,width-labelTextEdgeClearance,0]) rotate(-90) text(textBlock[i],size=labelTextSize,halign="left"); } } echo([length,width]); } laserClearanceComb(offsetForKerf=true);