/* ******************************************* Objekt Info: Profilsysteme ******************************************* Version: 13.09.2023 khf ******************************************* */ //*************** Auswahl ************* /*Auswahl 0=Demo, 1=tslot(h=10,w=10); 2=tslot(h=10,w=15); 3=tslot(h=10,w=20); 4=tslot(h=10,w=25); 5=tslot(h=10,w=30); 6=tslot(h=10,w=40); 7=tslot(model="halfslot1",h=10,w=20); 8=tslot(model="halfslot2",h=10,w=20); 9=twotslot(h=10,w=40); 10=twotslot(model="twoslot2",h=10,w=25); 11=tslot(model="tslot2",h=10,w=10); 12=tslot(model="tslot2",h=10,w=20); 13=tslot(model="tslot2",h=10,w=30); 14=tnut(h=10,w=30); 15=tnut(model="nut2",h=10,w=30); 16=tnut(model="nut3",h=10,w=30); 17=pulley(); 18=sideg90(); 19=twosidel90(90); //(Winkelangabge) 20=support908(); 21=support904(); 22=support902(); 23=support901(w=30); 24=xyztslot(); 25=elbow8m(); 26=tap(); 27=boltm8(mm=16); 28=corner90(); 29=nutholder(); 30=nut(); 31=ecke(); */ auswahl="0"; //*************** Libraries ************ file_dxf="Profilsystem.dxf"; //***************************************** //*************** Parameter ************* tslotw=100; //Groesse //Parameter Ecke beamWidth = 10.012; border = 2; totBeamWidth =(2* border) + beamWidth; depth = 3; width = 3; factor = 1.5; innnerCalibraition = 0.1; //***************************************** //************** Programm ************** //twosidel90(r=90); module pulley(w=tslotw){ translate([0,-w/2,0]) union(){ support901(w=w); translate([0,0,-w/2])rotate([-90,0,0])tnut(h=22,w=w); } } //pulley(); //----------------------------------------- module telescope(h=5,w=tslotw){ rotate([0,90,0])fourslots(h=h,w=w); difference(){ cube([w*1.1,w*1.1,h],true); cube([w,w,h*1.2],true); } } //telescope(h=5); //----------------------------------------- module tnut(model="nut",h=10,w=tslotw){ translate([-w/2,-w/2,-h/2])scale([0.1*w,0.1*w,1]) linear_extrude(height=h)import( file=file_dxf, layer=model, $fn=60); } //nut(model="nut2",h=40); //----------------------------------------- module tslot(model="tslot1",h=10,w=tslotw){ translate([-w/2,-w/2,-h/2])scale([0.1*w,0.1*w,1]) linear_extrude(height=h)import( file=file_dxf, layer=model, $fn=60); } //tslot(model="tslot1",h=40); //----------------------------------------- module twotslot(model="twoslot1",h=10,w=tslotw){ translate([-w,-w/2,-h/2])scale([0.1*w,0.1*w,1]) linear_extrude(height=h)import( file=file_dxf, layer=model, $fn=60); } //twotslot(); //----------------------------------------- module nut(m=6,h=4.5){ difference(){ union(){ for(i=[0:2]){ rotate([0,0,i* 360/6])cube([m+4.3,6,h],true); } } cylinder(h=h*2,r=m/2,center=true); } } //nut(); //----------------------------------------- module nutholder(m=6,h=4.5){ nut(); cylinder(h=h*2,r=m/2,center=true); } //nutholder(); //----------------------------------------- module corner90(w=tslotw){ rotate([45,0,0])rotate([0,-90,0])tria(h=w/10,w=w); rotate([-45,0,0])translate([0,w/2,w/2])tnut(h=w,w=w); rotate([-45,0,180])translate([0,w/2,w/2])tnut(h=w,w=w); } //corner90(); //----------------------------------------- module tap(w=tslotw){ translate([0,0,1.5])union(){ intersection(){ cube([w,w,w],true); union(){ difference(){ minkowski($fn=60){ cube([w-4,w-4,3],true); cylinder(h=3,r=2); } translate([0,0,3.5])cube([w-2,w-2,4],true); } difference(){ cylinder(h=11,r=w*0.115); cylinder(h=12,r=w*0.08); } translate([0,0,1.5])cube([w*0.3,w*0.13,3],true); translate([0,0,1.5])cube([w*0.13,w*0.3,3],true); translate([0,-w/2,4])cube([w*0.27,w*0.13,8],true); translate([0,w/2,4])cube([w*0.27,w*0.13,8],true); } } } } //tap(); //----------------------------------------- module elbow(w=tslotw){ intersection(){ translate([-w/2,-w/2,0])cylinder(h=w+2,r=w+2,center=true); cube([w,w,w],true); } translate([-w/2,0,0])fourslots(w=w); translate([0,-w/2,0])rotate([0,0,-90])fourslots(w=w); } //elbow8m(); //----------------------------------------- module boltm8(mm=16){ cylinder(h=mm,r=4); translate([0,0,-6])cylinder(h=6,r=6.5); } //boltm8(mm=16); //----------------------------------------- module elbow8m(w=tslotw){ difference(){ union(){ difference(){ elbow(w=w); union(){ translate([-w*0.3,0,0])rotate([0,-90,0])boltm8(mm=16); translate([0,-w*0.31,0])rotate([90,0,0])boltm8(mm=16); translate([w*0.8,0,0])rotate([0,-90,0])cylinder(h=w+5,r=w*0.28); translate([0,w*0.8,0])rotate([90,0,0])cylinder(h=w+5,r=w*0.28); //8.2 when 30x30 } } } } } //elbow8m(); //----------------------------------------- module xyztslot(w=tslotw){ difference(){ union(){ cube(w,true); translate([w/2,0,0])fourslots(w=w); translate([0,0,w/2])rotate([0,90,0])fourslots(w=w); translate([0,-w/2,0])rotate([0,0,90])fourslots(w=w); } union(){ cylinder(h=40,r=3.1,center=true); translate([0,0,-2])cylinder(h=w,r=8,center=true); rotate([0,90,0])cylinder(h=40,r=3.1,center=true); translate([-2,0,0])rotate([0,90,0])cylinder(h=w,r=8,center=true); rotate([90,0,0])cylinder(h=40,r=3.1,center=true); translate([0,2,0])rotate([90,0,0])cylinder(h=w,r=8,center=true); } } } //xyztslot(); //----------------------------------------- module fourslots(h=10,w=tslotw){ for(i=[0:3]){ rotate([90,90*i,90])tnut(h=h,w=w); } } module support901(w=tslotw){ translate([0,0,0])union(){ translate([0,w/2-1,1])rotate([90,-90,90])tria(h=w,w=w/10); translate([-w/2+w/20,w/2,-1]) rotate([90,0,-90])tria(h=w/10,w=w); translate([w/2-w/20 ,w/2,-1]) rotate([90,0,-90])tria(h=w/10,w=w); difference(){cube([w,w,2],true); translate([0,0,0])cylinder(h=6,r=w/10,center=true); } translate([0,w/2,w/2-1])rotate([90,0,0])difference(){cube([w,w,2],true);union(){ translate([w/4.5,2,0])cylinder(h=6,r=w/10,center=true); translate([-w/4.5,2,0])cylinder(h=6,r=w/10,center=true);} } } } //support901(w=30); //----------------------------------------- module support902(w=tslotw){ translate([0,0,0])union(){ translate([0,w/2-1,1])rotate([90,-90,90])tria(h=w,w=w/10); translate([-w/2+w/20,w/2,-1]) rotate([90,0,-90])tria(h=w/10); translate([w/2-w/20 ,w/2,-1]) rotate([90,0,-90])tria(h=w/10); difference(){cube([w,w,2],true); union(){ translate([w/4.5,0,0])cylinder(h=6,r=w/10,center=true); translate([-w/4.5,0,0])cylinder(h=6,r=w/10,center=true);} } translate([0,w/2,w/2-1])rotate([90,0,0])difference(){cube([w,w,2],true);union(){ translate([w/4.5,2,0])cylinder(h=6,r=w/10,center=true); translate([-w/4.5,2,0])cylinder(h=6,r=w/10,center=true);} } } } //support902(); //----------------------------------------- module support904(w=tslotw){ translate([0,0,0])union(){ translate([0,w/2-1,1])rotate([90,-90,90])tria(h=w,w=w/10); translate([-w/2+w/20,w/2,-1]) rotate([90,0,-90])tria(h=w/10,w=w); translate([w/2-w/20 ,w/2,-1]) rotate([90,0,-90])tria(h=w/10,w=w); difference(){cube([w,w,2],true); union(){ translate([0,w/4.5,0])cylinder(h=6,r=w/10,center=true); translate([0,-w/4.5,0])cylinder(h=6,r=w/10,center=true);} } translate([0,w/2,w/2-1])rotate([90,0,0])difference(){cube([w,w,2],true);union(){ translate([0,w/4.5,0])cylinder(h=6,r=w/10,center=true); translate([0,-w/4.5,0])cylinder(h=6,r=w/10,center=true);} } } } //support904(); //----------------------------------------- module support908(w=tslotw){ translate([0,0,0])union(){ translate([0,w/2-1,1])rotate([90,-90,90])tria(h=w,w=w/10); translate([-w/2+w/20,w/2,-1]) rotate([90,0,-90])tria(h=w/10,w=w); translate([w/2-w/20 ,w/2,-1]) rotate([90,0,-90])tria(h=w/10,w=w); difference(){cube([w,w,4],true); union(){ translate([0,w/4.5,0])cylinder(h=6,r=w/10,center=true); translate([0,-w/4.5,0])cylinder(h=6,r=w/10,center=true);} } translate([0,w/2,w/2-1])rotate([90,0,0])difference(){cube([w,w,2],true);union(){ translate([0,w/4.5,0])cylinder(h=6,r=w/10,center=true); translate([0,-w/4.5,0])cylinder(h=6,r=w/10,center=true);} } } } //support908(); //----------------------------------------- module tria(h=2,w=tslotw){ translate([0,0,-h/2])linear_extrude(height=h)polygon(points=[[0,0],[0,w],[w,0]], paths=[[0,1,2]]); } // //module tria3(h=8.2,w=tslotw){ //translate([-w*10/2,-5,-h/2])union(){ //for(i=[0:w-1]){ //translate([i*10,0,0])linear_extrude(height=h)polygon(points=[[0,0],[0,5],[5,10],[10,5],[10,0]], paths=[[0,1,2,3,4]]); //} //} //} module tsidel90(w=tslotw){ difference(){ union(){ translate([0,-w/2,0])fourslots(h=10,w=w); translate([-w/4,-w/2,0])union(){ translate([w/2,0,0])cube([w/2,w,w],true); translate([22.75,0,0])cylinder(h=w,r=w/2,center=true); } } translate([w-2,-w/2,0])rotate([0,90,0])cylinder(h=w,r=8,center=true); translate([0,-w/2,0])rotate([0,90,0])cylinder(h=w,r=3.1,center=true); } } module ttwosidel90(r=60,w=tslotw){ translate([-15,15,0]) union(){ tsidel90(); rotate([0,0,-r])translate([0,w,0])tsidel90(w=w); } } //ttwosidel90(); //----------------------------------------- module sidel90(w=tslotw){ difference(){ union(){ translate([0,-w/2,0])fourslots(h=10,w=w); translate([-2.5,-w/2,0])union(){ translate([5,0,0])cube([5,w,w],true); } } translate([18,-w/2,0])rotate([0,90,0])cylinder(h=w,r=8,center=true); translate([0,-w/2,0])rotate([0,90,0])cylinder(h=w,r=3.1,center=true); } } module twosidel90(r=60,w=tslotw){ //translate([-w/2,w/2,0]) union(){ sidel90(w=w); rotate([0,0,-r])translate([0,w,0])sidel90(w=w); } } //twosidel90(50); //----------------------------------------- module sideg90(d=0,w=tslotw){ rotate([0,0,d])union(){ translate([-15,0,0])fourslots(h=10,w=w); translate([-7.5,0,0])union(){ cube([15,30,30],true); translate([7.5,0,0])cylinder(h=30,r=15,center=true); } } } //sideg90(); //----------------------------------------- //----------------------------------------- //*************** Ecke ************* module connector() { translate([-(totBeamWidth)/2,-(totBeamWidth)/2,-(totBeamWidth)/2]) difference() { cube([totBeamWidth,totBeamWidth,beamWidth*2]); translate([border,border,beamWidth]) cube([beamWidth,beamWidth,beamWidth]); } } module connectorOuter() { translate([-(totBeamWidth)/2,-(totBeamWidth)/2,-(totBeamWidth)/2]) difference() { cube([totBeamWidth,totBeamWidth,beamWidth*(factor + 0.5)]); //translate([0,(totBeamWidth-width)/2,0]) cube([depth,width,beamWidth*(factor + 0.5)]); //translate([(totBeamWidth-width)/2,0,0]) cube([width,depth,beamWidth*(factor + 0.5)]); } } module connectorInner() { //translate([-(totBeamWidth)/2,-(totBeamWidth)/2,-(totBeamWidth)/2]) translate([-(totBeamWidth)/2,-(totBeamWidth)/2,0]) translate([border-(innnerCalibraition/2),border-(innnerCalibraition/2),beamWidth/2]) cube([beamWidth+innnerCalibraition,beamWidth+innnerCalibraition,beamWidth*(factor-0.5)]); } module cutout() { translate([totBeamWidth/2-border-depth,-width/2,totBeamWidth/2-border-depth]) cube([totBeamWidth,width,totBeamWidth]); } /* union() { connector(); rotate([90,0,0]) connector(); rotate([0,90,0]) connector(); }*/ //connectorOuter(); module ecke() { difference() { union() { connectorOuter(); rotate([90,180,0]) connectorOuter(); rotate([0,90,0]) connectorOuter(); } union() { connectorInner(); rotate([90,0,0]) connectorInner(); rotate([0,90,0]) connectorInner(); } union() { cutout(); rotate([90,0,0]) cutout(); rotate([90,270,0]) cutout(); } } } //---------------- Ende Ecke ------------------------------------------------------ module demo(){ translate([0,40,5])color("DeepSkyBlue")tslot(h=10,w=15); translate([50,20,5])color("DeepSkyBlue")tslot(h=10,w=25); translate([56,-20,5])color("DeepSkyBlue")tslot(h=10,w=40); translate([-26,70,5])color("Red")tslot(model="halfslot1",h=10,w=20); translate([-26,95,5])color("Red")tslot(model="halfslot2",h=10,w=20); translate([26,70,5])color("DeepSkyBlue")twotslot(h=10,w=40); translate([-16,-40,5])color([0,1,0])twotslot(model="twoslot2",h=10,w=25); translate([0,0,5])color([0,1,0])tslot(model="tslot2",h=10,w=10); translate([20,0,5])color([0,1,0])tslot(model="tslot2",h=10,w=20); translate([-30,0,5])color([0,1,0])tslot(model="tslot2",h=10,w=30); translate([0,20,5])color("DeepSkyBlue")tslot(h=10,w=10); translate([20,30,5])color("DeepSkyBlue")tslot(h=10,w=20); translate([-30,40,5])color("DeepSkyBlue")tslot(h=10,w=30); translate([20,-40,5])color("Silver")tnut(h=10,w=30); translate([20,-25,5])color("Silver")tnut(model="nut2",h=10,w=30); translate([20,-15,5])color("Silver")tnut(model="nut3",h=10,w=30); translate([100,0,7])color("Silver")ecke(); translate([100,0,22])color([0,1,0])tslot(model="tslot2",h=10,w=10); rotate([90, 0, 0]) translate([100,7,15])color([0,1,0])tslot(model="tslot2",h=10,w=10); rotate([0, 90, 0]) translate([-7,0,115])color([0,1,0])tslot(model="tslot2",h=10,w=10); } //-------- Print Auswahl -------------- module print(){ if (auswahl == "1") { tslot(h=30,w=10); } else if (auswahl == "2") { tslot(h=30,w=15); } else if (auswahl == "3") { tslot(h=30,w=20); } else if (auswahl == "4") { tslot(h=50,w=25); } else if (auswahl == "5") { tslot(h=50,w=30); } else if (auswahl == "6") { tslot(h=50,w=40); } else if (auswahl == "7") { tslot(model="halfslot1",h=10,w=20); } else if (auswahl == "8") { tslot(model="halfslot2",h=10,w=20); } else if (auswahl == "9") { twotslot(h=10,w=40); } else if (auswahl == "10") { twotslot(model="twoslot2",h=10,w=25); } else if (auswahl == "11") { tslot(model="tslot2",h=10,w=10); } else if (auswahl == "12") { tslot(model="tslot2",h=10,w=20); } else if (auswahl == "13") { tslot(model="tslot2",h=10,w=30); } else if (auswahl == "14") { tnut(h=10,w=30); } else if (auswahl == "15") { tnut(model="nut2",h=10,w=30); } else if (auswahl == "16") { nut(model="nut3",h=10,w=30); } else if (auswahl == "17") { pulley(); } else if (auswahl == "18") { sideg90();; } else if (auswahl == "19") { twosidel90(90); //(Winkelangabge) } else if (auswahl == "20") { support908(); } else if (auswahl == "21") { support904(); } else if (auswahl == "22") { support902(); } else if (auswahl == "23") { support901(w=30); } else if (auswahl == "24") { xyztslot(); } else if (auswahl == "25") { elbow8m(); } else if (auswahl == "26") { tap(); } else if (auswahl == "27") { boltm8(mm=16); } else if (auswahl == "28") { corner90(); } else if (auswahl == "29") { nutholder(); } else if (auswahl == "30") { nut(); } else if (auswahl == "31") { ecke(); } else { demo(); } } print();