//Norman McGeoch 2022 //FinCan Generator for model rocketry //overall base length including LE and TE. Sum of LE and TE must not exceed overall length. BaseL=150.1; //Leading edge length at base BaseLE=25.1; //Trailing edge length at base BaseTE=25.1; //Width at base LE and TE junctions BaseWLE=8.3; BaseWTE=8.3; //Length of fin at top including LE and TE. Sum of LE and TE must not exceed Top(Tip) length. TopL=45.1; //LE and TE. Sum must not exceed overall length. TopLE=15.1; TopTE=15.1; TopWLE=2.1; TopWTE=2.1; //Height of fin at front,LE-Mid Jn,Mid-TE Jn, Rear edge of TE TopHLE=54.1; TopHLE2=54.1; TopHTE2=54.1; TopHTE=54.1; //distance from Base Leading edge to topLE in X dir TopLStart=80.1; //Radius of fillet at root of fin FilletR=6.1; //Changes the length of the leading edge of the fillet and TE FilletLEMultiplier=3.1; FilletTEMultiplier=1.1; //Sets shape of the fillet 1 triangular, 0.6 Std OK FilletShape=0.6; FinCanWall=1.8; FinCanID=63.5; TubeR=FinCanID/2+FinCanWall; FinNumber=3; //This is used to ensure the edge of fin is printable. Should be a multiple of printing wall width FinMinWidth=0.9; FinMinW=FinMinWidth/2; FinCanLELen=2.1; FinCanLERchng=2.1; FinCanTELen=2.1; FinCanTERchng=2.1; //Used to increase OD of tube if there are any issues with mesh for STL..... Shouldn't need it but JustInCase TubeFudge=0;//[0:0.01:1] module FinSide(){translate([0,0,FilletR-0.01])hull(){linear_extrude(0.01)polygon([[0,0],[0,FinMinW],[BaseLE,BaseWLE/2],[BaseL-BaseTE,BaseWTE/2],[BaseL,FinMinW],[BaseL,0]]); translate([TopLStart,0,0]){hull(){ //1 translate([0,0,TopHLE])sphere(0.01); //1.5 translate([0,FinMinW,TopHLE])sphere(0.01); //2 translate([TopLE/2,TopWLE/2,(TopHLE+TopHLE2)/2])sphere(0.01); //3 translate([TopLE,TopWLE,TopHLE2])sphere(0.01); //4 translate([TopL-TopTE,TopWTE,TopHTE2])sphere(0.01); //5 translate([TopL-TopTE/2,TopWTE/2,(TopHTE2+TopHTE)/2])sphere(0.01); //5.5 translate([TopL,FinMinW,TopHTE])sphere(0.01); //6 translate([TopL,0,TopHTE])sphere(0.01); //7 translate([TopL-TopTE/2,0,(TopHTE2+TopHTE)/2])sphere(0.01); //8 translate([TopL-TopTE,0,TopHTE2])sphere(0.01); //9 translate([TopLE,0,TopHLE2])sphere(0.01); //10 translate([TopLE/2,0,(TopLE+TopHLE2)/2])sphere(0.01);}}}} //Fillet section. Creates trianguler fillets. This is a BAD fillet....... /* ***Old Bad Fillet Section***** module BadFillet(){ hull(){ hull(){translate([0,0,FilletR])linear_extrude(0.01)polygon([[0,0],[BaseLE,BaseWLE/2],[BaseL-BaseTE,BaseWTE/2],[BaseL,0]]); translate([0,0,0])hull(){linear_extrude(0.01)polygon([[0-FilletLEMultiplier*FilletR,0],[BaseLE,FilletR+BaseWLE/2],[BaseL-BaseTE,FilletR+BaseWTE/2],[BaseL+FilletTEMultiplier*FilletR,0]]); }}}} *****New halved fillet with FilletShape Active below***** */ module FilletTop(){ hull(){ translate([0,0,FilletR+0.01])hull(){linear_extrude(0.01)polygon([[0,0],[0,FinMinW],[BaseLE,BaseWLE/2],[BaseL-BaseTE,BaseWTE/2],[BaseL,FinMinW],[BaseL,0]]);} translate([0,0,FilletR/2-0.01])hull(){linear_extrude(0.01)polygon([[0-(FilletLEMultiplier*FilletR)/2,0],[0-(FilletLEMultiplier*FilletR)/2,FinMinW],[BaseLE,(FilletR*FilletShape/2+BaseWLE/2)], [BaseL-BaseTE,(FilletR*FilletShape/2+BaseWTE/2)],[BaseL+FilletTEMultiplier*FilletR/2,FinMinW],[BaseL+FilletTEMultiplier*FilletR/2,0]]); }} } module FilletBot(){ hull(){ translate([0,0,FilletR/2-0.02])hull(){linear_extrude(0.01)polygon([[0-(FilletLEMultiplier*FilletR)/2,0],[0-(FilletLEMultiplier*FilletR)/2,FinMinW],[BaseLE,(FilletR*FilletShape/2+BaseWLE/2)], [BaseL-BaseTE,(FilletR*FilletShape/2+BaseWTE/2)],[BaseL+FilletTEMultiplier*FilletR/2,FinMinW],[BaseL+FilletTEMultiplier*FilletR/2,0]]); } hull(){linear_extrude(0.01)polygon([[0-FilletLEMultiplier*FilletR,0],[0-FilletLEMultiplier*FilletR,FinMinW],[BaseLE,FilletR+BaseWLE/2],[BaseL-BaseTE,FilletR+BaseWTE/2],[BaseL+FilletTEMultiplier*FilletR,FinMinW],[BaseL+FilletTEMultiplier*FilletR,0]]); } }} module BadFillet(){union(){FilletTop();FilletBot();}} //Fin Left and Right halves module FinL(){union(){ FinSide(); BadFillet();}} module FinR(){union(){ mirror([0,1,0])FinSide(); mirror([0,1,0])BadFillet();}} module FullFin(){translate([FilletR*FilletLEMultiplier,0,0]){ FinL(); FinR();}} //FinL(); // FullFin(); //Offset required for tube to mate Offset=TubeR-sqrt(TubeR*TubeR-(FilletR+max(BaseWLE,BaseWTE)/2)*(FilletR+max(BaseWLE,BaseWTE)/2)); //rotate fin vertical and offset fot fin can OD module FinRotated(){translate([TubeR-Offset-.01,0,BaseL+FilletR*(FilletLEMultiplier+FilletTEMultiplier)])rotate([0,90,0])FullFin();} module FinScarfed(){ difference(){ FinRotated(); cylinder(h=BaseL+FilletR*(FilletLEMultiplier+FilletTEMultiplier),d=2*TubeR,center=false,$fn=120);}} module Pos(){union(){ //multiply the fins for(i=[1:FinNumber])rotate([0,0,360/FinNumber*i])FinRotated(); //add the walls of the fin can cylinder(h=BaseL+FilletR*(FilletLEMultiplier+FilletTEMultiplier),d=2*TubeR+TubeFudge,center=false,$fn=120); //add Fin Can LE taper translate([0,0,BaseL+FilletR*(FilletLEMultiplier+FilletTEMultiplier)])cylinder(h=FinCanLELen,d1=2*TubeR+0.02,d2=2*TubeR-FinCanLERchng*2,center=false,$fn=120); //add Fin Can TE taper translate([0,0,-FinCanTELen])cylinder(h=FinCanTELen,d1=2*TubeR+0.02-FinCanTERchng*2,d2=2*TubeR,center=false,$fn=120);}} module Neg(){ translate([0,0,-FinCanTELen-0.1]) cylinder(h=BaseL+FilletR*(FilletLEMultiplier+FilletTEMultiplier+FinCanLELen+FinCanTELen)+0.2,d=FinCanID,center=false,$fn=120);} difference(){ Pos(); Neg();}