diff --git a/example/NodeMCU_Lua_Amica.scad b/example/NodeMCU_Lua_Amica.scad new file mode 100755 index 0000000..85b31ea --- /dev/null +++ b/example/NodeMCU_Lua_Amica.scad @@ -0,0 +1,286 @@ +Detailgrad = 15; +$fn=Detailgrad; +holewithorigin=false; +module NodeMCU_Lua_Amica(){ + board_thickness = 1.600; + eta = 0.2; + board_polygon = [[0.000,47.308],[1.270,48.578],[24.448,48.578],[25.718,47.308],[25.718,1.270],[24.448,0.000],[1.270,0.000],[0.000,1.270]]; + board_size = [25.718,48.578]; + fn = Detailgrad; + board_origin = [0.000,0.000]; + translate([0,0,0]) union(){ // PCB whith parts and text + color("green")linear_extrude(height=board_thickness,center=false, convexity=10) + union(){ // PCB + difference(){ + translate(board_origin) polygon(points = board_polygon); //Board + translate([2.540,2.540]) circle(r=1.450,$fn=fn); //Hole + translate([22.860,2.540]) circle(r=1.450,$fn=fn); //Hole + translate([2.540,45.720]) circle(r=1.450,$fn=fn); //Hole + translate([22.860,45.720]) circle(r=1.450,$fn=fn); //Hole + if (Detailgrad > 9) { // Print part holes + translate([1.270,6.350])circle(r=0.508,$fn=fn); //1X15-CB 1 + translate([1.270,8.890])circle(r=0.508,$fn=fn); //1X15-CB 2 + translate([1.270,11.430])circle(r=0.508,$fn=fn); //1X15-CB 3 + translate([1.270,13.970])circle(r=0.508,$fn=fn); //1X15-CB 4 + translate([1.270,16.510])circle(r=0.508,$fn=fn); //1X15-CB 5 + translate([1.270,19.050])circle(r=0.508,$fn=fn); //1X15-CB 6 + translate([1.270,21.590])circle(r=0.508,$fn=fn); //1X15-CB 7 + translate([1.270,24.130])circle(r=0.508,$fn=fn); //1X15-CB 8 + translate([1.270,26.670])circle(r=0.508,$fn=fn); //1X15-CB 9 + translate([1.270,29.210])circle(r=0.508,$fn=fn); //1X15-CB 10 + translate([1.270,31.750])circle(r=0.508,$fn=fn); //1X15-CB 11 + translate([1.270,34.290])circle(r=0.508,$fn=fn); //1X15-CB 12 + translate([1.270,36.830])circle(r=0.508,$fn=fn); //1X15-CB 13 + translate([1.270,39.370])circle(r=0.508,$fn=fn); //1X15-CB 14 + translate([1.270,41.910])circle(r=0.508,$fn=fn); //1X15-CB 15 + translate([24.130,6.350])circle(r=0.508,$fn=fn); //1X15-CB 1 + translate([24.130,8.890])circle(r=0.508,$fn=fn); //1X15-CB 2 + translate([24.130,11.430])circle(r=0.508,$fn=fn); //1X15-CB 3 + translate([24.130,13.970])circle(r=0.508,$fn=fn); //1X15-CB 4 + translate([24.130,16.510])circle(r=0.508,$fn=fn); //1X15-CB 5 + translate([24.130,19.050])circle(r=0.508,$fn=fn); //1X15-CB 6 + translate([24.130,21.590])circle(r=0.508,$fn=fn); //1X15-CB 7 + translate([24.130,24.130])circle(r=0.508,$fn=fn); //1X15-CB 8 + translate([24.130,26.670])circle(r=0.508,$fn=fn); //1X15-CB 9 + translate([24.130,29.210])circle(r=0.508,$fn=fn); //1X15-CB 10 + translate([24.130,31.750])circle(r=0.508,$fn=fn); //1X15-CB 11 + translate([24.130,34.290])circle(r=0.508,$fn=fn); //1X15-CB 12 + translate([24.130,36.830])circle(r=0.508,$fn=fn); //1X15-CB 13 + translate([24.130,39.370])circle(r=0.508,$fn=fn); //1X15-CB 14 + translate([24.130,41.910])circle(r=0.508,$fn=fn); //1X15-CB 15 + translate([16.285,2.505])circle(r=0.750,$fn=fn); //ZX62D-B-5PA8 S1 + translate([9.085,2.505])circle(r=0.750,$fn=fn); //ZX62D-B-5PA8 S2 + translate([10.260,5.405])circle(r=0.350,$fn=fn); //ZX62D-B-5PA8 S3 + translate([15.110,5.405])circle(r=0.350,$fn=fn); //ZX62D-B-5PA8 S4 + } // end Print part holes + } //end difference() PCB - Holes + if (holewithorigin) + { + //Print a little cross in PCB holes + translate([2.540,2.540]) { polygon([[0,0],[-0.36,-0.36],[-0.36,0.36]]); polygon([[0,0],[0.36,0.36],[0.36,-0.36]]);} //Hole + translate([22.860,2.540]) { polygon([[0,0],[-0.36,-0.36],[-0.36,0.36]]); polygon([[0,0],[0.36,0.36],[0.36,-0.36]]);} //Hole + translate([2.540,45.720]) { polygon([[0,0],[-0.36,-0.36],[-0.36,0.36]]); polygon([[0,0],[0.36,0.36],[0.36,-0.36]]);} //Hole + translate([22.860,45.720]) { polygon([[0,0],[-0.36,-0.36],[-0.36,0.36]]); polygon([[0,0],[0.36,0.36],[0.36,-0.36]]);} //Hole + } + } //end union() // PCB +color("Goldenrod",0.7) translate([0,0,board_thickness-0.017]) linear_extrude(height=0.035,center=false, convexity=10) difference() { + union() { + translate([1.270,6.350]) circle(r=0.889,$fn=$fn); + translate([1.270,8.890]) circle(r=0.889,$fn=$fn); + translate([1.270,11.430]) circle(r=0.889,$fn=$fn); + translate([1.270,13.970]) circle(r=0.889,$fn=$fn); + translate([1.270,16.510]) circle(r=0.889,$fn=$fn); + translate([1.270,19.050]) circle(r=0.889,$fn=$fn); + translate([1.270,21.590]) circle(r=0.889,$fn=$fn); + translate([1.270,24.130]) circle(r=0.889,$fn=$fn); + translate([1.270,26.670]) circle(r=0.889,$fn=$fn); + translate([1.270,29.210]) circle(r=0.889,$fn=$fn); + translate([1.270,31.750]) circle(r=0.889,$fn=$fn); + translate([1.270,34.290]) circle(r=0.889,$fn=$fn); + translate([1.270,36.830]) circle(r=0.889,$fn=$fn); + translate([1.270,39.370]) circle(r=0.889,$fn=$fn); + translate([1.270,41.910]) circle(r=0.889,$fn=$fn); + translate([24.130,6.350]) circle(r=0.889,$fn=$fn); + translate([24.130,8.890]) circle(r=0.889,$fn=$fn); + translate([24.130,11.430]) circle(r=0.889,$fn=$fn); + translate([24.130,13.970]) circle(r=0.889,$fn=$fn); + translate([24.130,16.510]) circle(r=0.889,$fn=$fn); + translate([24.130,19.050]) circle(r=0.889,$fn=$fn); + translate([24.130,21.590]) circle(r=0.889,$fn=$fn); + translate([24.130,24.130]) circle(r=0.889,$fn=$fn); + translate([24.130,26.670]) circle(r=0.889,$fn=$fn); + translate([24.130,29.210]) circle(r=0.889,$fn=$fn); + translate([24.130,31.750]) circle(r=0.889,$fn=$fn); + translate([24.130,34.290]) circle(r=0.889,$fn=$fn); + translate([24.130,36.830]) circle(r=0.889,$fn=$fn); + translate([24.130,39.370]) circle(r=0.889,$fn=$fn); + translate([24.130,41.910]) circle(r=0.889,$fn=$fn); + translate([5.565,5.365]) rotate([0,0,90.000]) square([1.000,1.000], center = true); //KMR2 1 + translate([7.165,5.365]) rotate([0,0,90.000]) square([1.000,1.000], center = true); //KMR2 2 + translate([5.565,1.365]) rotate([0,0,90.000]) square([1.000,1.000], center = true); //KMR2 3 + translate([7.165,1.365]) rotate([0,0,90.000]) square([1.000,1.000], center = true); //KMR2 4 + translate([18.168,5.365]) rotate([0,0,90.000]) square([1.000,1.000], center = true); //KMR2 1 + translate([19.768,5.365]) rotate([0,0,90.000]) square([1.000,1.000], center = true); //KMR2 2 + translate([18.168,1.365]) rotate([0,0,90.000]) square([1.000,1.000], center = true); //KMR2 3 + translate([19.768,1.365]) rotate([0,0,90.000]) square([1.000,1.000], center = true); //KMR2 4 + translate([5.200,40.060]) square([2.000,1.200], center = true); //ESP-12 1 + translate([5.200,38.060]) square([2.000,1.200], center = true); //ESP-12 2 + translate([5.200,36.060]) square([2.000,1.200], center = true); //ESP-12 3 + translate([5.200,34.060]) square([2.000,1.200], center = true); //ESP-12 4 + translate([5.200,32.060]) square([2.000,1.200], center = true); //ESP-12 5 + translate([5.200,30.060]) square([2.000,1.200], center = true); //ESP-12 6 + translate([5.200,28.060]) square([2.000,1.200], center = true); //ESP-12 7 + translate([5.200,26.060]) square([2.000,1.200], center = true); //ESP-12 8 + translate([20.200,26.060]) square([2.000,1.200], center = true); //ESP-12 9 + translate([20.200,28.060]) square([2.000,1.200], center = true); //ESP-12 10 + translate([20.200,30.060]) square([2.000,1.200], center = true); //ESP-12 11 + translate([20.200,32.060]) square([2.000,1.200], center = true); //ESP-12 12 + translate([20.200,34.060]) square([2.000,1.200], center = true); //ESP-12 13 + translate([20.200,36.060]) square([2.000,1.200], center = true); //ESP-12 14 + translate([20.200,38.060]) square([2.000,1.200], center = true); //ESP-12 15 + translate([20.200,40.060]) square([2.000,1.200], center = true); //ESP-12 16 + translate([11.385,5.180]) rotate([0,0,90.000]) square([1.350,0.400], center = true); //ZX62D-B-5PA8 1 + translate([12.035,5.180]) rotate([0,0,90.000]) square([1.350,0.400], center = true); //ZX62D-B-5PA8 2 + translate([12.685,5.180]) rotate([0,0,90.000]) square([1.350,0.400], center = true); //ZX62D-B-5PA8 3 + translate([13.335,5.180]) rotate([0,0,90.000]) square([1.350,0.400], center = true); //ZX62D-B-5PA8 4 + translate([13.985,5.180]) rotate([0,0,90.000]) square([1.350,0.400], center = true); //ZX62D-B-5PA8 5 + translate([16.285,2.505]) circle(r=1.125,$fn=$fn); + translate([9.085,2.505]) circle(r=1.125,$fn=$fn); + translate([10.260,5.405]) rotate([0,0,180.000]) EaglePad([1.208,2.416], 100); //ZX62D-B-5PA8 S3 + translate([15.110,5.405]) rotate([0,0,180.000]) EaglePad([1.208,2.416], 100); //ZX62D-B-5PA8 S4 + } + translate([1.270,6.350]) circle(r=0.508,$fn=fn); + translate([1.270,8.890]) circle(r=0.508,$fn=fn); + translate([1.270,11.430]) circle(r=0.508,$fn=fn); + translate([1.270,13.970]) circle(r=0.508,$fn=fn); + translate([1.270,16.510]) circle(r=0.508,$fn=fn); + translate([1.270,19.050]) circle(r=0.508,$fn=fn); + translate([1.270,21.590]) circle(r=0.508,$fn=fn); + translate([1.270,24.130]) circle(r=0.508,$fn=fn); + translate([1.270,26.670]) circle(r=0.508,$fn=fn); + translate([1.270,29.210]) circle(r=0.508,$fn=fn); + translate([1.270,31.750]) circle(r=0.508,$fn=fn); + translate([1.270,34.290]) circle(r=0.508,$fn=fn); + translate([1.270,36.830]) circle(r=0.508,$fn=fn); + translate([1.270,39.370]) circle(r=0.508,$fn=fn); + translate([1.270,41.910]) circle(r=0.508,$fn=fn); + translate([24.130,6.350]) circle(r=0.508,$fn=fn); + translate([24.130,8.890]) circle(r=0.508,$fn=fn); + translate([24.130,11.430]) circle(r=0.508,$fn=fn); + translate([24.130,13.970]) circle(r=0.508,$fn=fn); + translate([24.130,16.510]) circle(r=0.508,$fn=fn); + translate([24.130,19.050]) circle(r=0.508,$fn=fn); + translate([24.130,21.590]) circle(r=0.508,$fn=fn); + translate([24.130,24.130]) circle(r=0.508,$fn=fn); + translate([24.130,26.670]) circle(r=0.508,$fn=fn); + translate([24.130,29.210]) circle(r=0.508,$fn=fn); + translate([24.130,31.750]) circle(r=0.508,$fn=fn); + translate([24.130,34.290]) circle(r=0.508,$fn=fn); + translate([24.130,36.830]) circle(r=0.508,$fn=fn); + translate([24.130,39.370]) circle(r=0.508,$fn=fn); + translate([24.130,41.910]) circle(r=0.508,$fn=fn); + translate([16.285,2.505]) circle(r=0.750,$fn=fn); + translate([9.085,2.505]) circle(r=0.750,$fn=fn); + translate([10.260,5.405]) circle(r=0.350,$fn=fn); + translate([15.110,5.405]) circle(r=0.350,$fn=fn); + + } +color("Goldenrod",0.7) translate([0,0,-0.017]) linear_extrude(height=0.035,center=false, convexity=10) difference() { + union() { + translate([1.270,6.350]) circle(r=0.889,$fn=fn); + translate([1.270,8.890]) circle(r=0.889,$fn=fn); + translate([1.270,11.430]) circle(r=0.889,$fn=fn); + translate([1.270,13.970]) circle(r=0.889,$fn=fn); + translate([1.270,16.510]) circle(r=0.889,$fn=fn); + translate([1.270,19.050]) circle(r=0.889,$fn=fn); + translate([1.270,21.590]) circle(r=0.889,$fn=fn); + translate([1.270,24.130]) circle(r=0.889,$fn=fn); + translate([1.270,26.670]) circle(r=0.889,$fn=fn); + translate([1.270,29.210]) circle(r=0.889,$fn=fn); + translate([1.270,31.750]) circle(r=0.889,$fn=fn); + translate([1.270,34.290]) circle(r=0.889,$fn=fn); + translate([1.270,36.830]) circle(r=0.889,$fn=fn); + translate([1.270,39.370]) circle(r=0.889,$fn=fn); + translate([1.270,41.910]) circle(r=0.889,$fn=fn); + translate([24.130,6.350]) circle(r=0.889,$fn=fn); + translate([24.130,8.890]) circle(r=0.889,$fn=fn); + translate([24.130,11.430]) circle(r=0.889,$fn=fn); + translate([24.130,13.970]) circle(r=0.889,$fn=fn); + translate([24.130,16.510]) circle(r=0.889,$fn=fn); + translate([24.130,19.050]) circle(r=0.889,$fn=fn); + translate([24.130,21.590]) circle(r=0.889,$fn=fn); + translate([24.130,24.130]) circle(r=0.889,$fn=fn); + translate([24.130,26.670]) circle(r=0.889,$fn=fn); + translate([24.130,29.210]) circle(r=0.889,$fn=fn); + translate([24.130,31.750]) circle(r=0.889,$fn=fn); + translate([24.130,34.290]) circle(r=0.889,$fn=fn); + translate([24.130,36.830]) circle(r=0.889,$fn=fn); + translate([24.130,39.370]) circle(r=0.889,$fn=fn); + translate([24.130,41.910]) circle(r=0.889,$fn=fn); + translate([16.285,2.505]) circle(r=1.125,$fn=fn); + translate([9.085,2.505]) circle(r=1.125,$fn=fn); + translate([10.260,5.405]) rotate([0,0,180.000]) EaglePad([1.208,2.416], 100); //ZX62D-B-5PA8 S3 + translate([15.110,5.405]) rotate([0,0,180.000]) EaglePad([1.208,2.416], 100); //ZX62D-B-5PA8 S4 + } + translate([1.270,6.350]) circle(r=0.508,$fn=fn); + translate([1.270,8.890]) circle(r=0.508,$fn=fn); + translate([1.270,11.430]) circle(r=0.508,$fn=fn); + translate([1.270,13.970]) circle(r=0.508,$fn=fn); + translate([1.270,16.510]) circle(r=0.508,$fn=fn); + translate([1.270,19.050]) circle(r=0.508,$fn=fn); + translate([1.270,21.590]) circle(r=0.508,$fn=fn); + translate([1.270,24.130]) circle(r=0.508,$fn=fn); + translate([1.270,26.670]) circle(r=0.508,$fn=fn); + translate([1.270,29.210]) circle(r=0.508,$fn=fn); + translate([1.270,31.750]) circle(r=0.508,$fn=fn); + translate([1.270,34.290]) circle(r=0.508,$fn=fn); + translate([1.270,36.830]) circle(r=0.508,$fn=fn); + translate([1.270,39.370]) circle(r=0.508,$fn=fn); + translate([1.270,41.910]) circle(r=0.508,$fn=fn); + translate([24.130,6.350]) circle(r=0.508,$fn=fn); + translate([24.130,8.890]) circle(r=0.508,$fn=fn); + translate([24.130,11.430]) circle(r=0.508,$fn=fn); + translate([24.130,13.970]) circle(r=0.508,$fn=fn); + translate([24.130,16.510]) circle(r=0.508,$fn=fn); + translate([24.130,19.050]) circle(r=0.508,$fn=fn); + translate([24.130,21.590]) circle(r=0.508,$fn=fn); + translate([24.130,24.130]) circle(r=0.508,$fn=fn); + translate([24.130,26.670]) circle(r=0.508,$fn=fn); + translate([24.130,29.210]) circle(r=0.508,$fn=fn); + translate([24.130,31.750]) circle(r=0.508,$fn=fn); + translate([24.130,34.290]) circle(r=0.508,$fn=fn); + translate([24.130,36.830]) circle(r=0.508,$fn=fn); + translate([24.130,39.370]) circle(r=0.508,$fn=fn); + translate([24.130,41.910]) circle(r=0.508,$fn=fn); + translate([16.285,2.505]) circle(r=0.750,$fn=fn); + translate([9.085,2.505]) circle(r=0.750,$fn=fn); + translate([10.260,5.405]) circle(r=0.350,$fn=fn); + translate([15.110,5.405]) circle(r=0.350,$fn=fn); + + } + union(){ // parts + translate([1.270,24.130,0])rotate([180,0,90])1X15_CB(); //JP1 + translate([24.130,24.130,0])rotate([180,0,90])1X15_CB(); //JP2 + translate([6.365,3.365,board_thickness])rotate([0,0,90])KMR2(); //SW1 SPST_TACT-KMR2 + translate([18.968,3.365,board_thickness])rotate([0,0,90])KMR2(); //SW2 SPST_TACT-KMR2 + translate([12.700,35.560,board_thickness])ESP_12(); //X1 + translate([12.685,0.355,board_thickness])rotate([0,0,90])ZX62D_B_5PA8(); //X2 ZX62D-B-5PA8 + } + } //endunion() + module 1X15_CB() //JP1 + { + union(); //No Dimension + } + module KMR2() //SW1 SPST_TACT-KMR2 + { + rotate([0,0,270]) translate([-1.400,-2.100,0]) linear_extrude(10) square([2.800,4.200]); //Dummy Package + } + module ESP_12() //X1 + { + translate([-8.000,-11.000,0]) linear_extrude(10) square([16.000,24.000]); //Dummy Package + } + module ZX62D_B_5PA8() //X2 ZX62D-B-5PA8 + { + rotate([0,0,270]) translate([-4.000,-0.600,0]) linear_extrude(10) square([8.000,5.600]); //Dummy Package + } + include <../packages/packages.scad>; + +} // end module + + +module EaglePad(size,roundness,$fn=16) +{ + function bogen(point=[0,0], r = 1 ,phase = 0, winkel = 90, $fn=$fn) = [let(num=abs($fn*winkel/360)) for (i=[0:num], x=i*winkel/num) [point[0]+r*cos(x+phase),point[1]+r*sin(x+phase)]]; + r = ((size[0] < size[1]) ? size[0] / 2: size[1] / 2) * roundness / 100; + dim = [size[0] / 2 - r, size[1] / 2 - r]; + if ((size[0] == size[1]) && (roundness == 100)) + { + circle(r); + } + else + { + polygon(concat(bogen(point=[-dim[0],-dim[1]], r = r, phase = 180, $fn=$fn ), bogen(point=[dim[0],-dim[1]], r = r, phase = 270, $fn=$fn ), bogen(point=[dim[0],dim[1]], r = r, phase = 0, $fn=$fn ), bogen(point=[-dim[0],dim[1]], r = r, phase = 90, $fn=$fn ))); + } +} +NodeMCU_Lua_Amica(); //Show module +//Created by generate-scad.ulp version 1.2 diff --git a/example/NodeMCU_Lua_Lolin.scad b/example/NodeMCU_Lua_Lolin.scad new file mode 100755 index 0000000..eac3919 --- /dev/null +++ b/example/NodeMCU_Lua_Lolin.scad @@ -0,0 +1,540 @@ +Detailgrad = 15; +$fn=Detailgrad; +module NodeMCU_Lua_Lolin(){ + board_thickness = 1.600000; + eta = 0.2; + board_polygon = [[0.000000,57.308750],[1.587500,58.102500],[29.845000,58.102500],[31.432500,57.308750],[31.432500,0.793750],[29.845000,0.000000],[1.587500,0.000000],[0.000000,0.793750]]; + board_size = [31.432500,58.102500]; + fn = Detailgrad; + board_origin = [0.000000,0.000000]; + translate([0,0,0]) union(){ // PCB whith parts and text + color("DarkSlateGray")linear_extrude(height=board_thickness,center=false, convexity=10) + union(){ // PCB + difference(){ + translate(board_origin) polygon(points = board_polygon); //Board + if (Detailgrad > 9) { // Print part holes + translate([3.016,3.016])circle(r=1.600000,$fn=fn); //3,2-PAD B3,2 + translate([28.416,3.016])circle(r=1.600000,$fn=fn); //3,2-PAD B3,2 + translate([3.016,55.086])circle(r=1.600000,$fn=fn); //3,2-PAD B3,2 + translate([28.416,55.086])circle(r=1.600000,$fn=fn); //3,2-PAD B3,2 + translate([2.540,11.430])circle(r=0.508000,$fn=fn); //1X15-CB 1 + translate([2.540,13.970])circle(r=0.508000,$fn=fn); //1X15-CB 2 + translate([2.540,16.510])circle(r=0.508000,$fn=fn); //1X15-CB 3 + translate([2.540,19.050])circle(r=0.508000,$fn=fn); //1X15-CB 4 + translate([2.540,21.590])circle(r=0.508000,$fn=fn); //1X15-CB 5 + translate([2.540,24.130])circle(r=0.508000,$fn=fn); //1X15-CB 6 + translate([2.540,26.670])circle(r=0.508000,$fn=fn); //1X15-CB 7 + translate([2.540,29.210])circle(r=0.508000,$fn=fn); //1X15-CB 8 + translate([2.540,31.750])circle(r=0.508000,$fn=fn); //1X15-CB 9 + translate([2.540,34.290])circle(r=0.508000,$fn=fn); //1X15-CB 10 + translate([2.540,36.830])circle(r=0.508000,$fn=fn); //1X15-CB 11 + translate([2.540,39.370])circle(r=0.508000,$fn=fn); //1X15-CB 12 + translate([2.540,41.910])circle(r=0.508000,$fn=fn); //1X15-CB 13 + translate([2.540,44.450])circle(r=0.508000,$fn=fn); //1X15-CB 14 + translate([2.540,46.990])circle(r=0.508000,$fn=fn); //1X15-CB 15 + translate([29.210,11.430])circle(r=0.508000,$fn=fn); //1X15-CB 1 + translate([29.210,13.970])circle(r=0.508000,$fn=fn); //1X15-CB 2 + translate([29.210,16.510])circle(r=0.508000,$fn=fn); //1X15-CB 3 + translate([29.210,19.050])circle(r=0.508000,$fn=fn); //1X15-CB 4 + translate([29.210,21.590])circle(r=0.508000,$fn=fn); //1X15-CB 5 + translate([29.210,24.130])circle(r=0.508000,$fn=fn); //1X15-CB 6 + translate([29.210,26.670])circle(r=0.508000,$fn=fn); //1X15-CB 7 + translate([29.210,29.210])circle(r=0.508000,$fn=fn); //1X15-CB 8 + translate([29.210,31.750])circle(r=0.508000,$fn=fn); //1X15-CB 9 + translate([29.210,34.290])circle(r=0.508000,$fn=fn); //1X15-CB 10 + translate([29.210,36.830])circle(r=0.508000,$fn=fn); //1X15-CB 11 + translate([29.210,39.370])circle(r=0.508000,$fn=fn); //1X15-CB 12 + translate([29.210,41.910])circle(r=0.508000,$fn=fn); //1X15-CB 13 + translate([29.210,44.450])circle(r=0.508000,$fn=fn); //1X15-CB 14 + translate([29.210,46.990])circle(r=0.508000,$fn=fn); //1X15-CB 15 + translate([19.143,1.552])circle(r=0.750000,$fn=fn); //ZX62D-B-5PA8 S1 + translate([11.943,1.552])circle(r=0.750000,$fn=fn); //ZX62D-B-5PA8 S2 + translate([13.118,4.453])circle(r=0.350000,$fn=fn); //ZX62D-B-5PA8 S3 + translate([17.968,4.453])circle(r=0.350000,$fn=fn); //ZX62D-B-5PA8 S4 + } // end Print part holes + } //end difference() PCB - Holes + //Print a little cross in PCB holes + } //end union() // PCB +color("Goldenrod",0.7) translate([0,0,board_thickness-0.017]) linear_extrude(height=0.035,center=false, convexity=10) difference() { + union() { + translate([3.016,3.016]) circle(r=2.921,$fn=fn); + translate([28.416,3.016]) circle(r=2.921,$fn=fn); + translate([3.016,55.086]) circle(r=2.921,$fn=fn); + translate([28.416,55.086]) circle(r=2.921,$fn=fn); + translate([2.540,11.430]) circle(r=0.889,$fn=fn); + translate([2.540,13.970]) circle(r=0.889,$fn=fn); + translate([2.540,16.510]) circle(r=0.889,$fn=fn); + translate([2.540,19.050]) circle(r=0.889,$fn=fn); + translate([2.540,21.590]) circle(r=0.889,$fn=fn); + translate([2.540,24.130]) circle(r=0.889,$fn=fn); + translate([2.540,26.670]) circle(r=0.889,$fn=fn); + translate([2.540,29.210]) circle(r=0.889,$fn=fn); + translate([2.540,31.750]) circle(r=0.889,$fn=fn); + translate([2.540,34.290]) circle(r=0.889,$fn=fn); + translate([2.540,36.830]) circle(r=0.889,$fn=fn); + translate([2.540,39.370]) circle(r=0.889,$fn=fn); + translate([2.540,41.910]) circle(r=0.889,$fn=fn); + translate([2.540,44.450]) circle(r=0.889,$fn=fn); + translate([2.540,46.990]) circle(r=0.889,$fn=fn); + translate([29.210,11.430]) circle(r=0.889,$fn=fn); + translate([29.210,13.970]) circle(r=0.889,$fn=fn); + translate([29.210,16.510]) circle(r=0.889,$fn=fn); + translate([29.210,19.050]) circle(r=0.889,$fn=fn); + translate([29.210,21.590]) circle(r=0.889,$fn=fn); + translate([29.210,24.130]) circle(r=0.889,$fn=fn); + translate([29.210,26.670]) circle(r=0.889,$fn=fn); + translate([29.210,29.210]) circle(r=0.889,$fn=fn); + translate([29.210,31.750]) circle(r=0.889,$fn=fn); + translate([29.210,34.290]) circle(r=0.889,$fn=fn); + translate([29.210,36.830]) circle(r=0.889,$fn=fn); + translate([29.210,39.370]) circle(r=0.889,$fn=fn); + translate([29.210,41.910]) circle(r=0.889,$fn=fn); + translate([29.210,44.450]) circle(r=0.889,$fn=fn); + translate([29.210,46.990]) circle(r=0.889,$fn=fn); + translate([6.676,6.000]) rotate([0,0,90.000]) square([1.000,1.000], center = true); //KMR2 1 + translate([8.276,6.000]) rotate([0,0,90.000]) square([1.000,1.000], center = true); //KMR2 2 + translate([6.676,2.000]) rotate([0,0,90.000]) square([1.000,1.000], center = true); //KMR2 3 + translate([8.276,2.000]) rotate([0,0,90.000]) square([1.000,1.000], center = true); //KMR2 4 + translate([22.771,6.000]) rotate([0,0,90.000]) square([1.000,1.000], center = true); //KMR2 1 + translate([24.371,6.000]) rotate([0,0,90.000]) square([1.000,1.000], center = true); //KMR2 2 + translate([22.771,2.000]) rotate([0,0,90.000]) square([1.000,1.000], center = true); //KMR2 3 + translate([24.371,2.000]) rotate([0,0,90.000]) square([1.000,1.000], center = true); //KMR2 4 + translate([7.740,49.268])square([2.000,1.200], center = true); //ESP-12 1 + translate([7.740,47.268])square([2.000,1.200], center = true); //ESP-12 2 + translate([7.740,45.268])square([2.000,1.200], center = true); //ESP-12 3 + translate([7.740,43.268])square([2.000,1.200], center = true); //ESP-12 4 + translate([7.740,41.268])square([2.000,1.200], center = true); //ESP-12 5 + translate([7.740,39.268])square([2.000,1.200], center = true); //ESP-12 6 + translate([7.740,37.267])square([2.000,1.200], center = true); //ESP-12 7 + translate([7.740,35.267])square([2.000,1.200], center = true); //ESP-12 8 + translate([22.740,35.267])square([2.000,1.200], center = true); //ESP-12 9 + translate([22.740,37.267])square([2.000,1.200], center = true); //ESP-12 10 + translate([22.740,39.268])square([2.000,1.200], center = true); //ESP-12 11 + translate([22.740,41.268])square([2.000,1.200], center = true); //ESP-12 12 + translate([22.740,43.268])square([2.000,1.200], center = true); //ESP-12 13 + translate([22.740,45.268])square([2.000,1.200], center = true); //ESP-12 14 + translate([22.740,47.268])square([2.000,1.200], center = true); //ESP-12 15 + translate([22.740,49.268])square([2.000,1.200], center = true); //ESP-12 16 + translate([14.243,4.228]) rotate([0,0,90.000]) square([1.350,0.400], center = true); //ZX62D-B-5PA8 1 + translate([14.893,4.228]) rotate([0,0,90.000]) square([1.350,0.400], center = true); //ZX62D-B-5PA8 2 + translate([15.543,4.228]) rotate([0,0,90.000]) square([1.350,0.400], center = true); //ZX62D-B-5PA8 3 + translate([16.192,4.228]) rotate([0,0,90.000]) square([1.350,0.400], center = true); //ZX62D-B-5PA8 4 + translate([16.843,4.228]) rotate([0,0,90.000]) square([1.350,0.400], center = true); //ZX62D-B-5PA8 5 + translate([19.143,1.552]) circle(r=1.125,$fn=fn); + translate([11.943,1.552]) circle(r=1.125,$fn=fn); + translate([13.118,4.453]) circle(r=0.604,$fn=fn); + translate([17.968,4.453]) circle(r=0.604,$fn=fn); + } + translate([3.016,3.016]) circle(r=1.600,$fn=fn); + translate([28.416,3.016]) circle(r=1.600,$fn=fn); + translate([3.016,55.086]) circle(r=1.600,$fn=fn); + translate([28.416,55.086]) circle(r=1.600,$fn=fn); + translate([2.540,11.430]) circle(r=0.508,$fn=fn); + translate([2.540,13.970]) circle(r=0.508,$fn=fn); + translate([2.540,16.510]) circle(r=0.508,$fn=fn); + translate([2.540,19.050]) circle(r=0.508,$fn=fn); + translate([2.540,21.590]) circle(r=0.508,$fn=fn); + translate([2.540,24.130]) circle(r=0.508,$fn=fn); + translate([2.540,26.670]) circle(r=0.508,$fn=fn); + translate([2.540,29.210]) circle(r=0.508,$fn=fn); + translate([2.540,31.750]) circle(r=0.508,$fn=fn); + translate([2.540,34.290]) circle(r=0.508,$fn=fn); + translate([2.540,36.830]) circle(r=0.508,$fn=fn); + translate([2.540,39.370]) circle(r=0.508,$fn=fn); + translate([2.540,41.910]) circle(r=0.508,$fn=fn); + translate([2.540,44.450]) circle(r=0.508,$fn=fn); + translate([2.540,46.990]) circle(r=0.508,$fn=fn); + translate([29.210,11.430]) circle(r=0.508,$fn=fn); + translate([29.210,13.970]) circle(r=0.508,$fn=fn); + translate([29.210,16.510]) circle(r=0.508,$fn=fn); + translate([29.210,19.050]) circle(r=0.508,$fn=fn); + translate([29.210,21.590]) circle(r=0.508,$fn=fn); + translate([29.210,24.130]) circle(r=0.508,$fn=fn); + translate([29.210,26.670]) circle(r=0.508,$fn=fn); + translate([29.210,29.210]) circle(r=0.508,$fn=fn); + translate([29.210,31.750]) circle(r=0.508,$fn=fn); + translate([29.210,34.290]) circle(r=0.508,$fn=fn); + translate([29.210,36.830]) circle(r=0.508,$fn=fn); + translate([29.210,39.370]) circle(r=0.508,$fn=fn); + translate([29.210,41.910]) circle(r=0.508,$fn=fn); + translate([29.210,44.450]) circle(r=0.508,$fn=fn); + translate([29.210,46.990]) circle(r=0.508,$fn=fn); + translate([19.143,1.552]) circle(r=0.750,$fn=fn); + translate([11.943,1.552]) circle(r=0.750,$fn=fn); + translate([13.118,4.453]) circle(r=0.350,$fn=fn); + translate([17.968,4.453]) circle(r=0.350,$fn=fn); + + } +color("Goldenrod",0.7) translate([0,0,-0.017]) linear_extrude(height=0.035,center=false, convexity=10) difference() { + union() { + translate([3.016,3.016]) circle(r=2.921,$fn=fn); + translate([28.416,3.016]) circle(r=2.921,$fn=fn); + translate([3.016,55.086]) circle(r=2.921,$fn=fn); + translate([28.416,55.086]) circle(r=2.921,$fn=fn); + translate([2.540,11.430]) circle(r=0.889,$fn=fn); + translate([2.540,13.970]) circle(r=0.889,$fn=fn); + translate([2.540,16.510]) circle(r=0.889,$fn=fn); + translate([2.540,19.050]) circle(r=0.889,$fn=fn); + translate([2.540,21.590]) circle(r=0.889,$fn=fn); + translate([2.540,24.130]) circle(r=0.889,$fn=fn); + translate([2.540,26.670]) circle(r=0.889,$fn=fn); + translate([2.540,29.210]) circle(r=0.889,$fn=fn); + translate([2.540,31.750]) circle(r=0.889,$fn=fn); + translate([2.540,34.290]) circle(r=0.889,$fn=fn); + translate([2.540,36.830]) circle(r=0.889,$fn=fn); + translate([2.540,39.370]) circle(r=0.889,$fn=fn); + translate([2.540,41.910]) circle(r=0.889,$fn=fn); + translate([2.540,44.450]) circle(r=0.889,$fn=fn); + translate([2.540,46.990]) circle(r=0.889,$fn=fn); + translate([29.210,11.430]) circle(r=0.889,$fn=fn); + translate([29.210,13.970]) circle(r=0.889,$fn=fn); + translate([29.210,16.510]) circle(r=0.889,$fn=fn); + translate([29.210,19.050]) circle(r=0.889,$fn=fn); + translate([29.210,21.590]) circle(r=0.889,$fn=fn); + translate([29.210,24.130]) circle(r=0.889,$fn=fn); + translate([29.210,26.670]) circle(r=0.889,$fn=fn); + translate([29.210,29.210]) circle(r=0.889,$fn=fn); + translate([29.210,31.750]) circle(r=0.889,$fn=fn); + translate([29.210,34.290]) circle(r=0.889,$fn=fn); + translate([29.210,36.830]) circle(r=0.889,$fn=fn); + translate([29.210,39.370]) circle(r=0.889,$fn=fn); + translate([29.210,41.910]) circle(r=0.889,$fn=fn); + translate([29.210,44.450]) circle(r=0.889,$fn=fn); + translate([29.210,46.990]) circle(r=0.889,$fn=fn); + translate([19.143,1.552]) circle(r=1.125,$fn=fn); + translate([11.943,1.552]) circle(r=1.125,$fn=fn); + translate([13.118,4.453]) circle(r=0.604,$fn=fn); + translate([17.968,4.453]) circle(r=0.604,$fn=fn); + } + translate([3.016,3.016]) circle(r=1.600,$fn=fn); + translate([28.416,3.016]) circle(r=1.600,$fn=fn); + translate([3.016,55.086]) circle(r=1.600,$fn=fn); + translate([28.416,55.086]) circle(r=1.600,$fn=fn); + translate([2.540,11.430]) circle(r=0.508,$fn=fn); + translate([2.540,13.970]) circle(r=0.508,$fn=fn); + translate([2.540,16.510]) circle(r=0.508,$fn=fn); + translate([2.540,19.050]) circle(r=0.508,$fn=fn); + translate([2.540,21.590]) circle(r=0.508,$fn=fn); + translate([2.540,24.130]) circle(r=0.508,$fn=fn); + translate([2.540,26.670]) circle(r=0.508,$fn=fn); + translate([2.540,29.210]) circle(r=0.508,$fn=fn); + translate([2.540,31.750]) circle(r=0.508,$fn=fn); + translate([2.540,34.290]) circle(r=0.508,$fn=fn); + translate([2.540,36.830]) circle(r=0.508,$fn=fn); + translate([2.540,39.370]) circle(r=0.508,$fn=fn); + translate([2.540,41.910]) circle(r=0.508,$fn=fn); + translate([2.540,44.450]) circle(r=0.508,$fn=fn); + translate([2.540,46.990]) circle(r=0.508,$fn=fn); + translate([29.210,11.430]) circle(r=0.508,$fn=fn); + translate([29.210,13.970]) circle(r=0.508,$fn=fn); + translate([29.210,16.510]) circle(r=0.508,$fn=fn); + translate([29.210,19.050]) circle(r=0.508,$fn=fn); + translate([29.210,21.590]) circle(r=0.508,$fn=fn); + translate([29.210,24.130]) circle(r=0.508,$fn=fn); + translate([29.210,26.670]) circle(r=0.508,$fn=fn); + translate([29.210,29.210]) circle(r=0.508,$fn=fn); + translate([29.210,31.750]) circle(r=0.508,$fn=fn); + translate([29.210,34.290]) circle(r=0.508,$fn=fn); + translate([29.210,36.830]) circle(r=0.508,$fn=fn); + translate([29.210,39.370]) circle(r=0.508,$fn=fn); + translate([29.210,41.910]) circle(r=0.508,$fn=fn); + translate([29.210,44.450]) circle(r=0.508,$fn=fn); + translate([29.210,46.990]) circle(r=0.508,$fn=fn); + translate([19.143,1.552]) circle(r=0.750,$fn=fn); + translate([11.943,1.552]) circle(r=0.750,$fn=fn); + translate([13.118,4.453]) circle(r=0.350,$fn=fn); + translate([17.968,4.453]) circle(r=0.350,$fn=fn); + + } + color("white",0.7) union() { + translate([3.810,46.355,board_thickness-0.025])linear_extrude(0.05) text("A0", font = "Liberation Sans", size = 1.295); + translate([4.128,43.815,board_thickness-0.025])linear_extrude(0.05) text("G", font = "Liberation Sans", size = 1.295); + translate([3.810,41.275,board_thickness-0.025])linear_extrude(0.05) text("VV", font = "Liberation Sans", size = 1.295); + translate([3.810,38.735,board_thickness-0.025])linear_extrude(0.05) text("S3", font = "Liberation Sans", size = 1.295); + translate([3.810,36.195,board_thickness-0.025])linear_extrude(0.05) text("S2", font = "Liberation Sans", size = 1.295); + translate([3.810,33.655,board_thickness-0.025])linear_extrude(0.05) text("S1", font = "Liberation Sans", size = 1.295); + translate([3.810,31.115,board_thickness-0.025])linear_extrude(0.05) text("SC", font = "Liberation Sans", size = 1.295); + translate([3.810,28.575,board_thickness-0.025])linear_extrude(0.05) text("S0", font = "Liberation Sans", size = 1.295); + translate([3.810,26.035,board_thickness-0.025])linear_extrude(0.05) text("SK", font = "Liberation Sans", size = 1.295); + translate([4.128,23.495,board_thickness-0.025])linear_extrude(0.05) text("G", font = "Liberation Sans", size = 1.295); + translate([3.810,20.955,board_thickness-0.025])linear_extrude(0.05) text("3V", font = "Liberation Sans", size = 1.295); + translate([3.810,18.415,board_thickness-0.025])linear_extrude(0.05) text("EN", font = "Liberation Sans", size = 1.295); + translate([3.810,15.875,board_thickness-0.025])linear_extrude(0.05) text("RST", font = "Liberation Sans", size = 1.295); + translate([4.128,13.335,board_thickness-0.025])linear_extrude(0.05) text("G", font = "Liberation Sans", size = 1.295); + translate([3.810,10.795,board_thickness-0.025])linear_extrude(0.05) text("VIN", font = "Liberation Sans", size = 1.295); + translate([10.478,3.175,board_thickness-0.025])rotate([0,0,90])linear_extrude(0.05) text("RST", font = "Liberation Sans", size = 1.295); + translate([11.430,6.033,board_thickness-0.025])linear_extrude(0.05) text("LOL1n", font = "Liberation Sans", size = 1.295); + translate([21.908,0.318,board_thickness-0.025])rotate([0,0,90])linear_extrude(0.05) text("FLASH", font = "Liberation Sans", size = 1.295); + translate([25.718,10.795,board_thickness-0.025])linear_extrude(0.05) text("3V", font = "Liberation Sans", size = 1.295); + translate([26.035,13.335,board_thickness-0.025])linear_extrude(0.05) text("G", font = "Liberation Sans", size = 1.295); + translate([25.718,15.875,board_thickness-0.025])linear_extrude(0.05) text("TX", font = "Liberation Sans", size = 1.295); + translate([25.718,18.415,board_thickness-0.025])linear_extrude(0.05) text("RX", font = "Liberation Sans", size = 1.295); + translate([25.718,20.955,board_thickness-0.025])linear_extrude(0.05) text("D8", font = "Liberation Sans", size = 1.295); + translate([25.718,23.495,board_thickness-0.025])linear_extrude(0.05) text("D7", font = "Liberation Sans", size = 1.295); + translate([25.718,26.035,board_thickness-0.025])linear_extrude(0.05) text("D6", font = "Liberation Sans", size = 1.295); + translate([25.718,28.575,board_thickness-0.025])linear_extrude(0.05) text("D5", font = "Liberation Sans", size = 1.295); + translate([25.718,36.195,board_thickness-0.025])linear_extrude(0.05) text("D4", font = "Liberation Sans", size = 1.295); + translate([25.718,38.735,board_thickness-0.025])linear_extrude(0.05) text("D3", font = "Liberation Sans", size = 1.295); + translate([25.718,41.275,board_thickness-0.025])linear_extrude(0.05) text("D2", font = "Liberation Sans", size = 1.295); + translate([25.718,43.815,board_thickness-0.025])linear_extrude(0.05) text("D1", font = "Liberation Sans", size = 1.295); + translate([25.718,46.355,board_thickness-0.025])linear_extrude(0.05) text("D0", font = "Liberation Sans", size = 1.295); + translate([26.035,31.115,board_thickness-0.025])linear_extrude(0.05) text("G", font = "Liberation Sans", size = 1.295); + translate([25.718,33.655,board_thickness-0.025])linear_extrude(0.05) text("3V", font = "Liberation Sans", size = 1.295); + translate([6.350,46.355,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("A0", font = "Liberation Sans", size = 1.295); + translate([6.033,43.815,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("G", font = "Liberation Sans", size = 1.295); + translate([6.350,41.275,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("VV", font = "Liberation Sans", size = 1.295); + translate([6.350,38.735,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("S3", font = "Liberation Sans", size = 1.295); + translate([6.350,36.195,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("S2", font = "Liberation Sans", size = 1.295); + translate([6.350,33.655,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("S1", font = "Liberation Sans", size = 1.295); + translate([6.350,31.115,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("SC", font = "Liberation Sans", size = 1.295); + translate([6.350,28.575,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("S0", font = "Liberation Sans", size = 1.295); + translate([6.350,26.035,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("SK", font = "Liberation Sans", size = 1.295); + translate([6.033,23.495,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("G", font = "Liberation Sans", size = 1.295); + translate([6.350,20.955,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("3V", font = "Liberation Sans", size = 1.295); + translate([6.350,18.415,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("EN", font = "Liberation Sans", size = 1.295); + translate([7.303,15.875,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("RST", font = "Liberation Sans", size = 1.295); + translate([5.715,13.335,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("G", font = "Liberation Sans", size = 1.295); + translate([6.985,10.795,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("VIN", font = "Liberation Sans", size = 1.295); + translate([27.623,10.795,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("3V", font = "Liberation Sans", size = 1.295); + translate([27.305,13.335,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("G", font = "Liberation Sans", size = 1.295); + translate([27.623,15.875,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("TX", font = "Liberation Sans", size = 1.295); + translate([27.623,18.415,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("RX", font = "Liberation Sans", size = 1.295); + translate([27.623,20.955,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("D8", font = "Liberation Sans", size = 1.295); + translate([27.623,23.495,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("D7", font = "Liberation Sans", size = 1.295); + translate([27.623,26.035,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("D6", font = "Liberation Sans", size = 1.295); + translate([27.623,28.575,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("D5", font = "Liberation Sans", size = 1.295); + translate([27.623,36.195,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("D4", font = "Liberation Sans", size = 1.295); + translate([27.623,38.735,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("D3", font = "Liberation Sans", size = 1.295); + translate([27.623,41.275,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("D2", font = "Liberation Sans", size = 1.295); + translate([27.940,43.815,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("D1", font = "Liberation Sans", size = 1.295); + translate([27.940,46.355,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("D0", font = "Liberation Sans", size = 1.295); + translate([27.305,31.115,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("G", font = "Liberation Sans", size = 1.295); + translate([27.623,33.655,0+0.025])rotate([180,0,180])linear_extrude(0.05) text("3V", font = "Liberation Sans", size = 1.295); + } //end text union() + union(){ // parts + translate([3.016,3.016,board_thickness])3_2_PAD(); //H1 MOUNT-PAD-ROUND3.2 + translate([28.416,3.016,board_thickness])3_2_PAD(); //H2 MOUNT-PAD-ROUND3.2 + translate([3.016,55.086,board_thickness])3_2_PAD(); //H3 MOUNT-PAD-ROUND3.2 + translate([28.416,55.086,board_thickness])3_2_PAD(); //H4 MOUNT-PAD-ROUND3.2 + translate([2.540,29.210,0])rotate([180,0,90])1X15_CB(); //JP1 + translate([29.210,29.210,0])rotate([180,0,90])1X15_CB(); //JP2 + translate([7.476,4.000,board_thickness])rotate([0,0,90])KMR2(); //SW1 SPST_TACT-KMR2 + translate([23.571,4.000,board_thickness])rotate([0,0,90])KMR2(); //SW2 SPST_TACT-KMR2 + translate([15.240,44.768,board_thickness])ESP_12(); //X1 + translate([15.543,-0.598,board_thickness])rotate([0,0,90])ZX62D_B_5PA8(); //X2 ZX62D-B-5PA8 + } + } //endunion() + module 3_2_PAD() //H1 MOUNT-PAD-ROUND3.2 + { + union(); + } + module 1X15_CB() + { + LSTB(n=15,m=1); + } + + module KMR2() { color("DarkSlateGray") cylinder(2.1,0.9,0.9, $fn=10); color("silver") translate([-2,-1.5,0]) cube([4,3,1.5]);// Button + } + + module ZX62D_B_5PA8() // MICRO USB + { + translate([5,0,0]) rotate([-90,180,90]) union() + { + color("silver") union() { difference() + { + translate([-3.80,0,0])linear_extrude(5) polygon([[7.6,1.1],[7.6,1.9],[6.9,2.6],[0.7,2.6],[0,1.9],[0,1.1],[1.1,0],[6.5,0]]); + + translate([-3.8+0.3,0.3,1]) linear_extrude(4.5) polygon([[0,0.9],[0,1.5],[0.5,2],[6.5,2],[7,1.5],[7,0.9],[6.1,0],[0.9,0]]); + } + translate([-3,2.3,5]) rotate([-30,0,0]) cube([6,0.3,0.6]); + translate([2.7,0.3,5]) rotate([-30,0,180]) cube([5.4,0.3,0.6]); + translate([-3.8+0.3,1.1,5]) rotate([-30,0,90]) cube([0.8,0.3,0.6]); + translate([+3.8-0.3,1.9,5]) rotate([-30,0,-90]) cube([0.8,0.3,0.6]); + } + color("DarkSlateGray") translate([-1.9,1.3,0.4]) cube([3.8,0.6,3.8]); + } + } + + module ESP_12(){ // Eagle Adafruit + board_thicknessA = 1.000000; + eta = 0.2; + rotate([0,0,90]) translate([-12.065+1,-8.09625,0]) union(){ // PCB whith parts and text + color("DarkSlateGray")linear_extrude(height=board_thicknessA,center=false, convexity=10) + polygon(points = [[0,16.192500],[24.13,16.1925],[24.13,0],[0,0]]); //Board + + color("Goldenrod",0.7) translate([0,0,board_thicknessA-0.017]) linear_extrude(height=0.035,center=false, convexity=10) difference() { + union() { + translate([17.463,3.004]) rotate([0,0,270.000]) square([1.092,1.397], center = true); //LED0805 A + translate([17.463,1.124]) rotate([0,0,270.000]) square([1.092,1.397], center = true); //LED0805 K + translate([1.558,1.318])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([3.558,1.318])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([5.558,1.318])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([7.558,1.318])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([9.558,1.318])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([11.558,1.318])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([13.558,1.318])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([15.558,1.318])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([15.558,14.953])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([13.558,14.953])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([11.558,14.953])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([9.558,14.953])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([7.558,14.953])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([5.558,14.953])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([3.558,14.953])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([1.558,14.953])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + EagleWire([18.891,0.635],[23.336,0.635],width=0.610,$fn=8); + EagleWire([23.336,0.635],[23.336,3.334],width=0.610,$fn=8); + EagleWire([23.336,3.334],[20.320,3.334],width=0.610,$fn=8); + EagleWire([20.320,3.334],[20.320,6.033],width=0.610,$fn=8); + EagleWire([20.320,6.033],[23.336,6.033],width=0.610,$fn=8); + EagleWire([23.336,6.033],[23.336,8.731],width=0.610,$fn=8); + EagleWire([23.336,8.731],[20.320,8.731],width=0.610,$fn=8); + EagleWire([20.320,8.731],[20.320,11.430],width=0.610,$fn=8); + EagleWire([20.320,11.430],[23.336,11.430],width=0.610,$fn=8); + EagleWire([23.336,11.430],[23.336,13.494],width=0.610,$fn=8); + EagleWire([23.336,13.494],[23.336,15.558],width=0.610,$fn=8); + EagleWire([23.336,15.558],[18.574,15.558],width=0.610,$fn=8); + EagleWire([23.336,13.494],[18.574,13.494],width=0.610,$fn=8); + translate([1.510,15.000]) circle(r=0.453,$fn=fn); + translate([3.510,15.000]) circle(r=0.453,$fn=fn); + translate([5.510,15.000]) circle(r=0.453,$fn=fn); + translate([7.510,15.000]) circle(r=0.453,$fn=fn); + translate([9.510,15.000]) circle(r=0.453,$fn=fn); + translate([11.510,15.000]) circle(r=0.453,$fn=fn); + translate([13.510,15.000]) circle(r=0.453,$fn=fn); + translate([15.510,15.000]) circle(r=0.453,$fn=fn); + translate([1.525,1.143]) circle(r=0.453,$fn=fn); + translate([3.525,1.143]) circle(r=0.453,$fn=fn); + translate([5.525,1.143]) circle(r=0.453,$fn=fn); + translate([7.525,1.143]) circle(r=0.453,$fn=fn); + translate([9.525,1.143]) circle(r=0.453,$fn=fn); + translate([11.525,1.143]) circle(r=0.453,$fn=fn); + translate([13.525,1.143]) circle(r=0.453,$fn=fn); + translate([15.525,1.143]) circle(r=0.453,$fn=fn); + } + + } +color("Goldenrod",0.7) translate([0,0,-0.017]) linear_extrude(height=0.035,center=false, convexity=10) difference() { + union() { + translate([1.510,15.000]) circle(r=0.453,$fn=fn); + translate([3.510,15.000]) circle(r=0.453,$fn=fn); + translate([5.510,15.000]) circle(r=0.453,$fn=fn); + translate([7.510,15.000]) circle(r=0.453,$fn=fn); + translate([9.510,15.000]) circle(r=0.453,$fn=fn); + translate([11.510,15.000]) circle(r=0.453,$fn=fn); + translate([13.510,15.000]) circle(r=0.453,$fn=fn); + translate([15.510,15.000]) circle(r=0.453,$fn=fn); + translate([1.525,1.143]) circle(r=0.453,$fn=fn); + translate([3.525,1.143]) circle(r=0.453,$fn=fn); + translate([5.525,1.143]) circle(r=0.453,$fn=fn); + translate([7.525,1.143]) circle(r=0.453,$fn=fn); + translate([9.525,1.143]) circle(r=0.453,$fn=fn); + translate([11.525,1.143]) circle(r=0.453,$fn=fn); + translate([13.525,1.143]) circle(r=0.453,$fn=fn); + translate([15.525,1.143]) circle(r=0.453,$fn=fn); + } + } + union(){ // parts + translate([8.731,8.096,board_thicknessA])rotate([0,0,90])SHIELD12X15(); //CA1 SHIELD12X15 + translate([17.463,2.064,board_thicknessA])rotate([0,0,270])LED0805(); //LED1 LED0805 + } + } //endunion() + module SHIELD12X15() //CA1 SHIELD12X15 + { + rotate([0,0,270]) + { + color ("silver") + linear_extrude(2.3) translate([-7.500000,-6.000000,0]) square([ 15.000000,12.000000]); //Board + + + } + } + module LED0805(Enable = false) + { + rotate([0,0,90]) + { + color("gray") translate([0,0,0.125/2]) cube([1.2,2,0.125], center = true); + if (!Enable) + { + color("green") linear_extrude(0.65,scale = 0.9) square([1.2,1.8],center = true); + } + else + { + color("lightgreen") linear_extrude(0.65,scale = 0.9) square([1.2,1.8],center = true); + } + } + } + + + } // end ESP12 + + +} // end module + +module EagleWire(start,end,width=0.4,$fn=5) // hull() n.a. in FreeCAD Importer +{ + function bogen(point=[0,0], r = 1 ,phase = 0, winkel = 90, $fn=$fn) = [let(num=abs($fn*winkel/360)) for (i=[0:num], x=i*winkel/num) [point[0]+r*cos(x+phase),point[1]+r*sin(x+phase)]]; +function winkel(a,b=[0,0]) = atan2(a[1]-b[1],a[0]-b[0]); +polygon(concat(bogen(point=start, r=width/2 ,phase = winkel(start,end)-90, winkel = 180, $fn=$fn), bogen(point=end, r=width/2 ,phase = winkel(end,start)-90, winkel = 180, $fn=$fn))); +} + +module make_line_of(pitch, count) +{ + for (a = [0 : count - 1]) { + pos = a*pitch; + translate([pos, 0, 0]) + children(); + } +} + +module offset_square(size = [1,1], r = 0, delta = 0, chamfer=false, center = false, $fn = Detailgrad) // offset() n.a. in FreeCAD Importer +{ + num = round($fn/4); + plus = delta*0.41425; + function bogen(point=[0,0],phase = 0) = [for (i=[0:num], x=i*90/num) [point[0]+r*sin(x+phase),point[1]+r*cos(x+phase)]]; + function poli_round() = concat(bogen([0,0],180),bogen([0,size[1]],-90),bogen([size[0],size[1]],0),bogen([size[0],0],90)); + function poli_phase() = concat([[0-delta,0-plus],[0-delta,size[1]+plus],[0-plus,size[1]+delta],[size[0]+plus,size[1]+delta],[size[0]+delta,size[1]+plus],[size[0]+delta,0-plus],[size[0]+plus,-delta],[0-plus,-delta]]); + + if (r==0) + { + if (chamfer) + { + if (center) + translate([-size[0]/2,-size[1]/2]) polygon(poli_phase()); + else + polygon(poli_phase()); + } + else + { + if (center) square([size[0]+2*delta,size[1]+2*delta], center = center); + else + translate([-delta,-delta]) square([size[0]+2*delta,size[1]+2*delta], center = center); + } + } + else + { + if (center) + translate([-size[0]/2,-size[1]/2]) polygon(poli_round()); + else + polygon(poli_round()); + } +} + +module LSTB(n=20,m=1) +{ + offs = 0.9; + height = 11.6; + pitch = 2.54; + pin = 0.6; + + translate([-(pitch/2)*n+offs,-(pitch/2)*m+offs,0]) make_line_of(pitch, n) color("lightgreen") linear_extrude(2.6) offset_square(size=[pitch-2*offs,pitch*m-2*offs], delta = offs, chamfer=true); + + translate([-(pitch/2)*(n-1),-(pitch/2)*(m-1),0]) make_line_of(pitch, n) color("Silver") translate([0,0,8.7-height/2]) cube([pin,pin,height], center = true); + + if (m>1) translate([-(pitch/2)*(n-1),+(pitch/2)*(m-1),0]) make_line_of(pitch, n) color("Silver") translate([0,0,8.7-height/2]) cube([pin,pin,height], center = true); + + if (m>2) translate([-(pitch/2)*(n-1),0,0]) make_line_of(pitch, n) color("Silver") translate([0,0,8.7-height/2]) cube([pin,pin,height], center = true); +} + +NodeMCU_Lua_Lolin(); //Show module +//Created by generate-scad.ulp version 1.1 diff --git a/example/Pi-Zero-W.scad b/example/Pi-Zero-W.scad new file mode 100755 index 0000000..231f3f6 --- /dev/null +++ b/example/Pi-Zero-W.scad @@ -0,0 +1,765 @@ +Detailgrad = 15; +$fn=Detailgrad; +module Pi_Zero_W(){ + board_thickness = 1.600000; + eta = 0.2; + board_polygon = [[61.912500,0.000000],[62.161606,0.009784],[62.409178,0.039088],[62.653688,0.087725],[62.893628,0.155394],[63.127519,0.241681],[63.353919,0.346053],[63.571431,0.467866],[63.778716,0.606369],[63.974497,0.760709],[64.157562,0.929934],[64.326788,1.113000],[64.481128,1.308781],[64.619631,1.516066],[64.741444,1.733578],[64.845816,1.959978],[64.932103,2.193869],[64.999772,2.433809],[65.048409,2.678319],[65.077713,2.925891],[65.087500,3.175000],[65.087500,26.987500],[65.066725,27.232813],[65.027928,27.475928],[64.971312,27.715522],[64.897191,27.950291],[64.805966,28.178956],[64.698131,28.400278],[64.574275,28.613044],[64.435075,28.816106],[64.281281,29.008350],[64.113737,29.188738],[63.933350,29.356281],[63.741106,29.510075],[63.538044,29.649275],[63.325278,29.773131],[63.103956,29.880966],[62.875291,29.972191],[62.640522,30.046313],[62.400928,30.102928],[62.157813,30.141725],[61.912500,30.162500],[3.175000,30.162500],[2.925891,30.152712],[2.678319,30.123409],[2.433809,30.074772],[2.193869,30.007103],[1.959978,29.920816],[1.733578,29.816444],[1.516066,29.694631],[1.308781,29.556128],[1.113000,29.401788],[0.929934,29.232563],[0.760709,29.049497],[0.606369,28.853716],[0.467866,28.646431],[0.346053,28.428919],[0.241681,28.202519],[0.155394,27.968628],[0.087725,27.728688],[0.039088,27.484178],[0.009784,27.236606],[0.000000,26.987500],[0.000000,3.175000],[0.010497,2.909434],[0.043113,2.645672],[0.097622,2.385550],[0.173641,2.130884],[0.270638,1.883447],[0.387944,1.644963],[0.524734,1.417097],[0.680056,1.201441],[0.852831,0.999491],[1.041850,0.812659],[1.245797,0.642247],[1.463250,0.489447],[1.692691,0.355319],[1.932525,0.240797],[2.181075,0.146687],[2.436609,0.073638],[2.697347,0.022163],[2.961472,-0.007378],[3.227141,-0.014781],[3.492500,0.000000]]; + board_size = [65.087500,30.162500]; + fn = Detailgrad; + board_origin = [0.000000,0.000000]; + translate([0,0,0]) union(){ // PCB whith parts and text + color("green")linear_extrude(height=board_thickness,center=false, convexity=10) + union(){ // PCB + difference(){ + translate(board_origin) polygon(points = board_polygon); //Board + translate([3.493,3.493]) circle(r=1.300000,$fn=fn); //Hole + translate([3.493,26.670]) circle(r=1.300000,$fn=fn); //Hole + translate([61.595,3.493]) circle(r=1.300000,$fn=fn); //Hole + translate([61.595,26.670]) circle(r=1.300000,$fn=fn); //Hole + if (Detailgrad > 9) { // Print part holes + translate([8.572,25.400])circle(r=0.508000,$fn=fn); //MA20-2 1 + translate([8.572,27.940])circle(r=0.508000,$fn=fn); //MA20-2 2 + translate([11.113,25.400])circle(r=0.508000,$fn=fn); //MA20-2 3 + translate([11.113,27.940])circle(r=0.508000,$fn=fn); //MA20-2 4 + translate([13.652,25.400])circle(r=0.508000,$fn=fn); //MA20-2 5 + translate([13.652,27.940])circle(r=0.508000,$fn=fn); //MA20-2 6 + translate([16.192,25.400])circle(r=0.508000,$fn=fn); //MA20-2 7 + translate([16.192,27.940])circle(r=0.508000,$fn=fn); //MA20-2 8 + translate([18.733,25.400])circle(r=0.508000,$fn=fn); //MA20-2 9 + translate([18.733,27.940])circle(r=0.508000,$fn=fn); //MA20-2 10 + translate([21.273,25.400])circle(r=0.508000,$fn=fn); //MA20-2 11 + translate([21.273,27.940])circle(r=0.508000,$fn=fn); //MA20-2 12 + translate([23.813,25.400])circle(r=0.508000,$fn=fn); //MA20-2 13 + translate([23.813,27.940])circle(r=0.508000,$fn=fn); //MA20-2 14 + translate([26.353,25.400])circle(r=0.508000,$fn=fn); //MA20-2 15 + translate([26.353,27.940])circle(r=0.508000,$fn=fn); //MA20-2 16 + translate([28.893,25.400])circle(r=0.508000,$fn=fn); //MA20-2 17 + translate([28.893,27.940])circle(r=0.508000,$fn=fn); //MA20-2 18 + translate([31.433,25.400])circle(r=0.508000,$fn=fn); //MA20-2 19 + translate([31.433,27.940])circle(r=0.508000,$fn=fn); //MA20-2 20 + translate([33.973,25.400])circle(r=0.508000,$fn=fn); //MA20-2 21 + translate([33.973,27.940])circle(r=0.508000,$fn=fn); //MA20-2 22 + translate([36.513,25.400])circle(r=0.508000,$fn=fn); //MA20-2 23 + translate([36.513,27.940])circle(r=0.508000,$fn=fn); //MA20-2 24 + translate([39.053,25.400])circle(r=0.508000,$fn=fn); //MA20-2 25 + translate([39.053,27.940])circle(r=0.508000,$fn=fn); //MA20-2 26 + translate([41.593,25.400])circle(r=0.508000,$fn=fn); //MA20-2 27 + translate([41.593,27.940])circle(r=0.508000,$fn=fn); //MA20-2 28 + translate([44.133,25.400])circle(r=0.508000,$fn=fn); //MA20-2 29 + translate([44.133,27.940])circle(r=0.508000,$fn=fn); //MA20-2 30 + translate([46.672,25.400])circle(r=0.508000,$fn=fn); //MA20-2 31 + translate([46.672,27.940])circle(r=0.508000,$fn=fn); //MA20-2 32 + translate([49.213,25.400])circle(r=0.508000,$fn=fn); //MA20-2 33 + translate([49.213,27.940])circle(r=0.508000,$fn=fn); //MA20-2 34 + translate([51.753,25.400])circle(r=0.508000,$fn=fn); //MA20-2 35 + translate([51.753,27.940])circle(r=0.508000,$fn=fn); //MA20-2 36 + translate([54.293,25.400])circle(r=0.508000,$fn=fn); //MA20-2 37 + translate([54.293,27.940])circle(r=0.508000,$fn=fn); //MA20-2 38 + translate([56.833,25.400])circle(r=0.508000,$fn=fn); //MA20-2 39 + translate([56.833,27.940])circle(r=0.508000,$fn=fn); //MA20-2 40 + translate([57.560,1.870])circle(r=0.750000,$fn=fn); //ZX62D-B-5PA8 S1 + translate([50.360,1.870])circle(r=0.750000,$fn=fn); //ZX62D-B-5PA8 S2 + translate([51.535,4.770])circle(r=0.350000,$fn=fn); //ZX62D-B-5PA8 S3 + translate([56.385,4.770])circle(r=0.350000,$fn=fn); //ZX62D-B-5PA8 S4 + translate([44.875,1.833])circle(r=0.750000,$fn=fn); //ZX62D-B-5PA8 S1 + translate([37.675,1.833])circle(r=0.750000,$fn=fn); //ZX62D-B-5PA8 S2 + translate([38.850,4.732])circle(r=0.350000,$fn=fn); //ZX62D-B-5PA8 S3 + translate([43.700,4.732])circle(r=0.350000,$fn=fn); //ZX62D-B-5PA8 S4 + } // end Print part holes + } //end difference() PCB - Holes + //Print a little cross in PCB holes + translate([3.493,3.493]) { polygon([[0,0],[-0.33,-0.33],[-0.33,0.33]]); polygon([[0,0],[0.33,0.33],[0.33,-0.33]]);} //Hole + translate([3.493,26.670]) { polygon([[0,0],[-0.33,-0.33],[-0.33,0.33]]); polygon([[0,0],[0.33,0.33],[0.33,-0.33]]);} //Hole + translate([61.595,3.493]) { polygon([[0,0],[-0.33,-0.33],[-0.33,0.33]]); polygon([[0,0],[0.33,0.33],[0.33,-0.33]]);} //Hole + translate([61.595,26.670]) { polygon([[0,0],[-0.33,-0.33],[-0.33,0.33]]); polygon([[0,0],[0.33,0.33],[0.33,-0.33]]);} //Hole + } //end union() // PCB +color("Goldenrod",0.7) translate([0,0,board_thickness-0.017]) linear_extrude(height=0.035,center=false, convexity=10) difference() { + union() { + translate([20.535,18.835])square([0.340,0.340], center = true); //FBGA-168 A1 + translate([21.035,18.835])square([0.340,0.340], center = true); //FBGA-168 A2 + translate([21.535,18.835])square([0.340,0.340], center = true); //FBGA-168 A3 + translate([22.035,18.835])square([0.340,0.340], center = true); //FBGA-168 A4 + translate([22.535,18.835])square([0.340,0.340], center = true); //FBGA-168 A5 + translate([23.035,18.835])square([0.340,0.340], center = true); //FBGA-168 A6 + translate([23.535,18.835])square([0.340,0.340], center = true); //FBGA-168 A7 + translate([24.035,18.835])square([0.340,0.340], center = true); //FBGA-168 A8 + translate([24.535,18.835])square([0.340,0.340], center = true); //FBGA-168 A9 + translate([25.035,18.835])square([0.340,0.340], center = true); //FBGA-168 A10 + translate([25.535,18.835])square([0.340,0.340], center = true); //FBGA-168 A11 + translate([26.035,18.835])square([0.340,0.340], center = true); //FBGA-168 A12 + translate([26.535,18.835])square([0.340,0.340], center = true); //FBGA-168 A13 + translate([27.035,18.835])square([0.340,0.340], center = true); //FBGA-168 A14 + translate([27.535,18.835])square([0.340,0.340], center = true); //FBGA-168 A15 + translate([28.035,18.835])square([0.340,0.340], center = true); //FBGA-168 A16 + translate([28.535,18.835])square([0.340,0.340], center = true); //FBGA-168 A17 + translate([29.035,18.835])square([0.340,0.340], center = true); //FBGA-168 A18 + translate([29.535,18.835])square([0.340,0.340], center = true); //FBGA-168 A19 + translate([30.035,18.835])square([0.340,0.340], center = true); //FBGA-168 A20 + translate([30.535,18.835])square([0.340,0.340], center = true); //FBGA-168 A21 + translate([31.035,18.835])square([0.340,0.340], center = true); //FBGA-168 A22 + translate([31.535,18.835])square([0.340,0.340], center = true); //FBGA-168 A23 + translate([20.535,8.835])square([0.340,0.340], center = true); //FBGA-168 AA1 + translate([21.035,8.835])square([0.340,0.340], center = true); //FBGA-168 AA2 + translate([31.035,8.835])square([0.340,0.340], center = true); //FBGA-168 AA22 + translate([31.535,8.835])square([0.340,0.340], center = true); //FBGA-168 AA23 + translate([20.535,8.335])square([0.340,0.340], center = true); //FBGA-168 AB1 + translate([21.035,8.335])square([0.340,0.340], center = true); //FBGA-168 AB2 + translate([21.535,8.335])square([0.340,0.340], center = true); //FBGA-168 AB3 + translate([22.035,8.335])square([0.340,0.340], center = true); //FBGA-168 AB4 + translate([22.535,8.335])square([0.340,0.340], center = true); //FBGA-168 AB5 + translate([23.035,8.335])square([0.340,0.340], center = true); //FBGA-168 AB6 + translate([23.535,8.335])square([0.340,0.340], center = true); //FBGA-168 AB7 + translate([24.035,8.335])square([0.340,0.340], center = true); //FBGA-168 AB8 + translate([24.535,8.335])square([0.340,0.340], center = true); //FBGA-168 AB9 + translate([25.035,8.335])square([0.340,0.340], center = true); //FBGA-168 AB10 + translate([25.535,8.335])square([0.340,0.340], center = true); //FBGA-168 AB11 + translate([26.035,8.335])square([0.340,0.340], center = true); //FBGA-168 AB12 + translate([26.535,8.335])square([0.340,0.340], center = true); //FBGA-168 AB13 + translate([27.035,8.335])square([0.340,0.340], center = true); //FBGA-168 AB14 + translate([27.535,8.335])square([0.340,0.340], center = true); //FBGA-168 AB15 + translate([28.035,8.335])square([0.340,0.340], center = true); //FBGA-168 AB16 + translate([28.535,8.335])square([0.340,0.340], center = true); //FBGA-168 AB17 + translate([29.035,8.335])square([0.340,0.340], center = true); //FBGA-168 AB18 + translate([29.535,8.335])square([0.340,0.340], center = true); //FBGA-168 AB19 + translate([30.035,8.335])square([0.340,0.340], center = true); //FBGA-168 AB20 + translate([30.535,8.335])square([0.340,0.340], center = true); //FBGA-168 AB21 + translate([31.035,8.335])square([0.340,0.340], center = true); //FBGA-168 AB22 + translate([31.535,8.335])square([0.340,0.340], center = true); //FBGA-168 AB23 + translate([20.535,7.835])square([0.340,0.340], center = true); //FBGA-168 AC1 + translate([21.035,7.835])square([0.340,0.340], center = true); //FBGA-168 AC2 + translate([21.535,7.835])square([0.340,0.340], center = true); //FBGA-168 AC3 + translate([22.035,7.835])square([0.340,0.340], center = true); //FBGA-168 AC4 + translate([22.535,7.835])square([0.340,0.340], center = true); //FBGA-168 AC5 + translate([23.035,7.835])square([0.340,0.340], center = true); //FBGA-168 AC6 + translate([23.535,7.835])square([0.340,0.340], center = true); //FBGA-168 AC7 + translate([24.035,7.835])square([0.340,0.340], center = true); //FBGA-168 AC8 + translate([24.535,7.835])square([0.340,0.340], center = true); //FBGA-168 AC9 + translate([25.035,7.835])square([0.340,0.340], center = true); //FBGA-168 AC10 + translate([25.535,7.835])square([0.340,0.340], center = true); //FBGA-168 AC11 + translate([26.035,7.835])square([0.340,0.340], center = true); //FBGA-168 AC12 + translate([26.535,7.835])square([0.340,0.340], center = true); //FBGA-168 AC13 + translate([27.035,7.835])square([0.340,0.340], center = true); //FBGA-168 AC14 + translate([27.535,7.835])square([0.340,0.340], center = true); //FBGA-168 AC15 + translate([28.035,7.835])square([0.340,0.340], center = true); //FBGA-168 AC16 + translate([28.535,7.835])square([0.340,0.340], center = true); //FBGA-168 AC17 + translate([29.035,7.835])square([0.340,0.340], center = true); //FBGA-168 AC18 + translate([29.535,7.835])square([0.340,0.340], center = true); //FBGA-168 AC19 + translate([30.035,7.835])square([0.340,0.340], center = true); //FBGA-168 AC20 + translate([30.535,7.835])square([0.340,0.340], center = true); //FBGA-168 AC21 + translate([31.035,7.835])square([0.340,0.340], center = true); //FBGA-168 AC22 + translate([31.535,7.835])square([0.340,0.340], center = true); //FBGA-168 AC23 + translate([20.535,18.335])square([0.340,0.340], center = true); //FBGA-168 B1 + translate([21.035,18.335])square([0.340,0.340], center = true); //FBGA-168 B2 + translate([21.535,18.335])square([0.340,0.340], center = true); //FBGA-168 B3 + translate([22.035,18.335])square([0.340,0.340], center = true); //FBGA-168 B4 + translate([22.535,18.335])square([0.340,0.340], center = true); //FBGA-168 B5 + translate([23.035,18.335])square([0.340,0.340], center = true); //FBGA-168 B6 + translate([23.535,18.335])square([0.340,0.340], center = true); //FBGA-168 B7 + translate([24.035,18.335])square([0.340,0.340], center = true); //FBGA-168 B8 + translate([24.535,18.335])square([0.340,0.340], center = true); //FBGA-168 B9 + translate([25.035,18.335])square([0.340,0.340], center = true); //FBGA-168 B10 + translate([25.535,18.335])square([0.340,0.340], center = true); //FBGA-168 B11 + translate([26.035,18.335])square([0.340,0.340], center = true); //FBGA-168 B12 + translate([26.535,18.335])square([0.340,0.340], center = true); //FBGA-168 B13 + translate([27.035,18.335])square([0.340,0.340], center = true); //FBGA-168 B14 + translate([27.535,18.335])square([0.340,0.340], center = true); //FBGA-168 B15 + translate([28.035,18.335])square([0.340,0.340], center = true); //FBGA-168 B16 + translate([28.535,18.335])square([0.340,0.340], center = true); //FBGA-168 B17 + translate([29.035,18.335])square([0.340,0.340], center = true); //FBGA-168 B18 + translate([29.535,18.335])square([0.340,0.340], center = true); //FBGA-168 B19 + translate([30.035,18.335])square([0.340,0.340], center = true); //FBGA-168 B20 + translate([30.535,18.335])square([0.340,0.340], center = true); //FBGA-168 B21 + translate([31.035,18.335])square([0.340,0.340], center = true); //FBGA-168 B22 + translate([31.535,18.335])square([0.340,0.340], center = true); //FBGA-168 B23 + translate([20.535,17.835])square([0.340,0.340], center = true); //FBGA-168 C1 + translate([21.035,17.835])square([0.340,0.340], center = true); //FBGA-168 C2 + translate([31.035,17.835])square([0.340,0.340], center = true); //FBGA-168 C22 + translate([31.535,17.835])square([0.340,0.340], center = true); //FBGA-168 C23 + translate([20.535,17.335])square([0.340,0.340], center = true); //FBGA-168 D1 + translate([21.035,17.335])square([0.340,0.340], center = true); //FBGA-168 D2 + translate([31.035,17.335])square([0.340,0.340], center = true); //FBGA-168 D22 + translate([31.535,17.335])square([0.340,0.340], center = true); //FBGA-168 D23 + translate([20.535,16.835])square([0.340,0.340], center = true); //FBGA-168 E1 + translate([21.035,16.835])square([0.340,0.340], center = true); //FBGA-168 E2 + translate([31.035,16.835])square([0.340,0.340], center = true); //FBGA-168 E22 + translate([31.535,16.835])square([0.340,0.340], center = true); //FBGA-168 E23 + translate([20.535,16.335])square([0.340,0.340], center = true); //FBGA-168 F1 + translate([21.035,16.335])square([0.340,0.340], center = true); //FBGA-168 F2 + translate([31.035,16.335])square([0.340,0.340], center = true); //FBGA-168 F22 + translate([31.535,16.335])square([0.340,0.340], center = true); //FBGA-168 F23 + translate([20.535,15.835])square([0.340,0.340], center = true); //FBGA-168 G1 + translate([21.035,15.835])square([0.340,0.340], center = true); //FBGA-168 G2 + translate([31.035,15.835])square([0.340,0.340], center = true); //FBGA-168 G22 + translate([31.535,15.835])square([0.340,0.340], center = true); //FBGA-168 G23 + translate([20.535,15.335])square([0.340,0.340], center = true); //FBGA-168 H1 + translate([21.035,15.335])square([0.340,0.340], center = true); //FBGA-168 H2 + translate([31.035,15.335])square([0.340,0.340], center = true); //FBGA-168 H22 + translate([31.535,15.335])square([0.340,0.340], center = true); //FBGA-168 H23 + translate([20.535,14.835])square([0.340,0.340], center = true); //FBGA-168 J1 + translate([21.035,14.835])square([0.340,0.340], center = true); //FBGA-168 J2 + translate([31.035,14.835])square([0.340,0.340], center = true); //FBGA-168 J22 + translate([31.535,14.835])square([0.340,0.340], center = true); //FBGA-168 J23 + translate([20.535,14.335])square([0.340,0.340], center = true); //FBGA-168 K1 + translate([21.035,14.335])square([0.340,0.340], center = true); //FBGA-168 K2 + translate([31.035,14.335])square([0.340,0.340], center = true); //FBGA-168 K22 + translate([31.535,14.335])square([0.340,0.340], center = true); //FBGA-168 K23 + translate([20.535,13.835])square([0.340,0.340], center = true); //FBGA-168 L1 + translate([21.035,13.835])square([0.340,0.340], center = true); //FBGA-168 L2 + translate([31.035,13.835])square([0.340,0.340], center = true); //FBGA-168 L22 + translate([31.535,13.835])square([0.340,0.340], center = true); //FBGA-168 L23 + translate([20.535,13.335])square([0.340,0.340], center = true); //FBGA-168 M1 + translate([21.035,13.335])square([0.340,0.340], center = true); //FBGA-168 M2 + translate([31.035,13.335])square([0.340,0.340], center = true); //FBGA-168 M22 + translate([31.535,13.335])square([0.340,0.340], center = true); //FBGA-168 M23 + translate([20.535,12.835])square([0.340,0.340], center = true); //FBGA-168 N1 + translate([21.035,12.835])square([0.340,0.340], center = true); //FBGA-168 N2 + translate([31.035,12.835])square([0.340,0.340], center = true); //FBGA-168 N22 + translate([31.535,12.835])square([0.340,0.340], center = true); //FBGA-168 N23 + translate([20.535,12.335])square([0.340,0.340], center = true); //FBGA-168 P1 + translate([21.035,12.335])square([0.340,0.340], center = true); //FBGA-168 P2 + translate([31.035,12.335])square([0.340,0.340], center = true); //FBGA-168 P22 + translate([31.535,12.335])square([0.340,0.340], center = true); //FBGA-168 P23 + translate([20.535,11.835])square([0.340,0.340], center = true); //FBGA-168 R1 + translate([21.035,11.835])square([0.340,0.340], center = true); //FBGA-168 R2 + translate([31.035,11.835])square([0.340,0.340], center = true); //FBGA-168 R22 + translate([31.535,11.835])square([0.340,0.340], center = true); //FBGA-168 R23 + translate([20.535,11.335])square([0.340,0.340], center = true); //FBGA-168 T1 + translate([21.035,11.335])square([0.340,0.340], center = true); //FBGA-168 T2 + translate([31.035,11.335])square([0.340,0.340], center = true); //FBGA-168 T22 + translate([31.535,11.335])square([0.340,0.340], center = true); //FBGA-168 T23 + translate([20.535,10.835])square([0.340,0.340], center = true); //FBGA-168 U1 + translate([21.035,10.835])square([0.340,0.340], center = true); //FBGA-168 U2 + translate([31.035,10.835])square([0.340,0.340], center = true); //FBGA-168 U22 + translate([31.535,10.835])square([0.340,0.340], center = true); //FBGA-168 U23 + translate([20.535,10.335])square([0.340,0.340], center = true); //FBGA-168 V1 + translate([21.035,10.335])square([0.340,0.340], center = true); //FBGA-168 V2 + translate([31.035,10.335])square([0.340,0.340], center = true); //FBGA-168 V22 + translate([31.535,10.335])square([0.340,0.340], center = true); //FBGA-168 V23 + translate([20.535,9.835])square([0.340,0.340], center = true); //FBGA-168 W1 + translate([21.035,9.835])square([0.340,0.340], center = true); //FBGA-168 W2 + translate([31.035,9.835])square([0.340,0.340], center = true); //FBGA-168 W22 + translate([31.535,9.835])square([0.340,0.340], center = true); //FBGA-168 W23 + translate([20.535,9.335])square([0.340,0.340], center = true); //FBGA-168 Y1 + translate([21.035,9.335])square([0.340,0.340], center = true); //FBGA-168 Y2 + translate([31.035,9.335])square([0.340,0.340], center = true); //FBGA-168 Y22 + translate([31.535,9.335])square([0.340,0.340], center = true); //FBGA-168 Y23 + translate([61.119,9.808]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 1 + translate([61.119,10.308]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 2 + translate([61.119,10.808]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 3 + translate([61.119,11.308]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 4 + translate([61.119,11.808]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 5 + translate([61.119,12.308]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 6 + translate([61.119,12.808]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 7 + translate([61.119,13.308]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 8 + translate([61.119,13.808]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 9 + translate([61.119,14.308]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 10 + translate([61.119,14.808]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 11 + translate([61.119,15.308]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 12 + translate([61.119,15.808]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 13 + translate([61.119,16.308]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 14 + translate([61.119,16.808]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 15 + translate([61.119,17.308]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 16 + translate([61.119,17.808]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 17 + translate([61.119,18.308]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 18 + translate([61.119,18.808]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 19 + translate([61.119,19.308]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 20 + translate([61.119,19.808]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 21 + translate([61.119,20.308]) rotate([0,0,180.000]) square([1.000,0.250], center = true); //XF2L-2235-1 22 + translate([62.844,7.420]) rotate([0,0,180.000]) square([1.340,1.000], center = true); //XF2L-2235-1 M1 + translate([62.844,22.695]) rotate([0,0,180.000]) square([1.340,1.000], center = true); //XF2L-2235-1 M2 + translate([8.572,25.400]) circle(r=0.762,$fn=fn); + translate([8.572,27.940]) circle(r=0.762,$fn=fn); + translate([11.113,25.400]) circle(r=0.762,$fn=fn); + translate([11.113,27.940]) circle(r=0.762,$fn=fn); + translate([13.652,25.400]) circle(r=0.762,$fn=fn); + translate([13.652,27.940]) circle(r=0.762,$fn=fn); + translate([16.192,25.400]) circle(r=0.762,$fn=fn); + translate([16.192,27.940]) circle(r=0.762,$fn=fn); + translate([18.733,25.400]) circle(r=0.762,$fn=fn); + translate([18.733,27.940]) circle(r=0.762,$fn=fn); + translate([21.273,25.400]) circle(r=0.762,$fn=fn); + translate([21.273,27.940]) circle(r=0.762,$fn=fn); + translate([23.813,25.400]) circle(r=0.762,$fn=fn); + translate([23.813,27.940]) circle(r=0.762,$fn=fn); + translate([26.353,25.400]) circle(r=0.762,$fn=fn); + translate([26.353,27.940]) circle(r=0.762,$fn=fn); + translate([28.893,25.400]) circle(r=0.762,$fn=fn); + translate([28.893,27.940]) circle(r=0.762,$fn=fn); + translate([31.433,25.400]) circle(r=0.762,$fn=fn); + translate([31.433,27.940]) circle(r=0.762,$fn=fn); + translate([33.973,25.400]) circle(r=0.762,$fn=fn); + translate([33.973,27.940]) circle(r=0.762,$fn=fn); + translate([36.513,25.400]) circle(r=0.762,$fn=fn); + translate([36.513,27.940]) circle(r=0.762,$fn=fn); + translate([39.053,25.400]) circle(r=0.762,$fn=fn); + translate([39.053,27.940]) circle(r=0.762,$fn=fn); + translate([41.593,25.400]) circle(r=0.762,$fn=fn); + translate([41.593,27.940]) circle(r=0.762,$fn=fn); + translate([44.133,25.400]) circle(r=0.762,$fn=fn); + translate([44.133,27.940]) circle(r=0.762,$fn=fn); + translate([46.672,25.400]) circle(r=0.762,$fn=fn); + translate([46.672,27.940]) circle(r=0.762,$fn=fn); + translate([49.213,25.400]) circle(r=0.762,$fn=fn); + translate([49.213,27.940]) circle(r=0.762,$fn=fn); + translate([51.753,25.400]) circle(r=0.762,$fn=fn); + translate([51.753,27.940]) circle(r=0.762,$fn=fn); + translate([54.293,25.400]) circle(r=0.762,$fn=fn); + translate([54.293,27.940]) circle(r=0.762,$fn=fn); + translate([56.833,25.400]) circle(r=0.762,$fn=fn); + translate([56.833,27.940]) circle(r=0.762,$fn=fn); + translate([15.982,7.550]) rotate([0,0,90.000]) square([1.000,0.250], center = true); //MINI-HDMI 1 + translate([15.583,7.550]) rotate([0,0,90.000]) square([1.000,0.250], center = true); //MINI-HDMI 2 + translate([15.183,7.550]) rotate([0,0,90.000]) square([1.000,0.250], center = true); //MINI-HDMI 3 + translate([14.783,7.550]) rotate([0,0,90.000]) square([1.000,0.250], center = true); //MINI-HDMI 4 + translate([14.383,7.550]) rotate([0,0,90.000]) square([1.000,0.250], center = true); //MINI-HDMI 5 + translate([13.982,7.550]) rotate([0,0,90.000]) square([1.000,0.250], center = true); //MINI-HDMI 6 + translate([13.583,7.550]) rotate([0,0,90.000]) square([1.000,0.250], center = true); //MINI-HDMI 7 + translate([13.183,7.550]) rotate([0,0,90.000]) square([1.000,0.250], center = true); //MINI-HDMI 8 + translate([12.783,7.550]) rotate([0,0,90.000]) square([1.000,0.250], center = true); //MINI-HDMI 9 + translate([12.383,7.550]) rotate([0,0,90.000]) square([1.000,0.250], center = true); //MINI-HDMI 10 + translate([11.982,7.550]) rotate([0,0,90.000]) square([1.000,0.250], center = true); //MINI-HDMI 11 + translate([11.583,7.550]) rotate([0,0,90.000]) square([1.000,0.250], center = true); //MINI-HDMI 12 + translate([11.183,7.550]) rotate([0,0,90.000]) square([1.000,0.250], center = true); //MINI-HDMI 13 + translate([10.783,7.550]) rotate([0,0,90.000]) square([1.000,0.250], center = true); //MINI-HDMI 14 + translate([10.383,7.550]) rotate([0,0,90.000]) square([1.000,0.250], center = true); //MINI-HDMI 15 + translate([9.982,7.550]) rotate([0,0,90.000]) square([1.000,0.250], center = true); //MINI-HDMI 16 + translate([9.582,7.550]) rotate([0,0,90.000]) square([1.000,0.250], center = true); //MINI-HDMI 17 + translate([9.183,7.550]) rotate([0,0,90.000]) square([1.000,0.250], center = true); //MINI-HDMI 18 + translate([8.783,7.550]) rotate([0,0,90.000]) square([1.000,0.250], center = true); //MINI-HDMI 19 + translate([52.660,4.545]) rotate([0,0,90.000]) square([1.350,0.400], center = true); //ZX62D-B-5PA8 1 + translate([53.310,4.545]) rotate([0,0,90.000]) square([1.350,0.400], center = true); //ZX62D-B-5PA8 2 + translate([53.960,4.545]) rotate([0,0,90.000]) square([1.350,0.400], center = true); //ZX62D-B-5PA8 3 + translate([54.610,4.545]) rotate([0,0,90.000]) square([1.350,0.400], center = true); //ZX62D-B-5PA8 4 + translate([55.260,4.545]) rotate([0,0,90.000]) square([1.350,0.400], center = true); //ZX62D-B-5PA8 5 + translate([57.560,1.870]) circle(r=1.125,$fn=fn); + translate([50.360,1.870]) circle(r=1.125,$fn=fn); + translate([51.535,4.770]) circle(r=0.604,$fn=fn); + translate([56.385,4.770]) circle(r=0.604,$fn=fn); + translate([39.975,4.508]) rotate([0,0,90.000]) square([1.350,0.400], center = true); //ZX62D-B-5PA8 1 + translate([40.625,4.508]) rotate([0,0,90.000]) square([1.350,0.400], center = true); //ZX62D-B-5PA8 2 + translate([41.275,4.508]) rotate([0,0,90.000]) square([1.350,0.400], center = true); //ZX62D-B-5PA8 3 + translate([41.925,4.508]) rotate([0,0,90.000]) square([1.350,0.400], center = true); //ZX62D-B-5PA8 4 + translate([42.575,4.508]) rotate([0,0,90.000]) square([1.350,0.400], center = true); //ZX62D-B-5PA8 5 + translate([44.875,1.833]) circle(r=1.125,$fn=fn); + translate([37.675,1.833]) circle(r=1.125,$fn=fn); + translate([38.850,4.732]) circle(r=0.604,$fn=fn); + translate([43.700,4.732]) circle(r=0.604,$fn=fn); + translate([5.397,13.970]) rotate([0,0,90.000]) square([0.800,1.500], center = true); //693071010811 1 + translate([5.798,15.070]) rotate([0,0,90.000]) square([0.800,1.500], center = true); //693071010811 2 + translate([5.397,16.170]) rotate([0,0,90.000]) square([0.800,1.500], center = true); //693071010811 3 + translate([5.198,17.270]) rotate([0,0,90.000]) square([0.800,1.500], center = true); //693071010811 4 + translate([5.397,18.370]) rotate([0,0,90.000]) square([0.800,1.500], center = true); //693071010811 5 + translate([5.198,19.470]) rotate([0,0,90.000]) square([0.800,1.500], center = true); //693071010811 6 + translate([5.397,20.570]) rotate([0,0,90.000]) square([0.800,1.500], center = true); //693071010811 7 + translate([5.397,21.670]) rotate([0,0,90.000]) square([0.800,1.500], center = true); //693071010811 8 + translate([1.548,9.310]) rotate([0,0,90.000]) square([1.400,1.900], center = true); //693071010811 Z1 + translate([2.698,22.460]) rotate([0,0,90.000]) square([1.400,1.900], center = true); //693071010811 Z2 + translate([15.698,15.170]) rotate([0,0,90.000]) square([1.800,1.400], center = true); //693071010811 Z3 + translate([15.698,20.860]) rotate([0,0,90.000]) square([1.800,1.400], center = true); //693071010811 Z4 + } + translate([8.572,25.400]) circle(r=0.508,$fn=fn); + translate([8.572,27.940]) circle(r=0.508,$fn=fn); + translate([11.113,25.400]) circle(r=0.508,$fn=fn); + translate([11.113,27.940]) circle(r=0.508,$fn=fn); + translate([13.652,25.400]) circle(r=0.508,$fn=fn); + translate([13.652,27.940]) circle(r=0.508,$fn=fn); + translate([16.192,25.400]) circle(r=0.508,$fn=fn); + translate([16.192,27.940]) circle(r=0.508,$fn=fn); + translate([18.733,25.400]) circle(r=0.508,$fn=fn); + translate([18.733,27.940]) circle(r=0.508,$fn=fn); + translate([21.273,25.400]) circle(r=0.508,$fn=fn); + translate([21.273,27.940]) circle(r=0.508,$fn=fn); + translate([23.813,25.400]) circle(r=0.508,$fn=fn); + translate([23.813,27.940]) circle(r=0.508,$fn=fn); + translate([26.353,25.400]) circle(r=0.508,$fn=fn); + translate([26.353,27.940]) circle(r=0.508,$fn=fn); + translate([28.893,25.400]) circle(r=0.508,$fn=fn); + translate([28.893,27.940]) circle(r=0.508,$fn=fn); + translate([31.433,25.400]) circle(r=0.508,$fn=fn); + translate([31.433,27.940]) circle(r=0.508,$fn=fn); + translate([33.973,25.400]) circle(r=0.508,$fn=fn); + translate([33.973,27.940]) circle(r=0.508,$fn=fn); + translate([36.513,25.400]) circle(r=0.508,$fn=fn); + translate([36.513,27.940]) circle(r=0.508,$fn=fn); + translate([39.053,25.400]) circle(r=0.508,$fn=fn); + translate([39.053,27.940]) circle(r=0.508,$fn=fn); + translate([41.593,25.400]) circle(r=0.508,$fn=fn); + translate([41.593,27.940]) circle(r=0.508,$fn=fn); + translate([44.133,25.400]) circle(r=0.508,$fn=fn); + translate([44.133,27.940]) circle(r=0.508,$fn=fn); + translate([46.672,25.400]) circle(r=0.508,$fn=fn); + translate([46.672,27.940]) circle(r=0.508,$fn=fn); + translate([49.213,25.400]) circle(r=0.508,$fn=fn); + translate([49.213,27.940]) circle(r=0.508,$fn=fn); + translate([51.753,25.400]) circle(r=0.508,$fn=fn); + translate([51.753,27.940]) circle(r=0.508,$fn=fn); + translate([54.293,25.400]) circle(r=0.508,$fn=fn); + translate([54.293,27.940]) circle(r=0.508,$fn=fn); + translate([56.833,25.400]) circle(r=0.508,$fn=fn); + translate([56.833,27.940]) circle(r=0.508,$fn=fn); + translate([57.560,1.870]) circle(r=0.750,$fn=fn); + translate([50.360,1.870]) circle(r=0.750,$fn=fn); + translate([51.535,4.770]) circle(r=0.350,$fn=fn); + translate([56.385,4.770]) circle(r=0.350,$fn=fn); + translate([44.875,1.833]) circle(r=0.750,$fn=fn); + translate([37.675,1.833]) circle(r=0.750,$fn=fn); + translate([38.850,4.732]) circle(r=0.350,$fn=fn); + translate([43.700,4.732]) circle(r=0.350,$fn=fn); + + } +color("Goldenrod",0.7) translate([0,0,-0.017]) linear_extrude(height=0.035,center=false, convexity=10) difference() { + union() { + translate([8.572,25.400]) circle(r=0.762,$fn=fn); + translate([8.572,27.940]) circle(r=0.762,$fn=fn); + translate([11.113,25.400]) circle(r=0.762,$fn=fn); + translate([11.113,27.940]) circle(r=0.762,$fn=fn); + translate([13.652,25.400]) circle(r=0.762,$fn=fn); + translate([13.652,27.940]) circle(r=0.762,$fn=fn); + translate([16.192,25.400]) circle(r=0.762,$fn=fn); + translate([16.192,27.940]) circle(r=0.762,$fn=fn); + translate([18.733,25.400]) circle(r=0.762,$fn=fn); + translate([18.733,27.940]) circle(r=0.762,$fn=fn); + translate([21.273,25.400]) circle(r=0.762,$fn=fn); + translate([21.273,27.940]) circle(r=0.762,$fn=fn); + translate([23.813,25.400]) circle(r=0.762,$fn=fn); + translate([23.813,27.940]) circle(r=0.762,$fn=fn); + translate([26.353,25.400]) circle(r=0.762,$fn=fn); + translate([26.353,27.940]) circle(r=0.762,$fn=fn); + translate([28.893,25.400]) circle(r=0.762,$fn=fn); + translate([28.893,27.940]) circle(r=0.762,$fn=fn); + translate([31.433,25.400]) circle(r=0.762,$fn=fn); + translate([31.433,27.940]) circle(r=0.762,$fn=fn); + translate([33.973,25.400]) circle(r=0.762,$fn=fn); + translate([33.973,27.940]) circle(r=0.762,$fn=fn); + translate([36.513,25.400]) circle(r=0.762,$fn=fn); + translate([36.513,27.940]) circle(r=0.762,$fn=fn); + translate([39.053,25.400]) circle(r=0.762,$fn=fn); + translate([39.053,27.940]) circle(r=0.762,$fn=fn); + translate([41.593,25.400]) circle(r=0.762,$fn=fn); + translate([41.593,27.940]) circle(r=0.762,$fn=fn); + translate([44.133,25.400]) circle(r=0.762,$fn=fn); + translate([44.133,27.940]) circle(r=0.762,$fn=fn); + translate([46.672,25.400]) circle(r=0.762,$fn=fn); + translate([46.672,27.940]) circle(r=0.762,$fn=fn); + translate([49.213,25.400]) circle(r=0.762,$fn=fn); + translate([49.213,27.940]) circle(r=0.762,$fn=fn); + translate([51.753,25.400]) circle(r=0.762,$fn=fn); + translate([51.753,27.940]) circle(r=0.762,$fn=fn); + translate([54.293,25.400]) circle(r=0.762,$fn=fn); + translate([54.293,27.940]) circle(r=0.762,$fn=fn); + translate([56.833,25.400]) circle(r=0.762,$fn=fn); + translate([56.833,27.940]) circle(r=0.762,$fn=fn); + translate([57.560,1.870]) circle(r=1.125,$fn=fn); + translate([50.360,1.870]) circle(r=1.125,$fn=fn); + translate([51.535,4.770]) circle(r=0.604,$fn=fn); + translate([56.385,4.770]) circle(r=0.604,$fn=fn); + translate([44.875,1.833]) circle(r=1.125,$fn=fn); + translate([37.675,1.833]) circle(r=1.125,$fn=fn); + translate([38.850,4.732]) circle(r=0.604,$fn=fn); + translate([43.700,4.732]) circle(r=0.604,$fn=fn); + } + translate([8.572,25.400]) circle(r=0.508,$fn=fn); + translate([8.572,27.940]) circle(r=0.508,$fn=fn); + translate([11.113,25.400]) circle(r=0.508,$fn=fn); + translate([11.113,27.940]) circle(r=0.508,$fn=fn); + translate([13.652,25.400]) circle(r=0.508,$fn=fn); + translate([13.652,27.940]) circle(r=0.508,$fn=fn); + translate([16.192,25.400]) circle(r=0.508,$fn=fn); + translate([16.192,27.940]) circle(r=0.508,$fn=fn); + translate([18.733,25.400]) circle(r=0.508,$fn=fn); + translate([18.733,27.940]) circle(r=0.508,$fn=fn); + translate([21.273,25.400]) circle(r=0.508,$fn=fn); + translate([21.273,27.940]) circle(r=0.508,$fn=fn); + translate([23.813,25.400]) circle(r=0.508,$fn=fn); + translate([23.813,27.940]) circle(r=0.508,$fn=fn); + translate([26.353,25.400]) circle(r=0.508,$fn=fn); + translate([26.353,27.940]) circle(r=0.508,$fn=fn); + translate([28.893,25.400]) circle(r=0.508,$fn=fn); + translate([28.893,27.940]) circle(r=0.508,$fn=fn); + translate([31.433,25.400]) circle(r=0.508,$fn=fn); + translate([31.433,27.940]) circle(r=0.508,$fn=fn); + translate([33.973,25.400]) circle(r=0.508,$fn=fn); + translate([33.973,27.940]) circle(r=0.508,$fn=fn); + translate([36.513,25.400]) circle(r=0.508,$fn=fn); + translate([36.513,27.940]) circle(r=0.508,$fn=fn); + translate([39.053,25.400]) circle(r=0.508,$fn=fn); + translate([39.053,27.940]) circle(r=0.508,$fn=fn); + translate([41.593,25.400]) circle(r=0.508,$fn=fn); + translate([41.593,27.940]) circle(r=0.508,$fn=fn); + translate([44.133,25.400]) circle(r=0.508,$fn=fn); + translate([44.133,27.940]) circle(r=0.508,$fn=fn); + translate([46.672,25.400]) circle(r=0.508,$fn=fn); + translate([46.672,27.940]) circle(r=0.508,$fn=fn); + translate([49.213,25.400]) circle(r=0.508,$fn=fn); + translate([49.213,27.940]) circle(r=0.508,$fn=fn); + translate([51.753,25.400]) circle(r=0.508,$fn=fn); + translate([51.753,27.940]) circle(r=0.508,$fn=fn); + translate([54.293,25.400]) circle(r=0.508,$fn=fn); + translate([54.293,27.940]) circle(r=0.508,$fn=fn); + translate([56.833,25.400]) circle(r=0.508,$fn=fn); + translate([56.833,27.940]) circle(r=0.508,$fn=fn); + translate([57.560,1.870]) circle(r=0.750,$fn=fn); + translate([50.360,1.870]) circle(r=0.750,$fn=fn); + translate([51.535,4.770]) circle(r=0.350,$fn=fn); + translate([56.385,4.770]) circle(r=0.350,$fn=fn); + translate([44.875,1.833]) circle(r=0.750,$fn=fn); + translate([37.675,1.833]) circle(r=0.750,$fn=fn); + translate([38.850,4.732]) circle(r=0.350,$fn=fn); + translate([43.700,4.732]) circle(r=0.350,$fn=fn); + + } + color("white",0.7) union() { + translate([7.620,22.860,board_thickness-0.025])linear_extrude(0.05) text("3v3", font = "Liberation Sans", size = 0.829); + translate([9.843,22.860,board_thickness-0.025])linear_extrude(0.05) text("SDA", font = "Liberation Sans", size = 0.829); + translate([12.700,22.860,board_thickness-0.025])linear_extrude(0.05) text("SCL", font = "Liberation Sans", size = 0.829); + translate([15.558,22.860,board_thickness-0.025])linear_extrude(0.05) text("B4", font = "Liberation Sans", size = 0.829); + translate([17.463,22.860,board_thickness-0.025])linear_extrude(0.05) text("GND", font = "Liberation Sans", size = 0.829); + translate([20.320,22.860,board_thickness-0.025])linear_extrude(0.05) text("M17", font = "Liberation Sans", size = 0.829); + translate([22.860,22.860,board_thickness-0.025])linear_extrude(0.05) text("M27", font = "Liberation Sans", size = 0.829); + translate([25.400,22.860,board_thickness-0.025])linear_extrude(0.05) text("M22", font = "Liberation Sans", size = 0.829); + translate([27.940,22.860,board_thickness-0.025])linear_extrude(0.05) text("3v3", font = "Liberation Sans", size = 0.829); + translate([31.115,22.543,board_thickness-0.025])rotate([0,0,270])linear_extrude(0.05) text("MOSI", font = "Liberation Sans", size = 0.829); + translate([33.655,22.543,board_thickness-0.025])rotate([0,0,270])linear_extrude(0.05) text("MISO", font = "Liberation Sans", size = 0.829); + translate([36.195,22.543,board_thickness-0.025])rotate([0,0,270])linear_extrude(0.05) text("SCLK", font = "Liberation Sans", size = 0.829); + translate([38.100,22.860,board_thickness-0.025])linear_extrude(0.05) text("GND", font = "Liberation Sans", size = 0.829); + translate([40.958,22.860,board_thickness-0.025])linear_extrude(0.05) text("M0", font = "Liberation Sans", size = 0.829); + translate([43.498,22.860,board_thickness-0.025])linear_extrude(0.05) text("M5", font = "Liberation Sans", size = 0.829); + translate([46.038,22.860,board_thickness-0.025])linear_extrude(0.05) text("M6", font = "Liberation Sans", size = 0.829); + translate([48.578,22.543,board_thickness-0.025])rotate([0,0,270])linear_extrude(0.05) text("PWM1", font = "Liberation Sans", size = 0.829); + translate([30.480,22.860,board_thickness-0.025])linear_extrude(0.05) text("M10", font = "Liberation Sans", size = 0.829); + translate([33.337,22.860,board_thickness-0.025])linear_extrude(0.05) text("M9", font = "Liberation Sans", size = 0.829); + translate([35.560,22.860,board_thickness-0.025])linear_extrude(0.05) text("M11", font = "Liberation Sans", size = 0.829); + translate([48.260,22.860,board_thickness-0.025])linear_extrude(0.05) text("M13", font = "Liberation Sans", size = 0.829); + translate([50.800,22.860,board_thickness-0.025])linear_extrude(0.05) text("M19", font = "Liberation Sans", size = 0.829); + translate([51.435,22.225,board_thickness-0.025])rotate([0,0,270])linear_extrude(0.05) text("MISO", font = "Liberation Sans", size = 0.829); + translate([53.340,22.860,board_thickness-0.025])linear_extrude(0.05) text("M26", font = "Liberation Sans", size = 0.829); + translate([55.880,22.860,board_thickness-0.025])linear_extrude(0.05) text("GND", font = "Liberation Sans", size = 0.829); + translate([7.938,29.210,board_thickness-0.025])linear_extrude(0.05) text("5V", font = "Liberation Sans", size = 0.829); + translate([10.160,29.210,board_thickness-0.025])linear_extrude(0.05) text("5V", font = "Liberation Sans", size = 0.829); + translate([12.065,29.210,board_thickness-0.025])linear_extrude(0.05) text("GND", font = "Liberation Sans", size = 0.829); + translate([14.923,29.210,board_thickness-0.025])linear_extrude(0.05) text("M14", font = "Liberation Sans", size = 0.829); + translate([17.463,29.210,board_thickness-0.025])linear_extrude(0.05) text("M15", font = "Liberation Sans", size = 0.829); + translate([20.003,29.210,board_thickness-0.025])linear_extrude(0.05) text("M18", font = "Liberation Sans", size = 0.829); + translate([22.543,29.210,board_thickness-0.025])linear_extrude(0.05) text("GND", font = "Liberation Sans", size = 0.829); + translate([25.400,29.210,board_thickness-0.025])linear_extrude(0.05) text("M23", font = "Liberation Sans", size = 0.829); + translate([27.623,29.210,board_thickness-0.025])linear_extrude(0.05) text("M24", font = "Liberation Sans", size = 0.829); + translate([30.163,29.210,board_thickness-0.025])linear_extrude(0.05) text("GND", font = "Liberation Sans", size = 0.829); + translate([33.020,29.210,board_thickness-0.025])linear_extrude(0.05) text("M25", font = "Liberation Sans", size = 0.829); + translate([35.560,29.210,board_thickness-0.025])linear_extrude(0.05) text("M8", font = "Liberation Sans", size = 0.829); + translate([38.418,29.210,board_thickness-0.025])linear_extrude(0.05) text("M7", font = "Liberation Sans", size = 0.829); + translate([40.640,29.210,board_thickness-0.025])linear_extrude(0.05) text("M1", font = "Liberation Sans", size = 0.829); + translate([42.545,29.210,board_thickness-0.025])linear_extrude(0.05) text("GND", font = "Liberation Sans", size = 0.829); + translate([45.403,29.210,board_thickness-0.025])linear_extrude(0.05) text("M12", font = "Liberation Sans", size = 0.829); + translate([47.943,29.210,board_thickness-0.025])linear_extrude(0.05) text("GND", font = "Liberation Sans", size = 0.829); + translate([50.800,29.210,board_thickness-0.025])linear_extrude(0.05) text("M16", font = "Liberation Sans", size = 0.829); + translate([53.340,29.210,board_thickness-0.025])linear_extrude(0.05) text("M20", font = "Liberation Sans", size = 0.829); + translate([55.880,29.210,board_thickness-0.025])linear_extrude(0.05) text("M21", font = "Liberation Sans", size = 0.829); + } //end text union() + union(){ // parts + translate([26.035,13.335,board_thickness])FBGA_168(); //IC1 B4432BBPA-10-F-DUMMY + translate([63.024,15.558,board_thickness])rotate([0,0,180])XF2L_2235_1(); //J1 XF2L-2235-1 + translate([32.703,26.670,board_thickness])MA20_2(); //SV1 + translate([12.383,0.000,board_thickness])MINI_HDMI(); //U$1 HDMIMINI-H + translate([53.960,-0.280,board_thickness])rotate([0,0,90])ZX62D_B_5PA8(); //X2 ZX62D-B-5PA8 + translate([41.275,-0.318,board_thickness])rotate([0,0,90])ZX62D_B_5PA8(); //X3 ZX62D-B-5PA8 + translate([5.397,13.970,board_thickness])rotate([0,0,90])_693071010811(); //X8 693071010811 + } + } //endunion() + module FBGA_168() + { + color ("DarkSlateGray", 0.5) translate([-6.000000,-6.000000,0.27]) linear_extrude(0.45)square([12.000000,12.000000]); //Board + } + module XF2L_2235_1() + { + translate([1.20,0.5,0]) rotate(90) FPC_L(size = [17.2,4,1.4]); + } + module MA20_2() //SV1 + { + LSTB(n=20,m=2); + } + module MINI_HDMI() //U$1 HDMIMINI-H + { + translate([0,7.6,0]) rotate([-90,180,180]) union() + { + color("silver") union() { difference() + { + translate([-5.6,0,0])linear_extrude(7.6) polygon([[1.4,0],[9.8,0],[11.2,1.4],[11.2,3.2],[0,3.2],[0,1.4]]); + + translate([-5.6+0.3,0.3,1]) linear_extrude(7.1) polygon([[10.6,2.6],[10.6,1.2],[9.4,0],[1.2,0],[0,1.2],[0,2.6]]); + } + } + color("DarkSlateGray") translate([-4.25,1.5,0.4]) cube([8.5,0.6,6.5]); + } + } + module ZX62D_B_5PA8() // MICRO USB + { + translate([5,0,0]) rotate([-90,180,90]) union() + { + color("silver") union() { difference() + { + translate([-3.80,0,0])linear_extrude(5) polygon([[7.6,1.1],[7.6,1.9],[6.9,2.6],[0.7,2.6],[0,1.9],[0,1.1],[1.1,0],[6.5,0]]); + + translate([-3.8+0.3,0.3,1]) linear_extrude(4.5) polygon([[0,0.9],[0,1.5],[0.5,2],[6.5,2],[7,1.5],[7,0.9],[6.1,0],[0.9,0]]); + } + translate([-3,2.3,5]) rotate([-30,0,0]) cube([6,0.3,0.6]); + translate([2.7,0.3,5]) rotate([-30,0,180]) cube([5.4,0.3,0.6]); + translate([-3.8+0.3,1.1,5]) rotate([-30,0,90]) cube([0.8,0.3,0.6]); + translate([+3.8-0.3,1.9,5]) rotate([-30,0,-90]) cube([0.8,0.3,0.6]); + } + color("DarkSlateGray") translate([-1.9,1.3,0.4]) cube([3.8,0.6,3.8]); + } + } + module _693071010811() //SD Kartenhalter + { + rotate([0,0,270]) color("silver") translate([-4.5,-3.06,0]) cube([15.2,12,1.83]); //Board + } + + + +} // end module + +module EagleWire(start,end,width=0.4,$fn=5) // hull() n.a. in FreeCAD Importer +{ + function bogen(point=[0,0], r = 1 ,phase = 0, winkel = 90, $fn=$fn) = [let(num=abs($fn*winkel/360)) for (i=[0:num], x=i*winkel/num) [point[0]+r*cos(x+phase),point[1]+r*sin(x+phase)]]; +function winkel(a,b=[0,0]) = atan2(a[1]-b[1],a[0]-b[0]); +polygon(concat(bogen(point=start, r=width/2 ,phase = winkel(start,end)-90, winkel = 180, $fn=$fn), bogen(point=end, r=width/2 ,phase = winkel(end,start)-90, winkel = 180, $fn=$fn))); +} + + +module make_line_of(pitch, count) +{ + for (a = [0 : count - 1]) { + pos = a*pitch; + translate([pos, 0, 0]) + children(); + } +} + +module offset_square(size = [1,1], r = 0, delta = 0, chamfer=false, center = false, $fn = Detailgrad) // offset() n.a. in FreeCAD Importer +{ + num = round($fn/4); + plus = delta*0.41425; + function bogen(point=[0,0],phase = 0) = [for (i=[0:num], x=i*90/num) [point[0]+r*sin(x+phase),point[1]+r*cos(x+phase)]]; + function poli_round() = concat(bogen([0,0],180),bogen([0,size[1]],-90),bogen([size[0],size[1]],0),bogen([size[0],0],90)); + function poli_phase() = concat([[0-delta,0-plus],[0-delta,size[1]+plus],[0-plus,size[1]+delta],[size[0]+plus,size[1]+delta],[size[0]+delta,size[1]+plus],[size[0]+delta,0-plus],[size[0]+plus,-delta],[0-plus,-delta]]); + + if (r==0) + { + if (chamfer) + { + if (center) + translate([-size[0]/2,-size[1]/2]) polygon(poli_phase()); + else + polygon(poli_phase()); + } + else + { + if (center) square([size[0]+2*delta,size[1]+2*delta], center = center); + else + translate([-delta,-delta]) square([size[0]+2*delta,size[1]+2*delta], center = center); + } + } + else + { + if (center) + translate([-size[0]/2,-size[1]/2]) polygon(poli_round()); + else + polygon(poli_round()); + } +} + +module LSTB(n=20,m=1) +{ + offs = 0.9; + height = 11.6; + pitch = 2.54; + pin = 0.6; + + translate([-(pitch/2)*n+offs,-(pitch/2)*m+offs,0]) make_line_of(pitch, n) color("lightgreen") linear_extrude(2.6) offset_square(size=[pitch-2*offs,pitch*m-2*offs], delta = offs, chamfer=true); + + translate([-(pitch/2)*(n-1),-(pitch/2)*(m-1),0]) make_line_of(pitch, n) color("Silver") translate([0,0,8.7-height/2]) cube([pin,pin,height], center = true); + + if (m>1) translate([-(pitch/2)*(n-1),+(pitch/2)*(m-1),0]) make_line_of(pitch, n) color("Silver") translate([0,0,8.7-height/2]) cube([pin,pin,height], center = true); + + if (m>2) translate([-(pitch/2)*(n-1),0,0]) make_line_of(pitch, n) color("Silver") translate([0,0,8.7-height/2]) cube([pin,pin,height], center = true); +} + +module make_line_of(pitch, count) +{ + for (a = [0 : count - 1]) { + pos = a*pitch; + translate([pos, 0, 0]) + children(); + } +} + +module offset_square(size = [1,1], r = 0, delta = 0, chamfer=false, center = false, $fn = Detailgrad) // offset() n.a. in FreeCAD Importer +{ + num = round($fn/4); + plus = delta*0.41425; + function bogen(point=[0,0],phase = 0) = [for (i=[0:num], x=i*90/num) [point[0]+r*sin(x+phase),point[1]+r*cos(x+phase)]]; + function poli_round() = concat(bogen([0,0],180),bogen([0,size[1]],-90),bogen([size[0],size[1]],0),bogen([size[0],0],90)); + function poli_phase() = concat([[0-delta,0-plus],[0-delta,size[1]+plus],[0-plus,size[1]+delta],[size[0]+plus,size[1]+delta],[size[0]+delta,size[1]+plus],[size[0]+delta,0-plus],[size[0]+plus,-delta],[0-plus,-delta]]); + + if (r==0) + { + if (chamfer) + { + if (center) + translate([-size[0]/2,-size[1]/2]) polygon(poli_phase()); + else + polygon(poli_phase()); + } + else + { + if (center) square([size[0]+2*delta,size[1]+2*delta], center = center); + else + translate([-delta,-delta]) square([size[0]+2*delta,size[1]+2*delta], center = center); + } + } + else + { + if (center) + translate([-size[0]/2,-size[1]/2]) polygon(poli_round()); + else + polygon(poli_round()); + } +} + +module LSTB(n=20,m=1) +{ + offs = 0.9; + height = 11.6; + pitch = 2.54; + pin = 0.6; + + translate([-(pitch/2)*n+offs,-(pitch/2)*m+offs,0]) make_line_of(pitch, n) color("lightgreen") linear_extrude(2.6) offset_square(size=[pitch-2*offs,pitch*m-2*offs], delta = offs, chamfer=true); + + translate([-(pitch/2)*(n-1),-(pitch/2)*(m-1),0]) make_line_of(pitch, n) color("Silver") translate([0,0,8.7-height/2]) cube([pin,pin,height], center = true); + + if (m>1) translate([-(pitch/2)*(n-1),+(pitch/2)*(m-1),0]) make_line_of(pitch, n) color("Silver") translate([0,0,8.7-height/2]) cube([pin,pin,height], center = true); + + if (m>2) translate([-(pitch/2)*(n-1),0,0]) make_line_of(pitch, n) color("Silver") translate([0,0,8.7-height/2]) cube([pin,pin,height], center = true); +} + +module FPC_L(size = [12,4.5,2], pitch=0.5) +{ + NB_PINS = round((size[0]-6.4) / pitch); + pinlength = size[1]; + pinheight = 0.3; + + difference() + { + color("DarkSlateGray") translate([-size[0]/2,size[1]-1.3,0]) cube([size[0],1.3,2]); + translate([-(pitch*(NB_PINS+1))/2,size[1]-1.4,-0.05]) cube([pitch*(NB_PINS+1),1.5,1.25]); + } + difference() + { + color("Beige") translate([-(size[0]-2)/2,0,0]) cube([size[0]-2,size[1]-1.3,2]); + translate([-(pitch*(NB_PINS+1))/2,0.1,0.25]) cube([pitch*(NB_PINS+1),size[1]-1.3,0.8]); + } + + translate([pitch/4-(NB_PINS*pitch)/2,-1.1,0]) color("silver") make_line_of(pitch, NB_PINS) cube([pitch/2,pinlength,pinheight]); +} +Pi_Zero_W(); //Show module +//Created by generate-scad.ulp version 1.1 diff --git a/packages/packages.scad b/packages/packages.scad new file mode 100755 index 0000000..d42aad2 --- /dev/null +++ b/packages/packages.scad @@ -0,0 +1,4911 @@ +Detailgrad = Detailgrad ? Detailgrad : 10; +EnableText = EnableText ? EnableText : false; +function defined(a) = (a != undef); +Package_path = (defined(Package_path)) ? str(Package_path,"packages_STL/") : "./packages_STL/"; + +function downcase(str) = + str_join([for(char=str) let(code=ord(char)) code>=65 && code<=90 ? chr(code+32) : char]); + +module LPV2(Name="",Value="",Library="") {translate([1*1.27,0,0]) rotate([0,0,180]) LPV(2);} +module LPV2_SN(Name="",Value="",Library="") {translate([1*1.27,0,0]) rotate([0,0,180]) LPV(2);} +module LPV2_NTR(Name="",Value="",Library="") {translate([1*1.27,0,0]) rotate([0,0,180]) LPV(2);} +module LPV3(Name="",Value="",Library="") {translate([2*1.27,0,0]) rotate([0,0,180]) LPV(3);} +module LPV3_SN(Name="",Value="",Library="") {translate([2*1.27,0,0]) rotate([0,0,180]) LPV(3);} +module LPV3_SN2(Name="",Value="",Library="") {translate([2*1.27,0,0]) rotate([0,0,180]) LPV(3);} +module LPV5_SN(Name="",Value="",Library="") {translate([4*1.27,0,0]) rotate([0,0,180]) LPV(5);} +module LPV6_SN(Name="",Value="",Library="") {translate([5*1.27,0,0]) rotate([0,0,180]) LPV(6);} +module LPV8_SN(Name="",Value="",Library="") {translate([7*1.27,0,0]) rotate([0,0,180]) LPV(8);} +module LPV9_SN(Name="",Value="",Library="") {translate([8*1.27,0,0]) rotate([0,0,180]) LPV(9);} +module LPV3L(Name="",Value="",Library="") {translate([2*1.27,0,0]) rotate([0,0,180]) LPVL(3);} +module LPV4L_SN(Name="",Value="",Library="") {translate([3*1.27,0,0]) rotate([0,0,180]) LPVL(4);} + +module JST_10(Name="",Value="",Library="") {translate([12,0,0]) rotate([0,0,180]) JST(10);} +module JST_8(Name="",Value="",Library="") {translate([8,0,0]) rotate([0,0,180]) JST(8);} +module JST_7(Name="",Value="",Library="") {translate([6,0,0]) rotate([0,0,180]) JST(7);} +module JST_6(Name="",Value="",Library="") {translate([4,0,0]) rotate([0,0,180]) JST(6);} +module JST_5(Name="",Value="",Library="") {translate([4,0,0]) rotate([0,0,180]) JST(5);} +module JST_4(Name="",Value="",Library="") {translate([4,0,0]) rotate([0,0,180]) JST(4);} +module JST_3(Name="",Value="",Library="") {translate([2,0,0]) rotate([0,0,180]) JST(3);} +module JST_2(Name="",Value="",Library="") {translate([1,0,0]) rotate([0,0,180]) JST(2);} +module JST_2L(Name="",Value="",Library="") {translate([-1,0,0]) JSTL(2);} +module JST_3L(Name="",Value="",Library="") {translate([-2,0,0]) JSTL(3);} +module JST_4L(Name="",Value="",Library="") {translate([-2,0,0]) JSTL(4);} +module JST_5L(Name="",Value="",Library="") {translate([-4,0,0]) JSTL(5);} +module JST_6L(Name="",Value="",Library="") {translate([-6,0,0]) JSTL(6);} +module JST_7L(Name="",Value="",Library="") {translate([-6,0,0]) JSTL(7);} +module JST_8L(Name="",Value="",Library="") {translate([-8,0,0]) JSTL(8);} +module JST_10L(Name="",Value="",Library="") {translate([-2,0,0]) JSTL(10);} + +module JST_2_SM (Name="",Value="",Library="") {JSTSMD(n=2);} + +module JST_PH2P_ST90S(Name="",Value="",Library="") {translate([0,0,0]) JSTLSMD(2);} + +module JSTS_14L(Name="",Value="",Library="") {translate([-2,-2.8,0]) rotate([0,0,180]) SMD_IC([16,5.6,2],pinrows=1,pitch=1);} + +module JSTS_10L(Name="",Value="",Library=""){translate([-1,-2.8,0]) rotate([0,0,180]) SMD_IC([12.8,5.6,2],pinrows=1,pitch=1);} + +module JST_XH_03_PACKAGE_ROUND_PAD(Name="",Value="",Library="") {translate([-2.5,0,0]) JSTXH(3);} +module JST_XH_04_PACKAGE_LONG_PAD(Name="",Value="",Library="") {translate([-2.5-1.25,0,0]) JSTXH(4);} +module JST_XH_05_PACKAGE_ROUND_PAD(Name="",Value="",Library="") {translate([-2*2.5,0,0]) JSTXH(5);} +module JST_B4B_XH_A(Name="",Value="",Library="") {translate([+5-1.25,0,0]) rotate([0,0,180])JSTXH(4);} + +module MSTBV4A(Name="",Value="",Library="") {MSTBV(4,Library);BL508(4);} +module MSTBV3(Name="",Value="",Library="") {MSTBV(3,Library);} + +module MSTBA4I(Name="",Value="",Library="") {translate([5.08*1.5,0,4]) rotate([90,0,180]) MSTBV(n = 4);} +module MSTBA5I(Name="",Value="",Library="") {translate([5.08*2,0,4]) rotate([90,0,180]) MSTBV(n = 5);} + +module BL2(Name="",Value="",Library="") {translate([5.08*0,0,4]) rotate([90,0,180]) MSTBV(n = 2);} + +// M8 + +module F3_S718 (Name="",Value="",Library="") {cylinder(15,7,7);} + +// M12 +module M12_S5A(Name="",Value="",Library="") {M12_S(Pincount=5, binder = true);} +module M12_S5A_FLAT(Name="",Value="",Library="") {translate([0,0,-3]) M12_S(Pincount=5, binder = true);} +module M12_S8(Name="",Value="",Library="") { + color("silver") difference() + { + union() { cylinder(18,13.5/2,13.5/2); cylinder(11,15/2,15/2); cylinder(2,18/2,18/2); translate([0,0,8]) cylinder(2,20/2,20/2, $fn=6); } + translate([0,0,4]) cylinder(15,12/2,12/2); + } + translate([0,0,3]) color("DarkSlateGray") difference() + { + cylinder(16,4,4); + rotate([0,0,175]) make_ring_of(radius = 2.8, count=7, pie = 330) cylinder(17,0.5,0.5); + cylinder(17,0.5,0.5); + rotate([0,0,45]) translate([4,0,-0.2]) cylinder(17,0.7,0.7); + } + color("DarkSlateGray") translate([0,0,3]) rotate_extrude() translate([8,0])circle(1); +} + + + +module M12_S(Pincount=5, binder = true) +{ + l = binder ? 25.5 : 26; // 09 3442 90 05 Else TE: T4141012051-000 + hr = binder ? 3 : 4; + translate([0,0,3]) + { + color("silver") difference() + { + cylinder(12,15/2,15/2); + rotate([0,0,45]){ + translate([-10,0-13.5/2-5,0.8]) cube([20,5,20]); + translate([-10,13.5/2,0.8]) cube([20,5,20]); + } + } + + color("silver") difference() + { + union() { cylinder(l-7,13.5/2,13.5/2); translate([0,0,hr-3]) cylinder(2,18/2,18/2, $fn=6); translate([0,0,6]) cylinder(2.8,20/2,20/2, $fn=6); } + translate([0,0,4]) cylinder(16,12/2,12/2); + } + + translate([0,0,1]) color("DarkSlateGray") difference() + { + cylinder(l-7,4,4); + if (Pincount < 6) + { + make_ring_of(radius = 2.5, count=4) cylinder(l-6,0.7,0.7); + cylinder(l-6,0.7,0.7); + rotate([0,0,45]) translate([4,0,-0.2]) cylinder(l-6,1,1); + } + if (Pincount == 8) + { + rotate([0,0,175]) make_ring_of(radius = 2.8, count=7, pie = 330) cylinder(17,0.5,0.5); + cylinder(17,0.5,0.5); + rotate([0,0,45]) translate([4,0,-0.2]) cylinder(17,0.7,0.7); + } + } + color("DarkSlateGray") translate([0,0,hr]) rotate_extrude() translate([8,0])circle(1); + } + if (Pincount == 5) + { + make_ring_of(radius = 5/2, count=4) cylinderpart(size = [1.6,3]); + cylinderpart(size = [1.6,3]); + make_ring_of(radius = 5/2, count=4) LOETPIN(height = 3,dim = 1,rnd = true); + LOETPIN(height = 3, dim = 1,rnd = true); + } +} + + + + +module M12_P_SINGLE(Pincount = 5) +{ + l = 23; // Binder 09 3441 90 05 + // Körper + color("silver") difference() + { + union() { + cylinder(l-1,12/2,12/2); + } + translate([0,0,4]) cylinder(l,11.02/2,11.02/2); + } + + union() + { + translate([0,0,1]) difference() + { + color("DarkSlateGray") cylinder(l-1,11/2,11/2); + color("DarkSlateGray") cylinder(l,4,4); + } + color("DarkSlateGray") rotate([0,0,45]) translate([4,0,1-0.2]) cylinder(l-1,1,1); + if (Pincount == 5) color("silver") + { + make_ring_of(radius = 2.5, count=4) cylinder(l-1,0.5,0.57); + cylinder(l-1,0.5,0.5); + } + } +} + +module M12_P(Pincount = 5) +{ + l = 23; // Binder 09 3441 90 05 + hr = 3; + translate([0,0,hr]) + { + // PG9 Verschraubung + color("silver") difference() + { + cylinder(l-11,15/2,15/2); + rotate([0,0,45]){ + translate([-10,0-13.5/2-5,0.8]) cube([20,5,20]); + translate([-10,13.5/2,0.8]) cube([20,5,20]); + } + + } + // Körper + color("silver") difference() + { + union() { + cylinder(l-1,12/2,12/2); + cylinder(2,18/2,18/2, $fn=6); // Sockelmutter + translate([0,0,6]) cylinder(2.8,20/2,20/2, $fn=6); // Mutter + } + translate([0,0,4]) cylinder(l,11.02/2,11.02/2); + } + + + union() + { + translate([0,0,1]) difference() + { + color("DarkSlateGray") cylinder(l-1,11/2,11/2); + color("DarkSlateGray") cylinder(l,4,4); + } + color("DarkSlateGray") rotate([0,0,45]) translate([4,0,1-0.2]) cylinder(l-1,1,1); + if (Pincount == 5) color("silver") + { + make_ring_of(radius = 2.5, count=4) cylinder(l-1,0.5,0.57); + cylinder(l-1,0.5,0.5); + } + } + // Dichtung + color("DarkSlateGray") translate([0,0,hr]) rotate_extrude() translate([8,0])circle(1); + } + // Pins + if (Pincount == 5) + { + make_ring_of(radius = 5/2, count=4) cylinderpart(size = [1.6,3]); + cylinderpart(size = [1.6,3]); + make_ring_of(radius = 5/2, count=4) LOETPIN(height = 3,dim = 1,rnd = true); + LOETPIN(height = 3, dim = 1,rnd = true); + } +} + + +module M12_PHOENIX_HULL(h = 6) // h = Spacing between the top edge of the PCB and the back of the front plate +{ + h1 = (h == 7) ? 2.2 : 1.5; + h2 = (h == 7) ? 2.1 : 1.8; + translate([0,0,2.7]) + { + color("DarkSlateGray") translate([0,0,h1+h2-0.5]) rotate_extrude() translate([8.5,0])circle(0.5); + //cube([14,14,3], center = true); + color("Silver") difference() + { + union() + { + cylinder(2.2,16/2,16/2, $fn=6); + translate([0,0,h1]) cylinder(h2-1,19/2,19/2); + translate([0,0,h1]) cylinder(h2,16.3/2,16.3/2); + translate([0,0,2.3]) cylinder(13,13.5/2,13.5/2); + translate([0,0,2.3]) cylinder(7,15.3/2,15.3/2); + } + translate([0,0,15.3-7.6]) cylinder(8.5,11/2,11/2); + translate([0,0,-1]) cylinder(16.3,9/2,9/2); + rotate([0,0,-45]) translate([-10,6.4,h1+h2]) cube([20,5,20]); + rotate([0,0,-135]) translate([-10,6.4,h1+h2]) cube([20,5,20]); + rotate([0,0,45]) translate([-10,6.4,h1+h2]) cube([20,5,20]); + } + } + +} + +module M12_FEMALE_X_CODED_8_TB(Name="",Value="",Library="con-harting-rnd") +{ + translate([0,0,1]) + color("DarkSlateGray") + { + cylinder(8.3,9/2,9/2); + cylinder(3,10/2,10/2); + cylinder(1.2,11/2,11/2); + difference() + { + cylinder(18.5,8.2/2,8.2/2); rotate([0,0,22.5]) make_ring_of(radius = 3, count=8) cylinder(19,0.6,0.6); + translate([0,0,9]) + { cubepart([0.7,10,10]); cubepart([10,0.7,10]);translate([-1,-1,0]) cubepart([1.4,1.4,10]);} + } + } +} + + +module M12_FEMALE_A_CODED_5_TB(Name="",Value="",Library="con-harting-rnd") // Artikelnummer: 21 03 321 2518 +{ + color("DarkSlateGray") difference() + { + translate([0,0,0.9]) { + cylinder(24.1,8.15/2,8.15/2); + cylinder(13.4,12.5/2,12.5/2); + cylinder(3.1,15/2,15/2); + translate([0,0,3.1]) cylinder(1.3,15/2,12.5/2); + } + translate([-10,0-5.5-5,0.8]) cube([20,5,20]); + translate([-10,4.6,0.8]) cube([20,5,4.5]); + make_ring_of(radius = 5/2, count=4) cylinderpart(size = [1.1,26]); + cylinderpart(size = [1.1,26]); + rotate([0,0,-135]) translate([0,7.5/2,14.3]) union(){cylinderpart(size = [1.3,12]); translate([0,1.3/2,0]) cubepart(size = [1.3,1.3,12]);} + } + translate([0,0,0.9]) union() + { + make_ring_of(radius = 5/2, count=4) LOETPIN(dim = 0.8,rnd = true); + LOETPIN(dim = 0.8,rnd = true); + color("DarkSlateGray") union() + { + translate([4.9,-3.4,-3]) cylinderpart(size = [2.4,3]); + translate([-4.9,3.4,-3]) cylinderpart(size = [1.8,3]); + } + } +} + + +module 53261_02(Name="",Value="",Library="") //Molex Picoblade + { + rotate([0,0,90]) color("LightGoldenrodYellow") linear_extrude(4.6) translate([-1.375000,-4.000000,0]) square([4.000000,8.000000]); //Board + } + +// Phoenix +module _1881561(Name="",Value="",Library="") +{ + color("LimeGreen") cubepart([9.4,8.1,10.1]); +} + +module SCREWTERMINAL_3_5MM_2(Name="",Value="",Library="") +{ + color("LimeGreen") translate([3.5/2,-0.4,0]) cubepart([7,7.6,10.1]); +} + +module LP_4MM_H(Name="",Value="",Library="HAuto_CON_6") +{ + module pin() + { + translate([0,0,-3.4]) linear_extrude(0.8,scale=2) square([0.4,0.4],center = true); + translate([0,0,-2.6]) linear_extrude(2.6) square([0.8,0.8],center = true); + translate([0.3,0,-0.9]) linear_extrude(1.0) square([1.4,0.8],center = true); + } + translate([0,0,0.9]) + { + color(LEDCOLOR(Value)) + { + translate([-13.5,-6.000,0]) cube([19,12.000,11.5]); + translate([-13.5,0,5.5]) rotate([0,-90,0]) + linear_extrude(14) + { + difference() {circle(5.5); circle(4.5);} + difference() {circle(3); circle(2);} + } + } + color("Goldenrod") + { + translate([0,0,-3.1]) cylinder(3.1,1.05,1.05); + translate([0,0,-3.4]) cylinder(0.3,0.7,1.05); + translate([3.81,5.08,0]) rotate([0,0,180]) pin(); + translate([3.81,-5.08,0]) rotate([0,0,180]) pin(); + translate([-6.36,5.08,0]) pin(); + translate([-6.36,-5.08,0]) pin(); + } + } + + +} + + +module SPRING_PIN_0926_0(Name="",Value="",Library="MILL-MAX") +{ + color("Goldenrod") + { + //translate([0,0,-0.5]) // push in + { + cylinder(1.778,1.07/2,1.07/2); + translate([0,0,1.778]) sphere(1.07/2); + } + translate([0,0,0.0]) cylinder(1.4,1.4986/2,1.4986/2); + translate([0,0,0.762]) cylinder(0.28,1.6256/2,1.4986/2); + translate([0,0,0.0]) cylinder(0.254,2.159/2,2.159/2); + translate([0,0,-2.032]) cylinder(2.032,1.778/2,1.778/2); + } +} + +module SPRING_PIN_0926_1(Name="",Value="",Library="MILL-MAX") +{ + color("Goldenrod") + { + //translate([0,0,-0.7]) // push in + { + cylinder(2.6416,1.07/2,1.07/2); + translate([0,0,2.6416]) sphere(1.07/2); + } + translate([0,0,0.0]) cylinder(1.7,1.4986/2,1.4986/2); + translate([0,0,0.762]) cylinder(0.28,1.6256/2,1.4986/2); + translate([0,0,0.0]) cylinder(0.254,2.159/2,2.159/2); + translate([0,0,-2.032]) cylinder(2.032,1.778/2,1.778/2); + } +} + +module BNC_BU(Name="",Value="",Library="HAutomation_6") +{ + translate([2.54,7.1-1.27,0 ]) + { + color("Linen") cubepart([14.8,14.2,16]); + color("Linen") translate([0,7.1,8 ]) rotate([-90,00,0]) cylinder(8.8,11/2,11/2); + color("Silver") translate([0,7.1+8.8,8 ]) rotate([-90,00,0]) cylinder(12,9.5/2,9.5/2); + } +} +module BNC_180deg(Name="",Value="",Library="HAutomation_6") +{ + translate([-2.54,8,1.6 ]) rotate([90,00,00]) translate([2.54,7.1-1.27,0 ]) + { + color("Linen") cubepart([14.8,14.2,16]); + color("Linen") translate([0,7.1,8 ]) rotate([-90,00,0]) cylinder(8.8,11/2,11/2); + color("Silver") translate([0,7.1+8.8,8 ]) rotate([-90,00,0]) cylinder(12,9.5/2,9.5/2); + } +} + +module DIO5_BU(Name="",Value="",Library="HAutomation_6") +{ + color("DarkSlateGray") + { + translate([7.62,8.15-3.81,0 ]) cubepart([21.2,16.3,21]); + } +} + + +// Mischkontakt Steckverbinder 7W2 / 9W4 + +module M7W220A0(Name="",Value="",Library="") { + rotate([0,0,90]) union() + { + translate([0,0,8]) SUBD_HOUSE_M_EMPTY(1); + translate([-6.86,0,-2.7]) make_line_of(2*6.86,2) Hochstromstift20A(Name="",Value="",Library=""); + translate([-2.74,-2.84/2,-2.7]) make_line_of(2.74,3) PIN_SUB_D(Name="",Value="",Library=""); + translate([-2.74/2,2.84/2,-2.7]) make_line_of(2.74,2) PIN_SUB_D(Name="",Value="",Library=""); + } +} + + + +module M7W222A0(Name="",Value="",Library="") {M7W220A0(Name=Name,Value=Value,Library=Library);} + +module F7W220A0(Name="",Value="",Library="") +{ + translate([0,0,8]) rotate([0,0,90]) + difference() + { + SUBD_HOUSE_F_EMPTY(1); + translate([-2.74/2,2.84/2,8]) make_line_of(2.74, 2) LOETPIN(height = 12.9, dim = 1.2, rnd = true); + translate([-2.74, -2.84/2,8]) make_line_of(2.74, 3) LOETPIN(height = 12.9, dim = 1.2, rnd = true); + + translate([-6.86,0,8]) LOETPIN(height = 12.9, dim = 5.1, rnd = true); + translate([+6.86,0,8]) LOETPIN(height = 12.9, dim = 5.1, rnd = true); + + } + + translate([0,-6.86,-2.7]) rotate([0,0,90]) make_line_of(2*6.86,2) Hochstrombuchse20A(Name="",Value="",Library=""); +} + + + +module M7W220A9(Name="",Value="",Library="") +{ + h = 7.4; + rotate([0,0,-90]) union() + { + { + translate([0,1,h]) rotate([90,0,0]) SUBD_HOUSE_M_EMPTY(1); + color("Gol") translate([-6.86,7.6,h]) make_line_of(2*6.86,2) rotate([90,0,0]) Hochstromstift20A90(Name="",Value="",Library=""); + + translate([-2.74,11.8-2.54/2,h-2.0-2.84/2]) make_line_of(2.74,3) rotate([0,0,90]) BendedPIN(Diameter=0.8,l=8,l2=12.4+1.6, cl="Gol"); + translate([-2.74/2,11.8+2.54/2,h-2.0+2.84/2]) make_line_of(2.74,2) rotate([0,0,90]) BendedPIN(Diameter=0.8,l=10.8,l2=15+1.6, cl="Gol"); + } + } +} + + +module NC684S7W2103L461(Name="",Value="",Library="") rotate([0,0,-90]) union() +{ + h = 7.4; + { + translate([0,1,h]) rotate([90,0,0]) SUBD_HOUSE_M_EMPTY(1); + color("Gol") translate([-6.86,7.6,h]) make_line_of(2*6.86,2) rotate([90,0,0]) Hochstromstift20A90(d=3.75, l=4.5, t = 14); + translate([-2.74,11.5-2.54/2,h-2.0-2.84/2]) make_line_of(2.74,3) rotate([0,0,90]) BendedPIN(Diameter=0.8,l=8,l2=12.4+1.3, cl="Gol"); + translate([-2.74/2,11.5+2.54/2,h-2.0+2.84/2]) make_line_of(2.74,2) rotate([0,0,90]) BendedPIN(Diameter=0.8,l=10.8,l2=15+1.3, cl="Gol"); + } +} + +module F9W4_0(Name="",Value="",Library=""){translate([0,0,8]) rotate([0,0,-90]) + difference() + { + SUBD_HOUSE_F_EMPTY(2); + translate([-6.91-2.74/2,2.84/2,8]) make_line_of(2.74, 2) LOETPIN(height = 12.9, dim = 1.2, rnd = true); + translate([-6.91-2.74, -2.84/2,8]) make_line_of(2.74, 3) LOETPIN(height = 12.9, dim = 1.2, rnd = true); + translate([+14.48,0,8]) LOETPIN(height = 12.9, dim = 5.1, rnd = true); + translate([+7.7,0,8]) LOETPIN(height = 12.9, dim = 5.1, rnd = true); + translate([0,0,8]) LOETPIN(height = 12.9, dim = 5.1, rnd = true); + translate([-14.48,0,8]) LOETPIN(height = 12.9, dim = 5.1, rnd = true); + } + translate([0,-14.48,-2.7]) rotate([0,0,90]) make_line_of(2*14.48,2) Hochstrombuchse20A(Name="",Value="",Library=""); + translate([0,-7.7,5]) rotate([0,0,90]) make_line_of(7.7,2) color("IndianRed") cylinder(8,2,2); +} + +module M9W4_0(Name="",Value="",Library=""){rotate([0,0,90]) union() + { + translate([0,0,8]) SUBD_HOUSE_M_EMPTY(2); + translate([-14.48,0,-2.7]) make_line_of(2*14.48,2) Hochstromstift20A(Name="",Value="",Library=""); + translate([-7.7,0,4.5]) make_line_of(7.7,2) KoaxSocket(Name="",Value="",Library=""); + translate([6.91-2.74,-2.84/2,-2.7]) make_line_of(2.74,3) PIN_SUB_D(Name="",Value="",Library=""); + translate([6.91-2.74/2,2.84/2,-2.7]) make_line_of(2.74,2) PIN_SUB_D(Name="",Value="",Library=""); + } +} + +module M9W421A9(Name="",Value="",Library="") +{ + h = 7.4; + rotate([0,0,-90]) union() + { + { + translate([0,0,7.4]) rotate([90,0,0]) SUBD_HOUSE_M_EMPTY(2); + translate([-14.48,7.6,7.4]) make_line_of(2*14.48,2) rotate([90,0,0]) Hochstromstift20A90(); + translate([-7.7,6.8-2.5,7.4]) KoaxSocket90(11.6); + translate([-0,6.8-2.5,7.4]) KoaxSocket90(11.6); + translate([6.91-2.74,11.8-2.54/2,h-2.0-2.84/2]) make_line_of(2.74,3) rotate([0,0,90]) BendedPIN(Diameter=0.8,l=8,l2=12.4+1.6); + translate([6.91-2.74/2,11.8+2.54/2,h-2.0+2.84/2]) make_line_of(2.74,2) rotate([0,0,90]) BendedPIN(Diameter=0.8,l=10,l2=15+1.6); + } + } + + SUBD_WINKEL(size = 2, tiefe = 11.6); +} + +module Hochstromstift20A(Name="",Value="",Library="") +{ + l = 16.7; + + if (Detailgrad < 20) + { + translate([0,0,4.3]) cylinder(l-4.3,3.6/2,3.6/2); + cylinder(l,2.55/2,2.55/2); + } + else + { + translate([0,0,l-1-11.4]) cylinder(1,5.5/2,5.5/2); + translate([0,0,l-5.5-5.9]) cylinder(5.5,4.8/2,4.8/2); + translate([0,0,4.3]) Phased_cylinder(l-4.3,3.6/2,3.6/2, Roundness = 0.5); + translate([0,0,0]) Phased_cylinder(l,2.55/2,2.55/2, Roundness = 0.5); + } +} + +module Hochstromstift20A90(d=2.55, l=5.5,t=12.8 ) +{ + k = d-2.55; + translate([0,0,0]) cylinder(1,5.5/2,5.5/2); + translate([0,0,1]) cylinder(5.5,4.8/2,4.8/2); + translate([0,0,6.5]) Phased_cylinder(5.9,3.6/2,3.6/2, Roundness = 0.5); + translate([0,-2.25*d,+7.5-t]) rotate([90,90,180]) BendedPIN(Diameter=d, l=l,l2=0.1); +} + +module Hochstrombuchse20A(Name="",Value="",Library="") +{ + l = 17.1; + + if (Detailgrad < 20) + { + translate([0,0,4.3]) cylinder(l-4.3,4.8/2,4.8/2); + cylinder(l,2.55/2,2.55/2); + } + else + { + translate([0,0,l-1-11.8]) cylinder(1,5.5/2,5.5/2); + difference() + { + translate([0,0,l-11.8]) cylinder(11.8,4.8/2,4.8/2); + translate([0,0,l-5.9]) cylinder (6,3.6/2,3.6/2); + } + translate([0,0,0]) Phased_cylinder(6,2.55/2,2.55/2, Roundness = 0.5); + } +} + +module KoaxSocket(Name="",Value="",Library="") +{ + cylinder(2.45,4.8/2,4.8/2, $fn = Detailgrad); + difference() + { + union() + { + cylinder(9.5,4.6/2,4.6/2, $fn = Detailgrad); + translate([0,0,8.5])cylinder(1,4.8/2,4.8/2, $fn = Detailgrad); + } + cylinder(10,3.8/2,3.8/2, $fn = Detailgrad); + } + cylinder(9.5,0.75/2,0.75/2, $fn = Detailgrad); + translate([0,0,-7]) cylinder(7,5.5/2,5.5/2, $fn = Detailgrad); +} + +module KoaxSocket90(B = 9.3) +{ + rotate([90,0,0]) KoaxSocket(Name="",Value="",Library=""); + translate([-5.7/2,B-5.7,-7.7+5.5/2]) cube([5.7,5.7,7.7]); + translate([0,B-5.4,-6-7.7+5.5/2]) rotate([0,0,90]) make_line_of(2.54,3) translate([-0.8/4,-0.8/4,0]) cube([0.8/2,0.8/2,6]); +} + +// D-SUB / SUB-D +module PIN_SUB_D(Name="",Value="",Library="") +{ + l = 16.7; + color("Gold") translate([0,0,l]) LOETPIN(height = l, dim = 0.9, rnd = true); + //cylinder(l,0.9/2,0.9/2); +} + + + +module HDF15H(Name="",Value="",Library="") {translate([0,-11.4,0]) rotate([0,0,+90]) SUBD_H_FHD(0, height = 7.3, tiefe = 11.4);} +module HDF15HG(Name="",Value="",Library="") {HDF15H(Name=Name,Value=Value,Library=Library);} +module HDF15VG(Name="",Value="",Library="") {translate([0,0,8]) SUBD_HOUSE_FHD(0);} +module HDM15VG(Name="",Value="",Library="") {translate([0,0,8]) SUBD_HOUSE_MHD(0);} +module HDF15V(Name="",Value="",Library="") {translate([0,0,8]) SUBD_HOUSE_FHD(0);} +module M09VP(Name="",Value="",Library="") {translate([0,0,8]) SUBD_HOUSE_M(0);} +module M15VP(Name="",Value="",Library="") {translate([0,0,8]) SUBD_HOUSE_M(1);} +module M25VP(Name="",Value="",Library="") {translate([0,0,8]) SUBD_HOUSE_M(2);} +module F15V(Name="",Value="",Library="") {SUBD_V_F(size = 1, height = 7.4);} +module F15VP(Name="",Value="",Library="") {SUBD_V_F(size = 1, height = 7.4);} + + +module M15HP(Name="",Value="",Library="") {translate([0,-10.7,0]) rotate([0,0,90]) SUBD_H_M(size = 1, height = 7.3, tiefe = 10.7);} + +module F09VP(Name="",Value="",Library="") {SUBD_V_F(size = 0, height = 7.4);} +module F37VP(Name="",Value="",Library="") {SUBD_V_F(size = 3, height = 7.4);} +module F25VP(Name="",Value="",Library="") {SUBD_V_F(size = 2, height = 7.4);} +module F09HP(Name="",Value="",Library="") {translate([0,10.7,0]) rotate([0,0,-90]) SUBD_H_F(size = 0, height = 7.3, tiefe = 10.7);} +module F09H(Name="",Value="",Library="") {translate([0,10.7,0]) rotate([0,0,-90]) SUBD_H_F(size = 0, height = 7.3, tiefe = 10.7);} +module F15H(Name="",Value="",Library="") {translate([0,10.7,0]) rotate([0,0,-90]) SUBD_H_F(size = 1, height = 7.3, tiefe = 10.7);} +module F15HP(Name="",Value="",Library="") {translate([0,10.7,0]) rotate([0,0,-90]) SUBD_H_F(size = 1, height = 7.3, tiefe = 10.7);} +module F25HP(Name="",Value="",Library="") {translate([0,10.7,0]) rotate([0,0,-90]) SUBD_H_F(size = 2, height = 7.3, tiefe = 10.7);} + + +module DS9_SMD(Name="",Value="",Library="") {translate([0,7,-0.8]) rotate([90,0,180]) SUBD_HOUSE_M(0);} +module DS25_SMD(Name="",Value="",Library="") {translate([0,7,-0.8]) rotate([90,0,180]) SUBD_HOUSE_M(2);} +module M25D(Name="",Value="",Library="") {translate([0,1,-0.8]) rotate([90,0,180]) SUBD_HOUSE_M(2);} +module F25D(Name="",Value="",Library="") {translate([0,1,-0.8]) rotate([90,0,180]) SUBD_HOUSE_F(2);} + + +module MINID_H(size = 0, height = 7.3, tiefe = 10.7) +{ + // Standard Height 7.3, tiefe 10.7 + // Low Profile Height 3.6 + // US Footprint Height 6.3 + + raster = (size == 0) ? 2.74 : (size == 1) ? 2.74 : 2.76; + n = (size == 0) ? 9 : (size == 1) ? 15 : (size == 2) ? 25 : 37; + + + translate([0,0,height]) rotate([90,0,-90]) SUBD_HOUSE_M(size); + SUBD_WINKEL(size = size, tiefe = tiefe); + translate([tiefe+1.27,-(floor(n/2)/2)*raster,0]) rotate([0,0,90]) make_line_of(raster, floor(n/2)+1) LOETPIN(height = 2.9, dim = 0.8, rnd = true); + translate([tiefe-1.27,-floor(n/2)/2*raster+raster/2,0]) rotate([0,0,90]) make_line_of(raster, floor(n/2)) LOETPIN(height = 2.9, dim = 0.8, rnd = true); + +} + + +module SUBD_V_M(size = 0, height = 8) +{ + // Standard Height 7.3, tiefe 10.7 + // Low Profile Height 3.6 + // US Footprint Height 6.3 + + raster = (size == 0) ? 2.74 : (size == 1) ? 2.74 : 2.76; + n = (size == 0) ? 9 : (size == 1) ? 15 : (size == 2) ? 25 : 37; + + + translate([0,0,height]) SUBD_HOUSE_M(size); + + translate([-(floor(n/2)/2)*raster,1.42,height]) make_line_of(raster, floor(n/2)+1) LOETPIN(height = 2.9+height, dim = 0.8, rnd = true); + translate([-floor(n/2)/2*raster+raster/2,-1.42,height]) make_line_of(raster, floor(n/2)) LOETPIN(height = 2.9+height, dim = 0.8, rnd = true); +// +} + + + +module SUBD_V_MHD(size = 0, height = 8) +{ + // Standard Height 7.3, tiefe 10.7 + // Low Profile Height 3.6 + // US Footprint Height 6.3 + + raster = (size == 0) ? 2.74 : (size == 1) ? 2.74 : 2.76; + n = (size == 0) ? 9 : (size == 1) ? 15 : (size == 2) ? 25 : 37; + + + translate([0,0,height]) SUBD_HOUSE_MHD(size); + + translate([-(floor(n/2)/2)*raster,1.42,height]) make_line_of(raster, floor(n/2)+1) LOETPIN(height = 2.9+height, dim = 0.8, rnd = true); + translate([-floor(n/2)/2*raster+raster/2,-1.42,height]) make_line_of(raster, floor(n/2)) LOETPIN(height = 2.9+height, dim = 0.8, rnd = true); +// +} + + + +module SUBD_V_F(size = 0, height = 8) +{ + // Standard Height 7.3, tiefe 10.7 + // Low Profile Height 3.6 + // US Footprint Height 6.3 + + raster = (size == 0) ? 2.74 : (size == 1) ? 2.74 : 2.76; + n = (size == 0) ? 9 : (size == 1) ? 15 : (size == 2) ? 25 : 37; + + translate([0,0,height]) SUBD_HOUSE_F(size); + + translate([-(floor(n/2)/2)*raster,1.42,height]) make_line_of(raster, floor(n/2)+1) LOETPIN(height = 2.9+height, dim = 0.8, rnd = true); + translate([-floor(n/2)/2*raster+raster/2,-1.42,height]) make_line_of(raster, floor(n/2)) LOETPIN(height = 2.9+height, dim = 0.8, rnd = true); +// +} + + +module SUBD_H_M(size = 0, height = 7.3, tiefe = 10.7) +{ + // Standard Height 7.3, tiefe 10.7 + // Low Profile Height 3.6 + // US Footprint Height 6.3 + + raster = (size == 0) ? 2.74 : (size == 1) ? 2.74 : 2.76; + n = (size == 0) ? 9 : (size == 1) ? 15 : (size == 2) ? 25 : 37; + + + translate([0,0,height]) rotate([90,0,-90]) SUBD_HOUSE_M(size); + SUBD_WINKEL(size = size, tiefe = tiefe); + translate([tiefe+1.27,-(floor(n/2)/2)*raster,0]) rotate([0,0,90]) make_line_of(raster, floor(n/2)+1) LOETPIN(height = 2.9, dim = 0.8, rnd = true); + translate([tiefe-1.27,-floor(n/2)/2*raster+raster/2,0]) rotate([0,0,90]) make_line_of(raster, floor(n/2)) LOETPIN(height = 2.9, dim = 0.8, rnd = true); + +} + +module SUBD_H_F(size = 0, height = 7.3, tiefe = 10.7) +{ + // Standard Height 7.3, tiefe 10.7 + // Low Profile Height 3.6 + // US Footprint Height 6.3 + + raster = (size == 0) ? 2.74 : (size == 1) ? 2.74 : 2.76; + n = (size == 0) ? 9 : (size == 1) ? 15 : (size == 2) ? 25 : 37; + + + translate([0,0,height]) rotate([90,0,-90]) SUBD_HOUSE_F(size); + SUBD_WINKEL(size = size, tiefe = tiefe); + translate([tiefe+1.27,-(floor(n/2)/2)*raster,0]) rotate([0,0,90]) make_line_of(raster, floor(n/2)+1) LOETPIN(height = 2.9, dim = 0.8, rnd = true); + translate([tiefe-1.27,-floor(n/2)/2*raster+raster/2,0]) rotate([0,0,90]) make_line_of(raster, floor(n/2)) LOETPIN(height = 2.9, dim = 0.8, rnd = true); + +} +module SUBD_H_FHD(size = 0, height = 7.3, tiefe = 10.7) +{ + // Standard Height 7.3, tiefe 10.7 + // Low Profile Height 3.6 + // US Footprint Height 6.3 + + raster = ((size != 3) && (size != 4)) ? 2.29 : 2.41; + n = (size == 0) ? 15 : (size == 1) ? 26 : (size == 2) ? 44 : (size == 3) ? 62 : 78; + + translate([0,0,height]) rotate([90,0,-90]) SUBD_HOUSE_FHD(size); + SUBD_WINKEL(size = size, tiefe = tiefe); + + translate([tiefe+0,0,0]) rotate([0,0,-90]) union() + { + translate([-0.245-floor(n/3)/2*raster+raster/2, 5.1/2,2]) + make_line_of(raster, floor(n/3)) LOETPIN(height = 4.9, dim = 0.8, rnd = true); + translate([-0.245-floor(n/3)/2*raster+raster/2, -5.1/2,2]) make_line_of(raster, floor(n/3)) LOETPIN(height = 4.9, dim = 0.8, rnd = true); + + translate([-0.245-(floor(n/3)/2)*raster+raster,0,2]) make_line_of(raster, floor(n/3)) LOETPIN(height = 4.9, dim = 0.8, rnd = true); + } + + //translate([tiefe+1.27,-(floor(n/2)/2)*raster,0]) rotate([0,0,90]) make_line_of(raster, floor(n/2)+1) LOETPIN(height = 2.9, dim = 0.8, rnd = true); + // translate([tiefe-1.27,-floor(n/2)/2*raster+raster/2,0]) rotate([0,0,90]) make_line_of(raster, floor(n/2)) LOETPIN(height = 2.9, dim = 0.8, rnd = true); + +} + + +module SUBD_WINKEL(size = 0, tiefe = 10.7) +{ + // Todo: iredwas stimmt mit höhe und tiefe nicht + height1 = 0.8; + b = (size == 0) ? 25 : (size == 1) ? 33.3 : (size == 2) ? 47 : 63.5; + + color("Khaki") + { + translate([0.8,b/2-2,height1]) cube([4,4,11.4-1]); + translate([2,b/2-2,0]) rotate([90,0,90]) cube([4,3,tiefe+1]); + + translate([0.8,-b/2-2,height1]) cube([4,4,11.4-1]); + translate([2,-b/2-2,0]) rotate([90,0,90]) cube([4,3,tiefe+1]); + } + translate([tiefe,b/2,0]) LOETPIN(height = 2.9, dim = 3, rnd = true); + translate([tiefe,-b/2,0]) LOETPIN(height = 2.9, dim = 3, rnd = true); +} + + + +module MINID_HOUSE_M(size = 0) +{ + MaleOffset = 1; + length = (size == 0) ? 29.5 : (size == 1) ? 33.4 : (size == 2) ? 37.2 : 43.5; + holedist = length - 5.9; + length2 = length - 15.4; + length3 = length - 12; + whidth = 9.4; + whidth2 = 8; + whidth3 = 8; + height1 = 0.8; + height2 = 6.3; + height3 = 4.5; + + Offs = 2; + OffsD = 2.3; + OffsU = 1; + + color("darkgray") union() + { + translate([0,0,-height1]) linear_extrude(height1) + difference() {offset_square(size = [length-Offs, whidth-Offs], r = Offs/2, center = true, $fn = Detailgrad); translate([(holedist / 2), 0]) circle(3.1/2,$fn=Detailgrad); translate([(-holedist / 2),0]) circle(3.1/2,$fn=Detailgrad);} + //linear_extrude(height2) square([24.8-0.2, whidth2],center = true); + //Front + difference() { + PAINTSUBD(size = [length2+MaleOffset,whidth2+MaleOffset,height2], Offs = OffsD); + PAINTSUBD(size = [length2,whidth2,height2+0.1], Offs = OffsD); + } + // Back + translate([0,0,-(height3+height1)]) PAINTSUBD(size = [length3,whidth3,height3], Offs = OffsU); + } +} + + +module SUBD_HOUSE_M_EMPTY(size = 0) +{ + MaleOffset = 1; + length = (size == 0) ? 30.8 : (size == 1) ? 39.1 : (size == 2) ? 53 : 69.3; + holedist = length - 5.8; + length2 = length - 14.4; + length3 = length - 12; + whidth = 12.5; + whidth2 = 8; + whidth3 = 10; + height1 = 0.8; + height2 = 6.3; + height3 = 4.5; + + Offs = 2; + OffsD = 2.3; + OffsU = 1; + + raster = (size == 0) ? 2.74 : (size == 1) ? 2.74 : 2.76; + n = (size == 0) ? 9 : (size == 1) ? 15 : (size == 2) ? 25 : 37; + + color("darkgray") union() + { + translate([0,0,-height1]) linear_extrude(height1) difference() { + offset_square(size = [length-Offs, whidth-Offs], r = Offs/2, center = true, $fn = Detailgrad); translate([(holedist / 2), 0]) circle(3.1/2,$fn=Detailgrad); translate([(-holedist / 2),0]) circle(3.1/2,$fn=Detailgrad); + } + //linear_extrude(height2) square([24.8-0.2, whidth2],center = true); + //Front + difference() {PAINTSUBD(size = [length2+MaleOffset,whidth2+MaleOffset,height2], Offs = OffsD); PAINTSUBD(size = [length2,whidth2,height2+0.1], Offs = OffsD);} + // Back + translate([0,0,-(height3+height1)]) PAINTSUBD(size = [length3,whidth3,height3], Offs = OffsU); + } +} + + +module SUBD_HOUSE_M(size = 0) +{ + MaleOffset = 1; + length = (size == 0) ? 30.8 : (size == 1) ? 39.1 : (size == 2) ? 53 : 69.3; + holedist = length - 5.8; + length2 = length - 14.4; + length3 = length - 12; + whidth = 12.5; + whidth2 = 8; + whidth3 = 10; + height1 = 0.8; + height2 = 6.3; + height3 = 4.5; + + Offs = 2; + OffsD = 2.3; + OffsU = 1; + + raster = (size == 0) ? 2.74 : (size == 1) ? 2.74 : 2.76; + n = (size == 0) ? 9 : (size == 1) ? 15 : (size == 2) ? 25 : 37; + + color("darkgray") union() + { + translate([0,0,-height1]) linear_extrude(height1) + difference() {offset_square(size = [length-Offs, whidth-Offs], r = Offs/2, center = true, $fn = Detailgrad); translate([(holedist / 2), 0]) circle(3.1/2,$fn=Detailgrad); translate([(-holedist / 2),0]) circle(3.1/2,$fn=Detailgrad);} + //linear_extrude(height2) square([24.8-0.2, whidth2],center = true); + //Front + difference() { + PAINTSUBD(size = [length2+MaleOffset,whidth2+MaleOffset,height2], Offs = OffsD); + PAINTSUBD(size = [length2,whidth2,height2+0.1], Offs = OffsD); + } + // Back + translate([0,0,-(height3+height1)]) PAINTSUBD(size = [length3,whidth3,height3], Offs = OffsU); + } + translate([-(floor(n/2)/2)*raster,1.84/2,5]) make_line_of(raster, floor(n/2)+1) LOETPIN(height = 13.9, dim = 0.8, rnd = true); + translate([-floor(n/2)/2*raster+raster/2, -1.84/2,5]) make_line_of(raster, floor(n/2)) LOETPIN(height = 13.9, dim = 0.8, rnd = true); +} + +module SUBD_HOUSE_MHD(size = 0) +{ + MaleOffset = 1; + length = (size == 0) ? 30.8 : (size == 1) ? 39.1 : (size == 2) ? 53 : 69.3; + + holedist = length - 5.8; + length2 = length - 14.4; + length3 = length - 12; + whidth = 12.5; + whidth2 = 8; + whidth3 = 10; + height1 = 0.8; + height2 = 6.3; + height3 = 4.5; + + Offs = 2; + OffsD = 2.3; + OffsU = 1; + + raster = ((size != 3) && (size != 4)) ? 2.29 : 2.41; + + n = (size == 0) ? 15 : (size == 1) ? 26 : (size == 2) ? 44 : (size == 3) ? 62 : 78; + + color("darkgray") union() + { + translate([0,0,-height1]) linear_extrude(height1) + difference() {offset_square(size = [length-Offs, whidth-Offs], r = Offs/2, center = true, $fn = Detailgrad); translate([(holedist / 2), 0]) circle(3.1/2,$fn=Detailgrad); translate([(-holedist / 2),0]) circle(3.1/2,$fn=Detailgrad);} + //linear_extrude(height2) square([24.8-0.2, whidth2],center = true); + //Front + difference() { + PAINTSUBD(size = [length2+MaleOffset,whidth2+MaleOffset,height2], Offs = OffsD); + PAINTSUBD(size = [length2,whidth2,height2+0.1], Offs = OffsD); + } + // Back + translate([0,0,-(height3+height1)]) PAINTSUBD(size = [length3,whidth3,height3], Offs = OffsU); + } + + translate([0.245-floor(n/3)/2*raster+raster/2, 3.96/2,5]) + make_line_of(raster, floor(n/3)) LOETPIN(height = 15.9, dim = 0.8, rnd = true); + translate([0.245-floor(n/3)/2*raster+raster/2, -3.96/2,5]) make_line_of(raster, floor(n/3)) LOETPIN(height = 15.9, dim = 0.8, rnd = true); + + translate([0.245-(floor(n/3)/2)*raster,0,5]) make_line_of(raster, floor(n/3)) LOETPIN(height = 15.9, dim = 0.8, rnd = true); +} + +module SUBD_HOUSE_F(size = 0) +{ + MaleOffset = 1; + length = (size == 0) ? 30.8 : (size == 1) ? 39.1 : (size == 2) ? 53 : 69.3; + holedist = length - 5.8; + length2 = length - 14.4; + length3 = length - 12; + whidth = 12.5; + whidth2 = 8; + whidth3 = 10; + height1 = 0.8; + height2 = 6.3; + height3 = 4.5; + + Offs = 2; + OffsD = 2.3; + OffsU = 1; + + raster = (size == 0) ? 2.74 : (size == 1) ? 2.74 : 2.76; + n = (size == 0) ? 9 : (size == 1) ? 15 : (size == 2) ? 25 : 37; + + color("darkgray") union() + { + translate([0,0,-height1]) linear_extrude(height1) + difference() {offset_square(size = [length-Offs, whidth-Offs], r = Offs/2, center = true, $fn = Detailgrad); translate([(holedist / 2), 0]) circle(3.1/2,$fn=Detailgrad); translate([(-holedist / 2),0]) circle(3.1/2,$fn=Detailgrad);} + //linear_extrude(height2) square([24.8-0.2, whidth2],center = true); + //Front + difference() { + PAINTSUBD(size = [length2+MaleOffset,whidth2+MaleOffset,height2], Offs = OffsD); + // PAINTSUBD(size = [length2,whidth2,height2+0.1], Offs = OffsD); + translate([-(floor(n/2)/2)*raster,2.84/2,8])make_line_of(raster, floor(n/2)+1) LOETPIN(height = 12.9, dim = 1.2, rnd = true); + translate([-floor(n/2)/2*raster+raster/2, -2.84/2,8]) make_line_of(raster, floor(n/2)) LOETPIN(height = 12.9, dim = 1.2, rnd = true); + + } + // Back + translate([0,0,-(height3+height1)]) PAINTSUBD(size = [length3,whidth3,height3], Offs = OffsU); + translate([-(floor(n/2)/2)*raster,2.84/2,0]) make_line_of(raster, floor(n/2)+1) LOETPIN(height = 7.9, dim = 0.8, rnd = true); + translate([-floor(n/2)/2*raster+raster/2, -2.84/2,0]) make_line_of(raster, floor(n/2)) LOETPIN(height = 7.9, dim = 0.8, rnd = true); + + } + +} + +module SUBD_HOUSE_FHD(size = 0) +{ + MaleOffset = 1; + length = (size == 0) ? 30.8 : (size == 1) ? 39.1 : (size == 2) ? 53 : 69.3; + holedist = length - 5.8; + length2 = length - 14.4; + length3 = length - 12; + whidth = 12.5; + whidth2 = 8; + whidth3 = 10; + height1 = 0.8; + height2 = 6.3; + height3 = 4.5; + + Offs = 2; + OffsD = 2.3; + OffsU = 1; + + raster = ((size != 3) && (size != 4)) ? 2.29 : 2.41; + + n = (size == 0) ? 15 : (size == 1) ? 26 : (size == 2) ? 44 : (size == 3) ? 62 : 78; + + color("darkgray") union() + { + translate([0,0,-height1]) linear_extrude(height1) + difference() {offset_square(size = [length-Offs, whidth-Offs], r = Offs/2, center = true, $fn = Detailgrad); translate([(holedist / 2), 0]) circle(3.1/2,$fn=Detailgrad); translate([(-holedist / 2),0]) circle(3.1/2,$fn=Detailgrad);} + //linear_extrude(height2) square([24.8-0.2, whidth2],center = true); + //Front + difference() { + PAINTSUBD(size = [length2+MaleOffset,whidth2+MaleOffset,height2], Offs = OffsD); + // PAINTSUBD(size = [length2,whidth2,height2+0.1], Offs = OffsD); + + translate([-0.245-floor(n/3)/2*raster+raster/2, 3.96/2,8]) + make_line_of(raster, floor(n/3)) LOETPIN(height = 12.9, dim = 1.2, rnd = true); + translate([-0.245-floor(n/3)/2*raster+raster/2, -3.96/2,8]) make_line_of(raster, floor(n/3)) LOETPIN(height = 12.9, dim = 1.2, rnd = true); + + translate([-0.245-(floor(n/3)/2)*raster+raster,0,8]) make_line_of(raster, floor(n/3)) LOETPIN(height = 12.9, dim = 1.2, rnd = true); + + + + + } + // Back + translate([0,0,-(height3+height1)]) PAINTSUBD(size = [length3,whidth3,height3], Offs = OffsU); + +translate([-0.245-floor(n/3)/2*raster+raster/2, 3.96/2,2]) + make_line_of(raster, floor(n/3)) LOETPIN(height = 12.9, dim = 0.8, rnd = true); + translate([-0.245-floor(n/3)/2*raster+raster/2, -3.96/2,2]) make_line_of(raster, floor(n/3)) LOETPIN(height = 12.9, dim = 0.8, rnd = true); + + translate([-0.245-(floor(n/3)/2)*raster+raster,0,2]) make_line_of(raster, floor(n/3)) LOETPIN(height = 12.9, dim = 0.8, rnd = true); + + } + +} + + +module SUBD_HOUSE_F_EMPTY(size = 0) +{ + MaleOffset = 1; + length = (size == 0) ? 30.8 : (size == 1) ? 39.1 : (size == 2) ? 53 : 69.3; + holedist = length - 5.8; + length2 = length - 14.4; + length3 = length - 12; + whidth = 12.5; + whidth2 = 8; + whidth3 = 10; + height1 = 0.8; + height2 = 6.3; + height3 = 4.5; + + Offs = 2; + OffsD = 2.3; + OffsU = 1; + + raster = (size == 0) ? 2.74 : (size == 1) ? 2.74 : 2.76; + n = (size == 0) ? 9 : (size == 1) ? 15 : (size == 2) ? 25 : 37; + + color("darkgray") union() + { + translate([0,0,-height1]) linear_extrude(height1) + difference() {offset_square(size = [length-Offs, whidth-Offs], r = Offs/2, center = true, $fn = Detailgrad); translate([(holedist / 2), 0]) circle(3.1/2,$fn=Detailgrad); translate([(-holedist / 2),0]) circle(3.1/2,$fn=Detailgrad);} + //linear_extrude(height2) square([24.8-0.2, whidth2],center = true); + //Front + difference() { + PAINTSUBD(size = [length2+MaleOffset,whidth2+MaleOffset,height2], Offs = OffsD); + // PAINTSUBD(size = [length2,whidth2,height2+0.1], Offs = OffsD); + + + } + // Back + translate([0,0,-(height3+height1)]) PAINTSUBD(size = [length3,whidth3,height3], Offs = OffsU); + } +} +module PAINTSUBD(size = [16.4,8,6.3], Offs = 2) +{ + + if (Detailgrad < 10) + { + points = [[(size[0]/2),(size[1]/2)-Offs/2],[(size[0]/2)-Offs/2,(size[1]/2)], + [-(size[0]/2)+Offs/2,(size[1]/2)],[-(size[0]/2),(size[1]/2)-Offs/2], + [-(size[0]/2-1),-((size[1]/2))+Offs/2],[-(size[0]/2-1)+Offs/2,-((size[1]/2))], + [(size[0]/2-1)-Offs/2,-((size[1]/2))], [(size[0]/2-1),-((size[1]/2))+Offs/2]]; + linear_extrude(size[2]) polygon(points); + } + else + { + points = [[(size[0]/2-Offs),(size[1]/2)-Offs],[-(size[0]/2-Offs),(size[1]/2)-Offs],[-(size[0]/2-Offs-1),-((size[1]/2)-Offs)],[(size[0]/2-Offs-1),-((size[1]/2)-Offs)]]; + linear_extrude(size[2]) offset_polygon(points , r = Offs, $fn = Detailgrad); + } + //linear_extrude(size[2]) offset(Offs, $fn=Detailgrad) polygon(points); // Import in Freecad Fails +} + +// TASTER APEM + +module APEM_T3(Name="",Value="",Library="") +{ + translate([-3,0,5]) rotate([0,-90,0]) APEM_T3_BODY(Name="",Value="",Library=""); +} + +module APEM_T3_BODY(Name="",Value="",Library="") +{ + Blechstaerke = 0.55; + color("DarkSlateGray") + union() + { + translate([0,0,-8.1/2]) + difference() + { + cube([8.1,5,8.1],center=true); + translate([0,0,-3.8]) cube([8.3,4,1],center=true); + } + intersection(Name="",Value="",Library="") {cylinder(2,2.5,2.5,$fn=Detailgrad); cube([5,4.2,4],center = true);} + intersection(Name="",Value="",Library="") {cylinder(6.1,2.3,2.3,$fn=Detailgrad); cube([4.6,3.8,13],center = true);} + cylinder(6.1+3.55,2.5/2,2.5/2,$fn=Detailgrad); + + translate([0,0,6.1+3.55-1.8]) cylinder(4,6.5/2,6.5/2,$fn=Detailgrad); + + } +} + +module APEM_T3L(Name="",Value="",Library="") +{ + translate([-3,0,3.5]) rotate([0,-90,0]) APEM_T3L_BODY(Name="",Value="",Library=""); +} + +module APEM_T3L_BODY(Name="",Value="",Library="") +{ + Blechstaerke = 0.55; + color("DarkSlateGray") + union() + { + translate([0,0,-8.1/2]) + difference() + { + cube([5.5,8.1,8.1],center=true); + translate([0,0,-3.8]) cube([8.3,4,1],center=true); + } + intersection(Name="",Value="",Library="") {cylinder(2,2.5,2.5,$fn=Detailgrad); cube([5,4.2,4],center = true);} + intersection(Name="",Value="",Library="") {cylinder(6.1,2.3,2.3,$fn=Detailgrad); cube([4.6,3.8,13],center = true);} + cylinder(6.1+3.55,2.5/2,2.5/2,$fn=Detailgrad); + + translate([0,0,6.1+3.55-1.8]) cylinder(4,6.5/2,6.5/2,$fn=Detailgrad); + + } +} + +// end SUB-D +//======================================================================================= + +module EPG1B7(Name="",Value="",Library="") //X1 EPG1B7 + { + color("silver") translate([0,6.65,7.5]) rotate([-90,0,0]) cylinder(13.76,5.5,5.5); + color("DarkKhaki") cubepart([12.6,13.3,14]); + // LOETPIN(height = 3.0, dim = 0.6); + // translate([-1.27,-1.27,0]) make_line_of(2.54,2) LOETPIN(height = 3.0, dim = 0.6); + // translate([-1.27,1.27,0]) make_line_of(2.54,2) LOETPIN(height = 3.0, dim = 0.6); + // translate([-3.81,-3.81,0]) make_line_of(2.54,4) LOETPIN(height = 3.0, dim = 0.6); + // translate([-3.81,3.81,0]) make_line_of(7.62,2) LOETPIN(height = 3.0, dim = 0.6); + } + +module 3M_10214_55G3PC(Name="",Value="",Library="") //U2 F14THT +{ + rotate([0,0,90]) translate([-7.813800,-3.5,0]) MINID_H(size = 0); //Board +} + +// USB + +module USB_B() {color("Silver") + { + translate([0,-2,0]) cubepart([12.04,16.5,10.62]); + translate([-12.04/2,0,0]) make_line_of(12.04, 2) LOETPIN(height = 3, dim = 1); + translate([-2.5/2,4.71,0]) make_line_of(2.5, 2) LOETPIN(height = 3,rnd = true); + translate([-2.5/2,2.71,0]) make_line_of(2.5, 2) LOETPIN(height = 3,rnd = true); + } +} +module PN61729(Name="",Value="",Library="SmartPrj") {USB_B();} + +module USB_MINI_B(Name="",Value="",Library="")// MINI USB +{color("silver") translate([-0.48-1.27,0,0]) + difference() + { + cubepart(size = [9.3,7.8,4.1]); + translate([-1,0,0.5])cubepart(size = [8.3,6.8,3.1]); + } + translate([-2,0,1]) color("DarkSlateGray") cubepart(size = [7.3,5.8,2.1]); +} + +module UX60A_MB_5ST(Name="",Value="",Library="") {USB_MINI_B(); } +module USB_MINI_B_2(Name="",Value="",Library="MyCON2") {translate([1.6,2,0]) rotate([0,0,-90])USB_MINI_B(); } + +module _629105136821(Name="",Value="",Library="") //Micro USB + { + color("silver")rotate([0,0,90]) linear_extrude(2.6) translate([-6.821000,-5.100000,0]) square([7.721000,10.200000]); //Board + } + +module ZX62D_B_5PA8(Name="",Value="",Library="") // MICRO USB +{ + translate([5,0,0]) rotate([-90,180,90]) union() + { + color("silver") union() { difference() + { + translate([-3.80,0,0])linear_extrude(5) polygon([[7.6,1.1],[7.6,1.9],[6.9,2.6],[0.7,2.6],[0,1.9],[0,1.1],[1.1,0],[6.5,0]]); + + translate([-3.8+0.3,0.3,1]) linear_extrude(4.5) polygon([[0,0.9],[0,1.5],[0.5,2],[6.5,2],[7,1.5],[7,0.9],[6.1,0],[0.9,0]]); + } + translate([-3,2.3,5]) rotate([-30,0,0]) cube([6,0.3,0.6]); + translate([2.7,0.3,5]) rotate([-30,0,180]) cube([5.4,0.3,0.6]); + translate([-3.8+0.3,1.1,5]) rotate([-30,0,90]) cube([0.8,0.3,0.6]); + translate([+3.8-0.3,1.9,5]) rotate([-30,0,-90]) cube([0.8,0.3,0.6]); + } + color("DarkSlateGray") translate([-1.9,1.3,0.4]) cube([3.8,0.6,3.8]); + } +} + +// Cinch +module TOBU3(Name="",Value="",Library="") //X2 TOBU3 +{ + d = 8.3; + color("silver") union() + { + rotate([0,0,180]) translate([-5.588,-5.5,0]) linear_extrude(12.3) square([11,8.5]); + translate([0,5.5,10.6-(d/2)]) rotate([-90,00,00]) cylinder(8.6,d/2,d/2); + } +} + +// HDMI +module _685119135725(Name="",Value="",Library="USBSteckverbinderWR-COM") +{ translate([-14.5/2,0,0]) + { + HDMI(width=15,length=12.15,height=5.6,pindisplace = 1.95); + translate([14.5/2,0,3]) LOETPIN(height = 5, dim = 1, rnd = false); + translate([-14.5/2,0,3]) LOETPIN(height = 5, dim = 1, rnd = false); + translate([14.5/2,-5.96,3]) LOETPIN(height = 5, dim = 1, rnd = false); + translate([-14.5/2,-5.96,3]) LOETPIN(height = 5, dim = 1, rnd = false); + } +} +//AMP10029449_111RLF(); +module AMP10029449_111RLF(Name="",Value="",Library="con-amphenol-USB-HDMI-DVI") +{ +translate([-14.5/2,0,0]) + { + HDMI(width=15,length=9.5,height=5.6,pindisplace = 1); + translate([14.5/2,0,3]) LOETPIN(height = 5, dim = 1, rnd = false); + translate([-14.5/2,0,3]) LOETPIN(height = 5, dim = 1, rnd = false); + translate([15.7/2,-4.95,3]) LOETPIN(height = 5, dim = 1, rnd = false); + translate([-15.7/2,-4.95,3]) LOETPIN(height = 5, dim = 1, rnd = false); + } +} + + +module HDMI(width=15,length=12.15,height=5.6, pindisplace=1.78) // + { + breite = width; // 11.2 mini + hoehe = height; // 3.2 + wand = 0.6; + tiefe = length; // 7.6 + translate([0,pindisplace,0]) rotate([-90,180,180]) union() + { + color("silver") union() { difference() + { + translate([-breite/2,0,0])linear_extrude(tiefe) polygon([[hoehe*0.44,0],[breite - hoehe*0.44 ,0],[breite,hoehe*0.44],[breite,hoehe],[0,hoehe],[0,hoehe*0.44]]); + + translate([-breite/2+wand/2,wand/2,1]) linear_extrude(tiefe-wand) polygon([[hoehe*0.44,0],[breite - hoehe*0.44-wand ,0],[breite-wand,hoehe*0.44],[breite-wand,hoehe-wand],[0,hoehe-wand],[0,hoehe*0.44]]); + } + } + color("DarkSlateGray") translate([-breite*0.76/2,hoehe*0.45,0.4]) cube([breite*0.76,0.6,6.5]); + } +} + +// DC-Buchse +module SPC4077(Name="",Value="",Library="") //J3 + { + translate([-10.8,0,0]) rotate([0,0,-90]) + color("DarkSlateGray") union() + { + translate([0,3.25,10.8-(8/2)]) rotate([-90,00,00]) cylinder(10.2,8/2,8/2); + translate([-8/2,3.25,0]) cube([8,10.2,10.8-4]); + difference() + { + translate([-8.89/2,0,0]) cube([8.89,3.25,11]); //Dummy Package + translate([0,-1,3.35+6.3/2]) rotate([-90,00,0]) cylinder(10.2,6.3/2,6.3/2); + } + } + } +module DCJACK_2MM_PTH(Name="",Value="",Library="") {translate([10.8,0,0]) SPC4077(Name=Name,Value=Value,Library=Library);} + +module DC_21MM(Name="",Value="",Library="") {translate([0,-4,0]) rotate([0,00,-90]) SPC4077();} + +// CHINCH Buchse +module CHINCH(Name="",Value="",Library="") +{ + color("Yellow") translate([10.2-7,0,0]) cubepart([14,10,13]); + color("Silver") translate([10.2-14,0,13/2]) rotate([0,-90,0]) cylinder(8.5,8.3/2,8.3/2); +} + +module PG203J(Name="",Value="",Library="") +{ + color("DarkSlateGray") cubepart([14.6,11,6]); + color("Silver") translate([-6,0,3]) rotate([0,270,0]) cylinder(5,5/2,5/2); +} +// Pfostensteckverbinder +module FE06(Name="",Value="",Library="con-lsta") {LSTA(n=6);} +module 1X06(Name="",Value="",Library="pinhead") {LSTA(n=6);} +module FE08(Name="",Value="",Library="con-lsta") {LSTA(n=8);} +module 1X08(Name="",Value="",Library="pinhead") {LSTA(n=8);} +module 1X08_CLEANBIG(Name="",Value="",Library="pinhead") {LSTA(n=8);} +module FE12(Name="",Value="",Library="con-lsta") {LSTA(n=12);} +module FE10(Name="",Value="",Library="con-lsta") {LSTA(n=10);} +module FE20_2(Name="",Value="",Library="con-lsta") {LSTA(n=20,m=2);} +module FE05_1(Name="",Value="",Library="con-lsta") {LSTA(n=5,m=1);} +module JP1(Name="",Value="",Library="con-lstb") {LSTB(n=1,m=2);} +module JP2(Name="",Value="",Library="con-lstb") {LSTB(n=3,m=1);} +module JP8Q(Name="",Value="",Library="con-lstb") {LSTB(n=8,m=2);} +module MA13_1W(Name="",Value="",Library="con-lstb") {translate([0,2,0]) rotate([-90,0,0]) LSTB(n=13,m=1);} +module HEAD15_NOSS(Name="",Value="",Library="MyCON2") {translate([7*2.54,0,0]) LSTB(n=15,m=1);} +module HEAD15_NOSS_1(Name="",Value="",Library="MyCON2") {translate([7*2.54,0,0]) LSTB(n=15,m=1);} + +module LSTA06_1_27(Name="",Value="",Library="") {translate([+1.27/2,0,0]) LSTA05(n=6);} +module RSM_106_02_L_S(Name="",Value="",Library="") {RSM_1(n=6);}//, m=1);} + + +module MA04_1(Name="",Value="",Library="con-lstb") {LSTB(n=4);} +module MA08_1(Name="",Value="",Library="con-lstb") {LSTB(n=8);} +module MA05_1(Name="",Value="",Library="con-lstb") {LSTB(n=5);} +module MA02_1WI(Name="",Value="",Library="con-lstb") {LSTBW(n=2);} +module MA03_1WI(Name="",Value="",Library="con-lstb") {LSTBW(n=3);} +module MA03_1(Name="",Value="",Library="con-lstb") {LSTB(n=3);} +module MA03_2(Name="",Value="",Library="con-lstb") {LSTB(n=3, m=2);} +module 2X03(Name="",Value="",Library="pinhead") {MA03_2();} +module LSP10(Name="",Value="",Library="solpad") {LSTB(n=1);} +module MA20_2(Name="",Value="",Library="con-lstb") {LSTB(n=20,m=2);} + +module SV_3_81_12(Name="",Value="",Library="") {translate([0,0,0]) SV_3_81(n=12);} +module SV_3_5_8(Name="",Value="",Library="") {translate([0,0,0]) SV_3_5(n=8);BL350(n = 8);} +module SL_3_5_2(Name="",Value="",Library="") {translate([-3.5,0,0]) SL_3_5(n=2);} +module SL_3_5_3(Name="",Value="",Library="") {translate([0,0,0]) SL_3_5(n=3);} +module SL_3_5_4(Name="",Value="",Library="") {translate([0,0,0]) SL_3_5(n=4);} +module SL_3_5_1(Name="",Value="",Library="") {translate([3.5*3,0,0]) SL_3_5(n=10);} +//module SL_3_5_6(Name="",Value="",Library="") {translate([7,0,0]) SL_3_5(n=6);} + +module EDG_03(Name="",Value="",Library="") {EDG_SWITCH(3);} + + +module EDG_SWITCH(n = 3) +{ + pitch = 2.54; + color("Red") + difference() + { + cubepart([(4.2)+(n-1)*pitch,10,5.7]); + for (a = [0 : n-1]) translate([-(pitch/2)*(n-1)+pitch*a,0,2]) cubepart([1.27,3,4]); + } + color("White") for (a = [0 : n-1]) translate([-(pitch/2)*(n-1)+pitch*a,0,2]) cubepart([1.27,3,3]); + color("White") for (a = [0 : n-1]) translate([-(pitch/2)*(n-1)+pitch*a,0.75,2])cubepart([1.27,1.5,5]); +} + +// Battery +module CR2032H_SMD(Name="",Value="",Library="battery") + { + translate([-14.100,-8.000,0]) linear_extrude(10) square([28.300,16.000]); //Dummy Package + + } + + + module BTSW_SMD(Name="",Value="",Library="DIY-Parts") + { + + translate([-13.100,-4.000,0]) linear_extrude(10) square([26.200,8.000]); //Dummy Package + } + +module MINIFIB4(Name="",Value="",Library="") //X1 +{ + rotate([0,0,180]) + { + difference() + { + color("white") translate([-4.8,0.95,0]) cube([9.6,12.95,10]); //Board + if (Detailgrad > 8) + { + color("white") translate([-4.8+0.75,2,1.1+3.8+0.5]) cube([3.8,12.95,3.8]); + color("white") translate([-4.8+0.75,2,1.1]) cube([3.8,12.95,3.8]); + color("white") translate([-4.8+0.75+3.8+0.5,2,1.1+3.8+0.5]) cube([3.8,12.95,3.8]); + color("white") translate([-4.8+0.75+3.8+0.5,2,1.1]) cube([3.8,12.95,3.8]); + } + } + if (Detailgrad > 9) + { + translate([2.1,0,0]) rotate([0,0,-90]) BendedPIN(1.5, l=3.5, l2=3); + translate([-2.1,0,0]) rotate([0,0,-90]) BendedPIN(1.5, l=3.5, l2=3); + translate([2.1,-5.5,4.2]) rotate([0,0,-90]) BendedPIN(1.5, l=3.5+4.2, l2=3); + translate([-2.1,-5.5,4.2]) rotate([0,0,-90]) BendedPIN(1.5,l=3.5+4.2, l2=3); + } + } +} + +module MICROFIT6(Name="",Value="",Library="") //X6 +{ + +rotate([0,0,180]) color("DarkSlateGray") translate([-6.325000,-1.0,0]) cube([12.65,9.92,7.3]); //Board +} + + +module MOLEX_MICROFIT90(Name="",Value="",Library="") +{ + color("DarkSlateGray") translate([0,2,4.8]) rotate([90,00,00]) MINIFIS4(Name="",Value="",Library="") ; +} + +module MINIFIS6(Name="",Value="",Library="") +{ + // 22-0308 mini und Microfit verwechselt + MICROFITS6(Name="",Value="",Library="") ; +} + +module MINIFIS4(Name="",Value="",Library="") +{ + color("white") cubepart(size = [9.6,9.6,12.8]); + color("white") translate([-0,5.5,12.8-3.1]) cubepart(size = [3.4,1.4,3.1]); + color("FloralWhite") difference() + { + translate([0,0,12.8]) cubepart(size = [10,10,13.5]); + translate([-2.1,2.75,12.8]) make_line_of(4.2, 2) cubepart(size = [3.5,3.5,14]); + translate([-2.1,-2.75,12.8]) make_line_of(4.2, 2)cubepart(size = [3.5,3.5,14]); + } + color("FloralWhite") translate([-0,6.5,12.8]) cubepart(size = [3.4,3.4,13.5]); + translate([-2.1,2.75,0]) make_line_of(4.2, 2) LOETPIN(height = 3.5, dim = 0.9); + translate([-2.1,-2.75,0]) make_line_of(4.2, 2) LOETPIN(height = 3.5, dim = 0.9); +// + +} + +module MICROFITS6(Name="",Value="",Library="") //X6 +{ + color("DarkSlateGray") translate([0,0.285,0]) cubepart(size = [12.65+0.5,7.37,9.91]); + color("DarkSlateGray") translate([-0,4.65,9.91-3.1]) cubepart(size = [3.4,1.4,3.1]); + color("DarkSlateGray") difference() + { + translate([0,0.285,9.91]) cubepart(size = [10.5,7.37,9.5]); + translate([-3,1.5,9.91]) make_line_of(3, 3) cubepart(size = [2.5,2.5,10]); + translate([-3,-1.5,9.91]) make_line_of(3, 3)cubepart(size = [2.5,2.5,10]); + } + color("DarkSlateGray") translate([-0,5.65,9.91]) cubepart(size = [3.4,3.4,9.5]); + translate([-3,1.5,0]) make_line_of(3, 3) LOETPIN(height = 3.18); + translate([-3,-1.5,0]) make_line_of(3, 3) LOETPIN(height = 3.18); +} + + + +module ML6(Name="",Value="",Library="") { IDC_CON_180(6);} +module ML6L(Name="",Value="",Library="") { IDC_CON_90(6);} +module ML16(Name="",Value="",Library="") { IDC_CON_180(16);} + + + +module IDC_CON_180(n = 10) +{ + difference() + { + translate([-(7.58 + n * 1.27)/2,-9.2/2,0]) color("gray") cube([7.58 + n * 1.27,9.2,9.2]); + translate([-4/2,-9.3/2,1.2]) cube([4,2,9.2]); + } + translate([-(n-2)/4 *2.54-1,-9.2/2,8]) rotate([90,0,0]) linear_extrude(0.2) polygon([[-1,0],[1,0],[0,-1.5]]); // PFEIL + translate([-(4.6 + n * 1.27)/2,-6/2,1.2]) color("silver") cube([(4.6 + n * 1.27),6,13]); + + color("Silver") translate([-(n-2)/4 *2.54,1.27,0]) make_line_of(2.54, n/2) cube([0.5,0.5,8.4], center = true); + color("Silver") translate([-(n-2)/4 *2.54,-1.27,0]) make_line_of(2.54, n/2) cube([0.5,0.5,8.4], center = true); +} + +module IDC_CON_90(n = 10) +{ + translate([0,2.35,4.6]) rotate([-90,0,0]) + { + difference() + { + translate([-(7.58 + n * 1.27)/2,-9.2/2,0]) color("gray") cube([7.58 + n * 1.27,9.2,9.2]); + translate([-4/2,-9.3/2,1.2]) cube([4,2,9.2]); + } + translate([-floor(n/4) *2.54-1,-9.2/2,8]) rotate([90,0,0]) linear_extrude(0.2) polygon([[-1,0],[1,0],[0,-1.5]]); // PFEIL + translate([-(4.5 + n * 1.27)/2,-6/2,1.2]) color("silver") cube([(4.5 + n * 1.27),6,13]); + } + color("Silver") translate([-floor(n/4) *2.54,1.27,0]) make_line_of(2.54, n/2) cube([0.5,0.5,8.4], center = true); + color("Silver") translate([-floor(n/4)*2.54,-1.27,0]) + make_line_of(2.54, n/2) cube([0.5,0.5,8.4], center = true); +} + + +module ML10(Name="",Value="",Library="") +{ + difference() + { + translate([-20.3/2,-9.2/2,0]) color("blue") cube([20.3,9.2,9.2]); + translate([-4/2,-9.3/2,1.2]) cube([4,2,9.2]); + } + arrow_polygon = [[-1,0],[1,0],[0,-2.5]]; + translate([-5.08,-9.2/2,8]) rotate([90,0,0]) linear_extrude(0.2) polygon(points = arrow_polygon); // PFEIL + + translate([-17.3/2,-6/2,1.2]) color("silver") cube([17.3,6,13]); + + color("Silver") translate([-2*2.54,1.27,0]) make_line_of(2.54, 5) cube([0.5,0.5,8.4], center = true); + color("Silver") translate([-2*2.54,-1.27,0]) + make_line_of(2.54, 5) cube([0.5,0.5,8.4], center = true); +} + + +module ML10L(Name="",Value="",Library="") +{ + translate([0,2.35,4.6]) rotate([-90,0,0]) + { + difference() + { + translate([-20.3/2,-9.2/2,0]) color("blue") cube([20.3,9.2,9.2]); + translate([-4/2,-9.3/2,1.2]) cube([4,2,9.2]); + } + translate([-2*2.54,-9.2/2,8]) rotate([90,0,0]) linear_extrude(0.2) polygon([[-1,0],[1,0],[0,-1.5]]); // PFEIL + translate([-17.3/2,-6/2,1.2]) color("silver") cube([17.3,6,13]); + } + color("Silver") translate([-2*2.54,1.27,0]) make_line_of(2.54, 5) cube([0.5,0.5,8.4], center = true); + color("Silver") translate([-2*2.54,-1.27,0]) + make_line_of(2.54, 5) cube([0.5,0.5,8.4], center = true); +} + + +module MJ_RJ45S(Name="",Value="",Library="") //X8 WE-RJ45-ST +{ + size = [15.9,16.65,17]; + translate([0,size[1]/2-3.45,0]) difference() + { + color("silver") union() + { + cubepart(size); + } + color("DarkSlateGray") translate([0,-1,3.1]) cubepart(size = [12.0,8.3,14]); + color("DarkSlateGray") translate([0,-3,3.1]) cubepart(size = [6.0,8.3,14]); + } + translate([-5*1.27/2,8.89+3.05,1.5]) make_line_of(2.54, 4) LOETPIN(dim = 0.4); + translate([-7*1.27/2,8.89+3.05-2.54,1.5]) make_line_of(2.54, 4) LOETPIN(dim = 0.4); + +} + +module MJ_RJ45O(Name="",Value="",Library="") +{ + // RS: 735-0298 + translate([0,2.415,0]) difference() + { + union() + { + color("silver") cubepart(size = [15.75,16.5,13.25]); + translate([-5.5,-7.5,11]) color("Yellow") cubepart(size = [3,2,1.6]); + translate([5.5,-7.5,11]) color("Green") cubepart(size = [3,2,1.6]); + } + color("DarkSlateGray") translate([0,-4,2]) cubepart(size = [12.0,14,8.3]); + color("DarkSlateGray") translate([0,-4,4]) cubepart(size = [6.0,14,8.3]); + } + translate([-5*1.02/2,2.54,1.5]) make_line_of(2.04, 4) LOETPIN(dim = 0.4); + translate([-7*1.02/2,4.32,1.5]) make_line_of(2.04, 4) LOETPIN(dim = 0.4); + translate([-16.3/2,3.43,1.0]) make_line_of(16.3, 2) LOETPIN(dim = 0.8); + translate([-12.7/2,0,-2.5]) color("DarkSlateGray") make_line_of(12.7, 2) cylinder(4,1.5,1.5); +} +module RJ45_PLUG(Name="",Value="",Library="") +{ + translate([-12.700/2,-7.400/2,0]) color("DarkSlateGray") linear_extrude(10) polygon([[2.857,7.400],[2.857,8.670],[9.525,8.670],[9.525,7.400],[12.700,7.400],[12.700,0.000],[10.605,0.000],[10.605,0.600],[10.105,0.600],[10.105,0.000],[9.805,0.000],[9.805,0.600],[9.305,0.600],[9.305,0.000],[9.005,0.000],[9.005,0.600],[8.505,0.600],[8.505,0.000],[8.205,0.000],[8.205,0.600],[7.705,0.600],[7.705,0.000],[7.405,0.000],[7.405,0.600],[6.905,0.600],[6.905,0.000],[6.605,0.000],[6.605,0.600],[6.105,0.600],[6.105,0.000],[5.805,0.000],[5.805,0.600],[5.305,0.600],[5.305,0.000],[5.005,0.000],[5.005,0.600],[4.505,0.600],[4.505,0.000],[4.205,0.000],[4.205,0.600],[3.705,0.600],[3.705,0.000],[3.405,0.000],[3.405,0.600],[2.905,0.600],[2.905,0.000],[2.605,0.000],[2.605,0.600],[2.105,0.600],[2.105,0.000],[0.000,0.000],[0.000,7.400]]); + + +} + +// TRIAD +module TRIAD_S3(Name="",Value="",Library="") {TRIAD_S(Pincount = 3);} +module TRIAD_S5(Name="",Value="",Library="") {translate([-7,0,0]) TRIAD_S(Pincount = 5);} + +module TRIAD_H5(Name="",Value="",Library="") {translate([0,0, 5.5]) TRIAD_H(5);} +module TRIAD_H3(Name="",Value="",Library="") {translate([0,0, 5.5]) TRIAD_H(3);} +module TRIAD_H4(Name="",Value="",Library="") {translate([0,0, 5.5]) TRIAD_H(4);} + + +module TRIAD_H(Pincount = 5) +{ + TRIAD_SOCKET_HOUSE(Pincount); +} + +module TRIAD_S(Pincount = 3) +{ + translate([0,0,8]) rotate([90,00,270]) TRIAD_SOCKET_HOUSE(Pincount); + color("RoyalBlue") translate([3.5,-6,0]) cube([8,1,11]); + color("RoyalBlue") translate([3.5,5,0]) cube([8,1,11]); +} + +module TRIAD_SOCKET_HOUSE(Pincount = 5) +{ + color("RoyalBlue") translate([0,0,2-5.5]) cylinderpart(size = [14.5,2.5]); + color("RoyalBlue") translate([0,0,3-5.5]) difference() + { + cylinderpart(size = [6,9.5]); + if (Pincount == 3) + { + rotate([0,0,270]) make_ring_of(radius = 1.556, count=3, pie = 270) cylinderpart(size = [1.1,13]); + } + if (Pincount == 4) + { + rotate([0,0,45]) make_ring_of(radius = 3.1/2, count=4) cylinderpart(size = [1.1,13]); + } + if (Pincount == 5) + { + make_ring_of(radius = 3.2/2, count=5) cylinderpart(size = [1.1,13]); + } + } + color("silver") translate([0,0,3-5.5]) difference() + { + union() + { + cylinderpart(size = [12,10]); + translate([0,0,1]) cylinderpart(size = [15,1.5]); + } + cylinderpart(size = [8,10.1]); + translate([0,6,2.5])cylinderpart(size = [3,10.1]); + } +} + +//BTH_060_01_F_D_A(Name="",Value="",Library=""); +// SAMTEC +module SIMPLE_BTH_060_01_F_D_A(Name="",Value="",Library="") // BTH-060-01-F-D-A +{ + color("gray") cubepart(size = [36.27,7.24,5]); // Aussenmasse vom BSH + color("gray") translate([-16.7411,2.032]) cylinder(5.76,0.89/2,0.89/2); // Nöppelchen vom BSH + color("gray") translate([16.7411,2.032]) cylinder(5.76,0.89/2,0.89/2); // Nöppelchen vom BSH +} + +module BSH_060_01_F_D_A(Name="",Value="",Library="") // BTH-060-01-F-D-A +{ + color("gray") cubepart(size = [36.27,7.24,5]); +} + +module QTE_020_01_XXX_D_A(Name="",Value="",Library="") //J1 QTE-020-05-XXX-D-A +{ + color("gray") cubepart(size = [21,8.128,18.3]); +} + +module QSE_020_01_XXX_D_A(Name="",Value="",Library="") //J1 QTE-020-05-XXX-D-A +{ + w = 0.6; + size = [21.27,7.24,3.05]; + color("DarkSlateGray") + { + linear_extrude(size[2]) difference() + { + polygon([[-size[0]/2,-size[1]/2],[-size[0]/2,size[1]/2], [size[0]/2,size[1]/2], [size[0]/2,-size[1]/2]]); + polygon([[w-size[0]/2,w-size[1]/2],[w-size[0]/2,-w+size[1]/2-1] ,[w-size[0]/2+1,-w+size[1]/2], [-w+size[0]/2-1,-w+size[1]/2], [-w+size[0]/2,-w+size[1]/2-1], [-w+size[0]/2,w-size[1]/2]]); + //translate([0,0,w]) cubepart(size = [21.27-2*w,7.24-2*w,3.05]); + } + cubepart(size = [size[0],size[1],0.6]); + cubepart(size = [size[0]-5,size[1]-3.5,size[2]]); + } +} + +module ESQT_105_03_F_S_408(Name="",Value="",Library="SAMTEC-ESQT") +{ + ESQT_10x_0x_F_x(n = 5, m=1, A=11.63, h=0.408*25.4); +} + + +module ESQT_10x_0x_F_x(n = 5, m=1, A=11.63, h=0.408*25.4) +{ + offs = 0.4; + height = 6.35; + pitch = 2; + pin = 0.5; + translate([-(pitch/2)*n+offs,-(pitch/2)*m+offs,h-0.38]) cube(0.4); + difference() + { + union() + { + translate([-(pitch/2)*n,-(pitch/2)*m,h-height]) make_line_of(pitch, n) color("DarkSlateGray") linear_extrude(height) + square(size=[pitch,pitch]); + translate([-(pitch/2)*n,-(pitch/2)*m,0]) make_line_of(pitch, n) color("DarkSlateGray") linear_extrude(1.7) + square(size=[pitch,pitch]); + + } + translate([-(pitch/2)*(n-1),-(pitch/2)*(m-1),h-2]) make_line_of(pitch, n) color("DarkSlateGray") cubepart([pin+0.2,pin+0.2,3]); + + if (m>1) translate([-(pitch/2)*(n-1),+(pitch/2)*(m-1),h-2]) make_line_of(pitch, n) color("DarkSlateGray") cubepart([pin+0.2,pin+0.2,3]); + + if (m>2) translate([-(pitch/2)*(n-1),0,h-2]) make_line_of(pitch, n) color("DarkSlateGray") cubepart([pin+0.2,pin+0.2,3]); + } + translate([-(pitch/2)*(n-1),-(pitch/2)*(m-1),0]) make_line_of(pitch, n) color("Silver") translate([0,0,(h-A)+(A-height)/2]) cube([pin,pin,A-height], center = true); + + if (m>1) translate([-(pitch/2)*(n-1),+(pitch/2)*(m-1),0]) make_line_of(pitch, n) color("Silver") translate([0,0,(h-A)+(A-height)/2]) cube([pin,pin,A-height], center = true); + + if (m>2) translate([-(pitch/2)*(n-1),0,0]) make_line_of(pitch, n) color("Silver") translate([0,0,(h-A)+(A-height)/2]) cube([pin,pin,A-height], center = true); +} + + + +module MC_5V_38(Name="",Value="",Library="") +{ + +color("lightgreen") translate([-10.22,-1.2,0]) cube([20.44,18.1,10]); //Board +} + + +module MKS8(Name="",Value="",Library="") +{ + translate([0,0,0.1]) difference() + { + color("Silver")cubepart(size = [24.7,7.5,14]); + + translate([0,-3,-0.05]) cubepart(size = [20,2,15]); + } + color("Gray") translate([0,0,1]) cubepart(size = [22.4,6,14]); + + color("Silver") translate([-7*2.5/2,0,0]) make_line_of(2.5, 8) cube([0.6,0.6,8.4], center = true); + if (Detailgrad > 20) + { + translate([-7*2.5/2,0,12]) color("Gray") make_line_of(2.5, 8) rotate([90,0,0]) cylinder(6,0.8,0.8); + } + +} + +module MKSW8(Name="",Value="",Library="") +{ + translate([0,-0.5,7.5/2]) rotate([-90,0,0]) + { + difference() + { + color("Silver") cubepart(size = [24.7,7.5,14.2]); + translate([0,-3,0]) cubepart(size = [20,2,15]); + } + color("Gray") translate([0,0,2.7]) cubepart(size = [22.4,6,12]); + } + color("Silver") translate([-7*2.5/2,0,0]) make_line_of(2.5, 8) cube([0.6,0.6,8.4], center = true); + +} +// Mechanik + + +module PEPAD_M3(Name="",Value="",Library="") {DISTANZBOLZEN(dia = 5.1, h = StrToMMdef(Value,5), drill = 3.5, hole = 2.6); } +module PEPAD_M2X5(Name="",Value="",Library="") {DISTANZBOLZEN(dia = 4.35, h = StrToMMdef(Value,5), drill = 2.8, hole = 2.25); } + +module PEPAD_POD_33X9(Name="",Value="",Library="") {DISTANZBOLZEN(dia = 6, h = StrToMMdef(Value,9), drill = 4.2, hole = 3.3); } +module PEPAD_POD_33X5(Name="",Value="",Library="") {DISTANZBOLZEN(dia = 6, h = StrToMMdef(Value,5), drill = 4.2, hole = 3.3);} +module PEPAD_POD_33X3(Name="",Value="",Library="") {DISTANZBOLZEN(dia = 6, h = StrToMMdef(Value,3), drill = 4.2, hole = 3.3); } +module PEPAD_POD_27X5(Name="",Value="",Library="") {DISTANZBOLZEN(dia = 5.1, h = StrToMMdef(Value,5), drill = 3.5, hole = 2.7); } +module PEPAD_POD_22X5(Name="",Value="",Library="") {DISTANZBOLZEN(dia = 4.35, h = StrToMMdef(Value,5), drill = 2.8, hole = 2.25); } + + +module DISTANZBOLZEN(dia = 5.1, h = 5, drill = 3.5, hole = 2.6) +{ + difference() + { + color("silver") union() + { + cylinder(h,dia/2,dia/2, $fn=Detailgrad); + translate([0,0,-1.5]) cylinder(1.5,drill/2,drill/2, $fn=Detailgrad); + } + translate([0,0,-1.75]) cylinder(h+2,hole/2,hole/2, $fn=Detailgrad); + } +} +// Kühlkörper + +module D03S(Name="",Value="",Library="") +{ offs = 0.8; + steg = 2; + translate([0,0,0.7]) color("DarkSlateGray") + union() + { + cubepart(size = [14,14,2]); make_line_of(4, 4) translate([-14/2+offs,14/2,offs]) rotate([90,0,0]) linear_extrude(14){offset_square(size = [steg-(2*offs),10-(2*offs)], r = offs, $fn = Detailgrad);} + } +} + +module KK_172211(Name="",Value="",Library="OEM-Switch"){color("silver") cubepart([22,17,11]);} + + +module _693071010811(Name="",Value="",Library="") //SD Kartenhalter +{ +rotate([0,0,270]) color("silver") translate([-4.5,-5.06,0]) cube([15.2,14,1.83]); //Board +} + +// Spannungregler +module ICF1200XA007V(Name="",Value="",Library="") //IC2 iCF12003A007V-003R +{ + rotate([0,0,90]) + union() + { + color("SeaGreen") cubepart(size = [12.2,12.2,1.6]); + translate([2.5,-0.8,1.6]) rotate([0,0,90]) DROSSEL(size = [5.2,5.2,2.8]); + } +} + +module ULE(Name="",Value="",Library="murata") //IC3 ULE48-1.25 +{ + rotate([0,0,90]) + { + translate([0,0,3.81]) color ("SeaGreen") cubepart([22.6,56.4,1.6]); //Board + translate([0,0,3.81+1.6]) color ("Khaki") cubepart([21.6,55.4,2.4]); + translate([-0.5,-4.3,0]) color ("DarkSlateGray") cubepart([21,14,11]); + translate([-0.5,-20.25,3.81+1.6]) color ("DarkSlateGray") cubepart([10,10,5]); + translate([0,0,3.81-2.4]) color ("Khaki") cubepart([21.6,55.4,2.4]); + + translate([7.62,25.4,5.81]) LOETPIN(height = 11, dim = 1.02); + translate([-7.62,25.4,5.81]) LOETPIN(height = 11, dim = 1.02); + translate([-7.62,-25.4,5.81]) LOETPIN(height = 11, dim = 1.02); + translate([7.62,-25.4,5.81]) LOETPIN(height = 11, dim = 1.02); + translate([0,25.4,5.81]) LOETPIN(height = 11, dim = 1.02); + } +} +module UWS(Name="",Value="",Library="murata") +{ + translate([0,0,3.2]) color ("SeaGreen") cubepart([33.5,23.4,2.95]); //Board + + translate([-14,7.62,3]) LOETPIN(height = 3+4.6, dim = 1.02, rnd = true); + translate([-14,0,3]) LOETPIN(height = 3+4.6, dim = 1.02, rnd = true); + translate([-14,-7.62,3]) LOETPIN(height = 3+4.6, dim = 1.02, rnd = true); + translate([2,-2.25,1]) color ("DarkSlateGray") cubepart([10,18,8.14]); + translate([-10,0.25,0.2]) color ("Khaki") cubepart([10,20,9]); + translate([12,0.25,0.2]) color ("Khaki") cubepart([8,20,9]); + translate([13.94,7.62,3]) LOETPIN(height = 3+4.6, dim = 1.5, rnd = true); + translate([13.94,3.82,3]) LOETPIN(height = 3+4.6, dim = 1.02, rnd = true); + translate([13.94,0,3]) LOETPIN(height = 3+4.6, dim = 1.02, rnd = true); + translate([13.94,-3.82,3]) LOETPIN(height = 3+4.6, dim = 1.02, rnd = true); + translate([13.94,-7.62,3]) LOETPIN(height = 3+4.6, dim = 1.5, rnd = true); +} + + + +module MYBSS054R6EBF(Name="",Value="",Library="") +{ + boardsize = [22.4,35.5,1.6]; + h = 4.85; + //translate([-10,-18.8,h]) // Pickup Area + translate([0.25,0.25,h]) + { + color ("SeaGreen") cube([22.4,35.5,1.6]); //Board + translate([0,0,1.6]) color ("Khaki") cube([22.4,35.5,2.3]); + translate([18,8,-4.7]) color ("DarkSlateGray") cylinder(4.7,8/2,8/2); + translate([0.2,13.8,-4]) color ("DarkSlateGray") cube([20,10,8]); + translate([3.58,boardsize[1]-2.53,-h]) cylinder(h,1.57/2,1.57/2); + translate([3.58,boardsize[1]-2.53-30.44,-h]) cylinder(h,1.57/2,1.57/2); + translate([3.58+11.43,boardsize[1]-2.53,-h]) cylinder(h,1.57/2,1.57/2); + translate([3.58+15.24,boardsize[1]-2.53-30.44,-h]) cylinder(h,1.57/2,1.57/2); + } +} + +module LMZM23601V5SILR(Name="",Value="",Library="") +{ + size = [3.1,3.9,0.3]; + union() + translate([0.45,0,0]) rotate([0,0,270]){ + translate([0,0,0]) color ("SeaGreen") cubepart(size); //Board + translate([-size[0]/2.5,-size[1]/2.5,0]) color("white") cylinder(size[2]*1.1, size[1]*0.05, size[1]*0.05, $fn=Detailgrad); + translate([-0.8,1.4,0.3])C_SMD([1.0,0.5,0.6]); + translate([0.8,1.4,0.3])C_SMD([1.0,0.5,0.6]); + translate([0,-0.3,0.3]) R_SMD([2.4,1.9,1.25]); + } +} + + + + +module STM32MP15X(Name="",Value="",Library="") +{ + if (Detailgrad > 40) + { + versatzy = 0.18; + versatzx = 0.04; + translate([0,0,5]) rotate([0,0,180]) + { + color ("SeaGreen") rotate([00,0,0]) translate([-40/2,-44/2,0]) import(str(Package_path,"/PHYTEC_PCM_068_PL1534.stl")); + translate([-15.168+versatzy,-2.54+versatzx]) rotate([180,0,-90]) BSH_060_01_F_D_A(Name="",Value="",Library=""); + translate([14.832+versatzy,2.54+versatzx-0.08]) rotate([180,0,-90]) BSH_060_01_F_D_A(Name="",Value="",Library=""); + + translate([-15.168+versatzy,-2.54+versatzx,-5]) rotate([0,0,-90]) BTH_060_01_F_D_A(Name="",Value="",Library=""); + translate([14.832+versatzy,2.54+versatzx-0.08,-5]) rotate([0,0,-90]) BTH_060_01_F_D_A(Name="",Value="",Library=""); + } + } + else + { + translate([0,0,5]) + { + color ("SeaGreen") + linear_extrude(1.65) difference() + { + translate([-40/2,-44/2]) square([40,44]); + translate([-34/2,38/2]) circle(r=1.850,$fn=$fn); //STM32MP15X P$1 + translate([34/2,-38/2])circle(r=1.850,$fn=$fn); //STM32MP15X P$2 + + } + translate([-15.168,-2.54]) rotate([180,0,-90]) SIMPLE_BTH_060_01_F_D_A(Name="",Value="",Library=""); + translate([14.832,2.54-0.08]) rotate([180,0,-90]) SIMPLE_BTH_060_01_F_D_A(Name="",Value="",Library=""); + } + } + translate([-34/2,38/2]) DISTANZBOLZEN(dia = 4.35, h = 5, drill = 2.8, hole = 2.25); + translate([34/2,-38/2]) DISTANZBOLZEN(dia = 4.35, h = 5, drill = 2.8, hole = 2.25); + + + //34/2-4.2+2.032 + //34/2+0.2-2.032 + //38/2-4.8-16.7411 +} + +module CHINCH_V(Name="",Value="",Library="") //X3 CHINCH-V +{ + difference() + { + union() + { + color("silver") + { + linear_extrude(8.5) circle(5,$fn = Detailgrad); + linear_extrude(17.5) circle(4.15,$fn = Detailgrad); + } + color("Yellow") + linear_extrude(17.6) circle(3.8,$fn = Detailgrad); + } + linear_extrude(17.7) circle(2,$fn = Detailgrad); + } +} + + +module MICROSD(Name="",Value="",Library="") {color("pink") translate([0,-5.50,0.5]) cube([15,11,1]);} + +// RELAYS + +module RELAIS(Name="",Value="",Library="") // Halbleiterrelays Crydom +{ + rotate([0,0,90]) color ("DarkSlateGray") translate([-4.100,-7.500,0]) linear_extrude(20) square([10.500,43.000]); //Dummy Package +} + + +module REL_G2RL(Name="",Value="",Library="") +{ + color ("DarkSlateGray") translate([-2.300,-2.600,0]) cube([29.000,12.700,15.7]); +} + + +module OA5642(Name="",Value="",Library="") +{ + rotate([0,0,180]) color("Cornsilk") + { + translate([0,0,0.5]) cubepart(size = [26.6,25,9.8], phase = 1); + translate([8.4,8,0.0]) cylinder(0.45,0.45,0.5); + translate([-8.4,8,0.0]) cylinder(0.45,0.45,0.5); + translate([8.4,-8,0.0]) cylinder(0.45,0.45,0.5); + translate([-8.4,-8,0.0]) cylinder(0.45,0.45,0.5); + translate([-26.6/2,-25/2,0.0]) + { + translate([1.25,3.1,0.5]) LOETPIN(5.2,0.8); + translate([1.25+15.4,3.1,0.5]) LOETPIN(5.2,0.8); + translate([1.25+15.4+7.5,3.1,0.5]) LOETPIN(5.2,0.8); + translate([1.25,3.1+17.5,0.5]) LOETPIN(5.2,0.8); + translate([1.25+15.4,3.1+15.8,0.5]) LOETPIN(5.2,0.8); + translate([1.25+15.4+7.5,3.1+15.8,0.5]) LOETPIN(5.2,0.8); + } + } +} + +module SRD_05VDC_SL_C(Name="",Value="",Library="") +{ + color ("blue") linear_extrude(15.3) translate([-8.89,-7.62,0]) square([18.5,15.0]); //Board +} + + +// POTI +module 3386P(Name="",Value="",Library="") +{ + color ("blue") cubepart(size = [9.6,9.6,4.38]); + color("Linen") cylinder(7.87,3.56/2,3.56/2, $fn=Detailgrad); +} + +module RJ9W(Name="",Value="",Library="") +{ + color ("blue") cubepart(size = [9.1,4.7,9.1]); +} + +module S64W(Name="",Value="",Library="") +{ + translate([0,1.27,0]) color ("blue") cubepart(size = [9.652,5.08,9.652]); +} + +module CT6(Name="",Value="",Library="") +{ + color ("Linen") cubepart(size = [7.112,7.112,4.38]); +} + +module TRIMPOT_BOURNS_TC33X_2(Name="",Value="",Library="") { + color("silver") + { + translate([-1.5,-2,0]) cube([3,3.75,0.5]); + translate([0,0,0.5]) cylinder(0.7, 1.8,1.8); + } + } + +module RTRIM3202(Name="",Value="",Library="") { + color("silver") + { + translate([-1.5,-2,0]) cube([3,3.75,0.5]); + translate([0,0,0.5]) cylinder(0.7, 1.8,1.8); + } + } + + +// SMD + +module _0306(Name="",Value="",Library="") {if (Name[0] == "C") C_SMD([0.8,1.6,0.6]); else R_SMD([0.8,1.6,0.6]);} +module _0402(Name="",Value="",Library="") {if (Name[0] == "C") C_SMD([1.0,0.5,0.4]); else R_SMD([1.0,0.5,0.3]);} +module R0402(Name="",Value="",Library="") {R_SMD([1.0,0.5,0.3]);} +module C0402(Name="",Value="",Library="") {C_SMD([1.0,0.5,0.3]);} +module _0603(Name="",Value="",Library="") {if (Name[0] == "C") C_SMD([1.6,0.8,0.5]); else if (Name[0] == "D") LED_0603(Name=Name,Value=Value,Library=Library); else R_SMD([1.6,0.8,0.5]);} +module R0603(Name="",Value="",Library="") {R_SMD([1.6,0.8,0.5]);} +module R0603_ROUND(Name="",Value="",Library="") {R_SMD([1.6,0.8,0.5]);} +module C0603(Name="",Value="",Library="") {C_SMD([1.6,0.8,0.5]);} +module C0603_ROUND(Name="",Value="",Library="") {C_SMD([1.6,0.8,0.5]);} +module _0805(Name="",Value="",Library="") {if (Name[0] == "C") C_SMD([2.0,1.2,0.6]); else if (Name[0] == "D") LED_0805(Name=Name,Value=Value,Library=Library); else R_SMD([2.0,1.2,0.6]);} +module C0805(Name="",Value="",Library="") {C_SMD([2.0,1.2,0.6]);} +module R0805(Name="",Value="",Library="") {R_SMD([2.0,1.2,0.6]);} +module _1206(Name="",Value="",Library="") {if (Name[0] == "C") C_SMD([3.2,1.6,0.8]); else R_SMD([3.2,1.6,0.8]);} +module C1206(Name="",Value="",Library="") {C_SMD([3.2,1.6,0.8]);} +module R1206(Name="",Value="",Library="") {R_SMD([3.2,1.6,0.8]);} +module M1206(Name="",Value="",Library="") {R_SMD([3.2,1.6,0.8]);} +module _1210(Name="",Value="",Library="") {if (Name[0] == "C") C_SMD([3.2,2.5,1.5]); else R_SMD([3.2,2.5,1.5]);} +module C1210(Name="",Value="",Library="") {C_SMD([3.2,2.5,1.5]);} +module _1812(Name="",Value="",Library="") {if (Name[0] == "C") C_SMD([4.5,3.2,3.2]); else R_SMD([4.5,3.2,3.2]);} +module _2220(Name="",Value="",Library="") {if (Name[0] == "C") C_SMD([5.7,5.0,4.2]); else R_SMD([5.7,5.0,4.2]);} +module _1020(Name="",Value="",Library="") {rotate([0,0,90]) R_SMD([2.5,5,0.55]);} +module R2010(Name="",Value="",Library="") {R_SMD([5,2.5,0.55]);} +module _2512(Name="",Value="",Library="") {if (Name[0] == "C") C_SMD([6.45,3.35,0.7]); else R_SMD([6.45,3.35,0.7]);} +module R2512(Name="",Value="",Library="") {R_SMD([6.45,3.35,0.7]);} + +module _3216(Name="",Value="",Library="") {TANTAL([3.2,1.6,1.6]);} +module _3528(Name="",Value="",Library="") {TANTAL([3.5,2.8,3]);} + +module _6032(Name="",Value="",Library="") {TANTAL([5.2,3.2,2.8]);} + +module _7243(Name="",Value="",Library="") {TANTAL([6.8,4.3,3]);} + +module 0414_15(Name="",Value="",Library="") {R_THT(4.5,7.62*2,0.9);} + +module 0204_5(Name="",Value="",Library="") {R_THT(1.8,5.08*1.0,0.5); } +module 0204_7(Name="",Value="",Library="") {R_THT(1.8,7.62*1.0,0.5); } +module R_7_5(Name="",Value="",Library="") {R_THT(3,5.08*1.5,0.6); } +module R_10(Name="",Value="",Library="") {R_THT(3,5.08*2,0.6); } +module R_12_5(Name="",Value="",Library="") {R_THT(3,5.08*2.5,0.6); } + +module SIL8(Name="",Value="",Library="resistor-sil"){translate([-1.27*7,0,0])R_SIL(8); } +module SIL9(Name="",Value="",Library="resistor-sil"){translate([-1.27*8,0,0])R_SIL(9); } + +module CAY16(Name="",Value="",Library="resistor-dil") {EXB38V();} + +module C050_025X075(Name="",Value="",Library="") {C_THT(2,5.08*1,0.6); } +module C050_024X044(Name="",Value="",Library="") {C_THT(2,5.08*1,0.6); } +module C_5(Name="",Value="",Library="") {C_THT(2,5.08*1,0.6); } +module C_2_5(Name="",Value="",Library="") {color("orange") translate([-2,-0.8,2])cube([4,1.6,3]); + translate([-1.27,0,3]) make_line_of(2.54, 2) LOETPIN(dim = 0.4);} +module C_NP7(Name="",Value="",Library="") {color("silver") Phased_cylinder(8,3.5,3.5); } +module C_NP6(Name="",Value="",Library="") {color("silver") Phased_cylinder(8,3,3); } +module C_NP5(Name="",Value="",Library="") {color("silver") Phased_cylinder(8,2.5,2.5); } + + + +module EXB38V(Name="",Value="",Library="resistor-dil") + { color("DarkSlateGray") cubepart([3.2,1.6,0.5]); + translate([-1.3,0,0]) color("Silver") cubepart([0.65,2.2,0.4]); + translate([1.3,0,0]) color("Silver") cubepart([0.65,2.2,0.4]); + translate([-0.4,0,0]) color("Silver") cubepart([0.45,2.2,0.4]); + translate([0.4,0,0]) color("Silver") cubepart([0.45,2.2,0.4]); + } + + +module LED_0603(Name="",Value="",Library="",Enable = false) {LED_SMD(size = [0.8,1.7,0.65], Enable = Enable, Value = Value);} +module LED_0805(Name="",Value="",Library="",Enable = false) {LED_SMD(size = [1.2,2.0,0.65], Enable = Enable, Value = Value);} +module CHIP_LED0805(Name="",Value="",Library="led") {rotate([0,0,90]) LED_0805(Value = Value);} +module LED4_BR0(Name="",Value="",Library="",Enable = false) {LED_SMD(size = [3,3.4,0.65], Enable = Enable, Value = Value);} + +// FUSE +module FUSE2920(Name="",Value="",Library="") {R_SMD([8,5.4,1.25]);} +module ATO_FKS_20(Name="",Value="",Library="Littelfuse") +{ + color("DarkSlateGray") + difference() + { + cubepart([20,6,17.5]); + translate([0,0,5]) cubepart([16,5,17.5]); + } + color("DeepPink") cubepart([19.2,5,25]); +} + +module H7810(Name="",Value="",Library="Littelfuse") +{ + color("DarkSlateGray") + difference() + { + cubepart([14.2,6,15.6]); + translate([0,0,5]) cubepart([12.6,5,15.6]); + } + color("DeepPink") cubepart([12,5,24]); +} + +module ELKO_136X135(Name="",Value="",Library="") { color("DarkSlateGray") linear_extrude(2) polygon([[4.5,6.8],[6.8,4.5],[6.8,-6.8],[-6.8,-6.8],[-6.8,4.5],[-4.5,6.8]]); + color("silver") Phased_cylinder(13.5,12.5/2,12.5/2);} + +module ELKO_FCG(Name="",Value="",Library="") { color("DarkSlateGray") linear_extrude(2) polygon([[3.5,5.5],[5.5,3.5],[5.5,-5.5],[-5.5,-5.5],[-5.5,3.5],[-3.5,5.5]]); color("silver") Phased_cylinder(10.5,5,5);} +module PANASONIC_D(Name="",Value="",Library="") { color("DarkSlateGray") translate([0,0,1/2]) cube([6.6,6.6,1], center = true); color("silver") Phased_cylinder(5.8,6.3/2,6.3/2);} +module ELCO_E(Name="",Value="",Library="") { color("DarkSlateGray") translate([0,0,1/2]) cube([8.3,8.3,1], center = true); color("silver") Phased_cylinder(6.2,4,4);} +module ELCO_F(Name="",Value="",Library="") { color("DarkSlateGray") translate([0,0,1/2]) cube([8.3,8.3,1], center = true); color("silver") Phased_cylinder(10.2,4,4);} +module ES_3_8(Name="",Value="",Library="") {translate([-0.635,0,0]) { color("DarkSlateGray") Phased_cylinder(12.5,4.3,4.3); make_line_of(3.81, 2, center=true) LOETPIN(height = 4, dim = 0.6, rnd = true);}} +module E3_5_8(Name="",Value="",Library="rcl") { color("DarkSlateGray") Phased_cylinder(12.5,4.3,4.3); make_line_of(3.5, 2, center=true) LOETPIN(height = 4, dim = 0.6, rnd = true);} +module ES_3_4(Name="",Value="",Library="") {color("DarkSlateGray") Phased_cylinder(12.5,4.3,4.3); make_line_of(3.4, 2, center=true) LOETPIN(height = 3, dim = 0.6, rnd = true);} +module ES_1_5(Name="",Value="",Library="") {color("DarkSlateGray") Phased_cylinder(6,4.4/2,4.4/2);make_line_of(1.5, 2, center=true) LOETPIN(height = 3, dim = 0.6, rnd = true);} +module ES_2_2(Name="",Value="",Library="") {color("DarkSlateGray") Phased_cylinder(12,5/2,5/2);make_line_of(2.2, 2, center=true) LOETPIN(height = 3, dim = 0.6, rnd = true);} +module ES_5L(Name="",Value="",Library="") {translate([2.5,0,0]) {color("DarkSlateGray") Phased_cylinder(20,6.3,6.3);make_line_of(5, 2, center=true) LOETPIN(height = 3, dim = 0.6, rnd = true);}} +module ES_5(Name="",Value="",Library="") {color("DarkSlateGray") Phased_cylinder(20,6.3,6.3);make_line_of(5, 2, center=true) LOETPIN(height = 3, dim = 0.6, rnd = true);} +module ES_2_5(Name="",Value="",Library="") {color("DarkSlateGray") Phased_cylinder(12,4,4);make_line_of(2.5, 2, center=true) LOETPIN(height = 3, dim = 0.6, rnd = true);} +module E2_5_5(Name="",Value="",Library="") {color("DarkSlateGray") Phased_cylinder(10,2.5,2.5);make_line_of(2.5, 2, center=true) LOETPIN(height = 3, dim = 0.6, rnd = true);} +module E2_5_6(Name="",Value="",Library="") {color("DarkSlateGray") Phased_cylinder(10,3,3);make_line_of(2.5, 2, center=true) LOETPIN(height = 3, dim = 0.6, rnd = true);} +module E2_5_7(Name="",Value="",Library="") {color("DarkSlateGray") Phased_cylinder(12,3.5,3.5);make_line_of(2.5, 2, center=true) LOETPIN(height = 3, dim = 0.6, rnd = true);} +module 10X5X0_9(Name="",Value="",Library="") {color("Red") Phased_cylinder(20,10.25/2,10.25/2);} + +module L_THT_8_10(Name="",Value="",Library="") {color("DarkSlateGray") Phased_cylinder(10,4,4);make_line_of(3, 2, center=true) LOETPIN(height = 3, dim = 0.6, rnd = true);} + + +module 82114R(Name="",Value="",Library="") {color("DarkSlateGray") Phased_cylinder(11,3.3,3.3); rotate([0,0,90]) make_line_of(3.81, 2, center=true) LOETPIN(height = 3, dim = 0.6, rnd = true);} + + +module E45_18(Name="",Value="",Library=""){ELKO_THT_L(D=18,L=2.54*18);} +module E30_10(Name="",Value="",Library=""){ELKO_THT_L(D=10,L=2.54*12);} + +module ELKO_THT_L(D=10,L=45){ + L1 = L-2.54; + Pin = 0.8; + color("DarkSlateGray") translate([-L1/2,0,D/2]) rotate([0,90,0]) Phased_cylinder(L1,D/2,D/2); + ; + color("Silver") + { + translate([L/2,0,-2.25*Pin+D/2]) BendedPIN(Pin,D/2+2,l2=2*Pin); + translate([-L/2,0,-2.25*Pin+D/2]) rotate([0,0,180]) BendedPIN(Pin,D/2+2,l2=2*Pin); + } + } + + + + +module Phased_cylinder(l,r1,r2,Roundness = 0.2) +{ + if ((Detailgrad < 21)) + { + cylinder(l,r1,r2); + } + else + { + round1 = r1*Roundness/2; + round2 = r2*Roundness/2; + cylinder(l,r1-round1,r2-round2); + translate([0,0,round1]) cylinder(l-round2-round1,r1,r2); + rotate_extrude(convexity = 10) translate([r1-round1, round1, 0]) circle(r = round1); + rotate_extrude(convexity = 10) translate([r2-round2, l-round2, ]) circle(r = round1); + } +} + +module SIP3S(Name="",Value="",Library="") +{ + rotate([0,0,180]) translate([-8.41,-1.27,0]) color("DarkSlateGray") cube([11.747500,7.302500, 10.5]); + make_line_of(2.54, 3) LOETPIN(); +} + +module SIP3L(Name="",Value="",Library="") +{ + rotate([0,0,180]) translate([2.54,2.25,0]) color("DarkSlateGray") cubepart([11.5,8.5, 17.5]); + translate([-5.08,0,0]) make_line_of(2.54, 3) LOETPIN(); +} + + +module SIP4(Name="",Value="",Library="") //RM0505S RM0505S +{ + translate([-4.603700,-1.27,0]) color("DarkSlateGray") cube([11.747500,7.302500, 10.5]); + translate([-2.54,0,0]) make_line_of(2.54, 4) LOETPIN(); +} + + +module SIP7(Name="",Value="",Library="") +{ + Displacement = (Library == "traco_tma")?[-7.89,2.3,0]:[0,0,0]; + translate(Displacement) // [-3*2.54,1*2.54,0]) + { + translate([-2,-5.78,0]) color("DarkSlateGray") cube([19.6,7.05, 10.2]); + translate([0,0,0]) make_line_of(2.54, 2) LOETPIN(4.1,0.5); + translate([3*2.54,0,0]) make_line_of(2.54, 3) LOETPIN(4.1,0.5); + } +} + +module SIP7L(Name="",Value="",Library="") +{ + translate([-2,-5.78+7.05,0]) rotate([-90,0,0]) color("DarkSlateGray") translate([-0,-7.05,0]) cube([19.6,7.05, 10.2]); + translate([0,0,-0.5]) make_line_of(2.54, 2) rotate([0,0,-90]) BendedPIN(0.6, l2=1.2); + translate([3*2.54,0,-0.5]) make_line_of(2.54, 3)rotate([0,0,-90]) BendedPIN(0.6,l2=1.2); +} + +module SIP7XP(Name="",Value="",Library="") +{ + //translate([-3*2.54,1*2.54,0]) + { + translate([-2.13,-(9.2-2.4),0]) color("DarkSlateGray") cube([19.5,9.2, 11.1]); + translate([0,0,0]) make_line_of(2.54, 2) LOETPIN(4.1,0.5); + translate([4*2.54,0,0]) make_line_of(2.54, 3) LOETPIN(4.1,0.5); + color("White") translate([0,-(9.2-2.4),2]) rotate([90,0,0]) cylinder(0.1,0.5,0.5); + } +} + +module A1353BCD(Name="",Value="",Library="") {rotate([0,0,-90]) BCD_DIL(Name=Name,Value=Value,Library=Library);} +module P103(Name="",Value="",Library="") {rotate([0,0,-90]) BCD_DIL(Name=Name,Value=Value,Library=Library);} + + +module BCD_DIL(Name="",Value="",Library="") +{ + gehause_polygon=[[5,-5],[5,4],[4,5],[-5,5],[-5,-5]]; + color("DarkSlateGray") linear_extrude(1) polygon(gehause_polygon); + color("LemonChiffon") { translate([0,0,1]) linear_extrude(3.3) polygon(gehause_polygon); + translate([0,0,4.3]) cylinder(2.2,5,5); } + translate([-2.54,3.81,0]) make_line_of(2.54, 3) LOETPIN(4.1,0.5); + translate([-2.54,-3.81,0]) make_line_of(2.54, 3) LOETPIN(4.1,0.5); +} +// Honeywell +module HIH_4000_001(Name="",Value="",Library="Honeywell") + { + + rotate([00,00,180]) translate([-2.09,-1.4,4]) + { + color("DarkSlateGray") difference() + { + cube([4.18,2.03,8.6]); + translate([0.6,1,2]) cube([3,2,5]); + } + color("Silver") translate([1.3,1,3.5]) cube([1.5,1,2.8]); + } + translate([0,0,5.9]) rotate([0,0,00]) LOETPIN(dim = 0.4, height=9, displacement=0); + translate([2.54,0,5.9]) rotate([0,0,00]) LOETPIN(dim = 0.4, height=9, displacement=-1.27); + translate([-2.54,0,5.9]) rotate([0,0,180]) LOETPIN(dim = 0.4, height=9, displacement=-1.27); + + + } + +module HIH_4000_001_H(Name="",Value="",Library="Honeywell") +{ + translate([0,4,0.2]) rotate([-90,00,0]) HIH_4000_001(Name="",Value="",Library="Honeywell"); +} + + +//RECOM +module SMD_DIL1(Name="",Value="",Library="") { + SMD_IC([15.24,10.7,9], frustum = 3); + SMD_PIN(size=[15.24,8.5,9], pinnumber = 1, pitch=2.54, pinlength=1.3 ); + SMD_PIN(size=[15.24,8.5,9], pinnumber = 2, pitch=2.54, pinlength=1.3 ); + SMD_PIN(size=[15.24,8.5,9], pinnumber = 4, pitch=2.54, pinlength=1.3 ); + SMD_PIN(size=[15.24,8.5,9], pinnumber = 5, pitch=2.54, pinlength=1.3 ); + rotate([0,0,180]) SMD_PIN(size=[15.24,8.5,9], pinnumber = 7-5, pitch=2.54, pinlength=1.3 ); + rotate([0,0,180]) SMD_PIN(size=[15.24,8.5,9], pinnumber = 10-5, pitch=2.54, pinlength=1.3 ); + } + +module REC_RCD(Name="",Value="",Library="") { + translate([+3.5*2.54,0,0]) color("DarkSlateGray") cubepart([22.10,12.55,8.5]); +} + +// WÜRTH +module MAGI3C_FISM_SMT_8(Name="",Value="",Library="") { + SMD_IC([12.75,10.7,7], frustum = 3); + SMD_PIN(size=[11.75,8.5,9], pinnumber = 1, pitch=2.54, pinlength=1.3 ); + SMD_PIN(size=[11.75,8.5,9], pinnumber = 2, pitch=2.54, pinlength=1.3 ); + SMD_PIN(size=[11.75,8.5,9], pinnumber = 4, pitch=2.54, pinlength=1.3 ); + rotate([0,0,180]) SMD_PIN(size=[11.75,8.5,9], pinnumber = 5-4, pitch=2.54, pinlength=1.3 ); + rotate([0,0,180]) SMD_PIN(size=[11.75,8.5,9], pinnumber = 8-4, pitch=2.54, pinlength=1.3 ); + } + +module _171021501(Name="",Value="",Library="") + { SMD_FN(size = [11,9,2.8],pinrows=4, pitch=0.9, pinheight = 0, phase = 0); + } + +module PACKAGE_A2(Name="",Value="",Library="") {translate([0,-1.27,0]) SMD_DIL1(Name=Name,Value=Value,Library=Library);} +module DC_SMD(Name="",Value="",Library="") {translate([-1.27,0,0]) SMD_DIL1(Name=Name,Value=Value,Library=Library);} + +module DIP(Name="",Value="",Library="") {SMD_IC([8.3,8.3,6.8]);translate([0,2.54,0])LOETPIN();translate([2.54,2.54,0])LOETPIN();translate([-2.54,-2.54,0])LOETPIN();translate([2.54,-2.54,0])LOETPIN();} +module DIL04(Name="",Value="",Library="") {DIL(n=4,b=7.62,Text=Name);} +module DIL08(Name="",Value="",Library="") {DIL(n=8,b=7.62,Text=Name);} +module DIP08_MCU(Name="",Value="",Library="") {DIL(n=8,b=7.62,Text=Name);} +module DIL8(Name="",Value="",Library="") {DIL(n=8,b=7.62,Text=Name);} +module DIL14(Name="",Value="",Library="") {DIL(n=14,b=7.62,Text=Name);} +module DIL16(Name="",Value="",Library="") {DIL(n=16,b=7.62,Text=Name);} +module DIL18(Name="",Value="",Library="") {DIL(n=18,b=7.62,Text=Name);} +module DIL20(Name="",Value="",Library="") {DIL(n=20,b=7.62,Text=Name);} +module DIL24_6(Name="",Value="",Library="") {DIL(n=24,b=7.62*2,Text=Name);} +module DIL28(Name="",Value="",Library="") {DIL(n=28,b=7.62*2,Text=Name);} +module DIL28_6(Name="",Value="",Library="") {DIL(n=28,b=7.62*2,Text=Name);} +module DIL28_3(Name="",Value="",Library="") {DIL(n=28,b=7.62,Text=Name);} +module DIL40(Name="",Value="",Library="") {DIL(n=40,b=7.62*2,Text=Name);} + + +module 8PM_11_0010_02_131191(Name="",Value="",Library="") {PreciDip_8PM_11(pins = 10);} +module 8PM_11_0005_02_131191(Name="",Value="",Library="") {PreciDip_8PM_11(pins = 5);} + +module 811_S1_005_10_016101(Name="",Value="",Library="") {rotate([0,0,90]) PreciDip_81X_S1(N=5, M= 1, A = 7, B = 4); } + +module PreciDip_8PM_11(pins = 10, Serie = 131) + { + l1 = Serie == 131 ? 7.3 : 5.3; + l2 = Serie == 131 ? 8.95 : 7; + d = Serie == 131 ? 1.02 : 0.96; + + + pitch=2.54; translate([-pitch/2+pitch*pins/2,0.1,1.7/2]) rotate([90,0,180]) make_line_of(pitch, pins) { cylinder(l1,1.7/2,1.7/2); cylinder(l2-d/2,d/2,d/2); translate([0,0,l2-d/2]) sphere(d/2); + }color("DarkSlateGray") translate([0,2.5,0.85]) cubepart([pitch*pins,5,2.44-0.85]);} + + +module PreciDip_81X_S1(N = 5, M = 1, A = 7, B = 4) +{ + offs = 0.9; + height = 11.6; + pitch = 2.54; + solderpin = 0.8; + pin = 1.07; + + module aPin() { cylinder(0.5,1.83/2,1.83/2, $fn=Detailgrad); translate([0,0,-3+solderpin/2]) cylinder(3-solderpin/2,solderpin/2,solderpin/2, $fn=Detailgrad); cylinder(A-pin/2,pin/2,pin/2, $fn=Detailgrad); translate([0,0,-3+solderpin/2]) sphere(solderpin/2, $fn=Detailgrad);translate([0,0,A-pin/2]) sphere(pin/2,$fn=Detailgrad);} + + translate([-(pitch/2)*N+offs,-(pitch/2)*M+offs,0.4]) make_line_of(pitch, N) color("DarkSlateGray") linear_extrude(B) offset_square(size=[pitch-2*offs,pitch*M-2*offs], delta = offs, chamfer=true); + + translate([-(pitch/2)*(N-1),-(pitch/2)*(M-1),0]) make_line_of(pitch, N) color("Silver") aPin(Name="",Value="",Library=""); + + //if (m>1) translate([-(pitch/2)*(n-1),+(pitch/2)*(m-1),0]) make_line_of(pitch, n) color("Silver") translate([0,0,8.7-height/2]) cube([pin,pin,height], center = true); + + //if (m>2) translate([-(pitch/2)*(n-1),0,0]) make_line_of(pitch, n) color("Silver") translate([0,0,8.7-height/2]) cube([pin,pin,height], center = true); + +} + +module 800_80_005_30_480101(Name="",Value="",Library="") {rotate([0,0,90]) PreciDip_80X_PP_30_480(N = 5, M = 1);} + +module PreciDip_80X_PP_30_480(N = 5, M = 1) +{ + offs = 0.9; + B = 2.8; + height = 3.5; + pitch = 2.54; + solderpin = 0.76; + pin = 1.6; + + module aPin() { cylinder(0.5,1.6/2,1.6/2, $fn=Detailgrad); translate([0,0,-3.6+solderpin/2]) cylinder(3.6-solderpin/2,solderpin/2,solderpin/2, $fn=Detailgrad); translate([0,0,-3.6+solderpin/2]) sphere(solderpin/2, $fn=Detailgrad); cylinder(height,pin/2,pin/2, $fn=Detailgrad); } + + translate([-(pitch/2)*N+offs,-(pitch/2)*M+offs,0.3]) make_line_of(pitch, N) color("DarkSlateGray") linear_extrude(B) offset_square(size=[pitch-2*offs,pitch*M-2*offs], delta = offs, chamfer=true); + + translate([-(pitch/2)*(N-1),-(pitch/2)*(M-1),0]) make_line_of(pitch, N) color("Silver") aPin(Name="",Value="",Library=""); + + //if (m>1) translate([-(pitch/2)*(n-1),+(pitch/2)*(m-1),0]) make_line_of(pitch, n) color("Silver") translate([0,0,8.7-height/2]) cube([pin,pin,height], center = true); + + //if (m>2) translate([-(pitch/2)*(n-1),0,0]) make_line_of(pitch, n) color("Silver") translate([0,0,8.7-height/2]) cube([pin,pin,height], center = true); + +} + +//Produktdetails 8PM_11_0005 +//SIL-Kontakte mit Federkraftanschluss, 2,54 mm, paralleles SMD-Pad +// +//Die modularen Steckverbinder der Serie Preci-dip SIL 8PM-11 mit geringem Widerstand besitzen Kontakte mit Federkraftanschluss (SLC) mit parallelen SMD-Pads für Bestückungsmaschinen. +//Einzelheiten zu den Maßen finden Sie im Herstellerdatenblatt auf unserer Website. +//Passender SMD-SIL-Pad-Steckverbinder siehe typische Best.-Nr. 702-0360 (gerade) oder 702-5126 (parallel) +//Durchkontaktierte SIL-Steckverbinder siehe typische Best.-Nr. 701-9947 und gerade SMD-Steckverbinder siehe typische Best.-Nr. 702-0234 +// +//Das Höhenmaß ergibt die gesamte Parallelhöhe des Steckverbinders über der Leiterplatte. +//Die Gesamtlänge des Steckverbinders beträgt 8,95 mm +//Die Hublänge des Stößels beträgt 1,5 mm +//Passender SMD-SIL-Pad-Steckverbinder siehe typische Best.-Nr. 702-0360 (gerade) oder 702-5126 (parallel) +//Durchkontaktierte SIL-Steckverbinder siehe typische Best.-Nr. 701-9947 und gerade SMD-Steckverbinder siehe typische Best.-Nr. 702-0234 +//Normen +// +//UL 94V-0 + +module SMD5_2_54_ROUND(Name="",Value="",Library="") {InvisiblePart();} + +// INDUKTIVITAET +// Würth Elecronic +module WE_PD_1260_1245_1280_1210(Name="",Value="",Library="") {DROSSEL(size = [12,12,10]);} +module WE_HCI_5040(Name="",Value="",Library="") {DROSSEL(size = [5.3,5.6,4]);} +module WE_HCI_1890(Name="",Value="",Library="") {DROSSEL(size = [18.5,18.5,9]);} +module WE_SL2(Name="",Value="",Library="") {DROSSEL(size = [9.4,6.2,5]);} +module WE_CNSW1812(Name="",Value="",Library="") {DROSSEL(size = [4.5,3.2,2.8]);} +module WE_CNSW(Name="",Value="",Library="") {DROSSEL(size = [3.2,1.6,1.9]);} +module L1812(Name="",Value="",Library="") {DROSSEL(size = [4.5,3.2,2.8]);} +module WE_SL_4WINDING(Name="",Value="",Library="") {DROSSEL(size = [11,10.5,5.5]);} +module WE_LHMI_4020(Name="",Value="",Library="") {DROSSEL(size = [4.45,4.06,1.8]);} +module WE_LQS_6028(Name="",Value="",Library="") {DROSSEL(size = [6,6,5]);} +module WE_LQS_3015(Name="",Value="",Library="") {DROSSEL(size = [3,3,1.5]);} +module WE_LQS_2512(Name="",Value="",Library="") {DROSSEL(size = [2.5,2.5,1.5]);} +module WE_HCI_1350_1365(Name="",Value="",Library="") {DROSSEL(size = [12.8,12.8,6.2]);} +module _749023015(Name="",Value="",Library="") {rotate([0,0,270]) SMD_IC([18.3,12.2,6.35],pinrows=2,pitch=1.27,phase = 1);} +module _749020111(Name="",Value="",Library="") {rotate([0,0,270]) SMD_IC([16.5,9,2.35],pinrows=2,pinlength=0.35,pitch=1.27,phase = 0);} +module WE_LAN_749020011A(Name="",Value="",Library="") {SMD_IC([17.5,14.2,6.5],pinrows=2,pinlength=0.52,pitch=1.27,phase = 1);} +module L3225M(Name="",Value="",Library="") {DROSSEL(size = [3.2,2.5,1.55]);} + +module DR127(Name="",Value="",Library="") {rotate([0,0,0]) DROSSEL(size = [12.7,12.7,6]);} +module LSMD7X7(Name="",Value="",Library="") {rotate([0,0,90]) DROSSEL(size = [7.3,7.3,5]);} +module ALT3232M(Name="",Value="",Library="") {DROSSEL(size = [3.2,3.2,2.9]);} +module ACM2012_2P(Name="",Value="",Library="") {DROSSEL(size = [2,1.2,1.3]);} +module SFT1040(Name="",Value="",Library="") {color("Gray") translate([-6,0,12.5]) rotate([0,90,0])Ringkern(25, 16, 12);} +module SFT1030(Name="",Value="",Library="") {color("Gray") translate([-4,0,10]) rotate([0,90,0])Ringkern(20, 12, 8);} +module ED22(Name="",Value="",Library=""){color("Gray") translate([0,0,1]) Ringkern(21, 12, 8);} + + + +module LDG_LG4801D(Name="",Value="",Library="OEM-Switch") { + color("DarkSlateGray") cubepart([28.000,11.000,11]); + translate([-0.5,2.7,0]) make_line_of(2, 12, center=true) LOETPIN(height = 3.3, dim = 0.6, rnd = true); + translate([0.5,4.45,0]) make_line_of(2, 12, center=true) LOETPIN(height = 3.3, dim = 0.6, rnd = true); + translate([0.5,-2.7,0]) make_line_of(2, 12, center=true) LOETPIN(height = 3.3, dim = 0.6, rnd = true); + translate([-0.5,-4.45,0]) make_line_of(2, 12, center=true) LOETPIN(height = 3.3, dim = 0.6, rnd = true); + +} +module PTG_1841(Name="",Value="",Library="OEM-Switch") { + color("DarkSlateGray") cubepart([16.800,7.400,11]); + translate([0,2.38,0]) make_line_of(1.78, 9, center=true) LOETPIN(height = 4, dim = 0.6, rnd = true); + translate([0,-2.38,0]) make_line_of(1.78, 9, center=true) LOETPIN(height = 4, dim = 0.6, rnd = true); +} + +module _68715014522(Name="",Value="",Library="") {rotate([0,0,180]) FPC_L(size = [31.6,4.5,2]);} +module _68714014522(Name="",Value="",Library="") {rotate([0,0,180]) FPC_L(size = [26.6,4.5,2]);} +module _68714014022(Name="",Value="",Library="") {rotate([0,0,180]) FPC_L(size = [26.6,4.5,2]);} +module _68712414522(Name="",Value="",Library="") {rotate([0,0,180]) FPC_L(size = [18.4,4.5,2]);} +module _687124149022(Name="",Value="",Library="") {translate([0,-1,0]) rotate([0,0,180]) FPC_L(size = [18.2,4.5,2]);} + +module _68611014422(Name="",Value="",Library="Wurth_Connectors_WR-FPC"){translate([0,2.8,0]) rotate([0,0,180]) FPC_L(size = [16.90,5.4,3], pitch=1);} +module _68712014522(Name="",Value="",Library="Wurth_Connectors_WR-FPC"){translate([0,1.8,0]) rotate([0,0,180]) FPC_L(size = [16.4,4.3,2.1], pitch=0.5, pinlength = 0.8);} + +module _687310124422(Name="",Value="",Library="") {rotate([0,0,180]) FPC_S(size = [11.44,2,4.5], pitch=0.5, invers = false); + ;} +module _687350124422(Name="",Value="",Library="") {translate([2.3,0,0]) rotate([0,0,180]) FPC_S(size = [32.44,2,4.5], pitch=0.5, invers = false); + ;} +module _686320124422(Name="",Value="",Library="") {rotate([0,0,180]) FPC_S(size = [24.44,2,4.5], pitch=0.5, invers = false); + ;} + +module _687320124422(Name="",Value="",Library="Wurth_Connectors_WR-FPC") {rotate([0,0,180]) FPC_S(size = [16.4,2,4.3], pitch=0.5, invers = false); + ;} + +module _686110183822(Name="",Value="",Library="Wurth_Connectors_WR-FPC") {rotate([0,0,180]) FPC_S(size = [16.8,2.3,3.9], pitch=1, invers = false); + ;} + +module FPC_LIF_V_20_1(Name="",Value="",Library="CON-SMD_6"){translate([0.0,0,0]) FPC_S(size = [26,3.5,6], pitch=1, invers = false); + ;} + + // +module ZF1_15S(Name="",Value="",Library="") {translate([2.5,0,0]) FPC_S(size = [23,3.5,6], pitch=1, invers = false); + ;} +module FH12_53S_0_5SH(Name="",Value="",Library="") {translate([0,2.5,0]) rotate([0,0,180]) FPC_L(size = [33,5.2,2]);} + +module HRSZIF2405O(Name="",Value="",Library="") {rotate([0,0,180]) FPC_L(size = [16.5,6.2,2]);} +module ZF1_10(Name="",Value="",Library="") {rotate([0,0,180]) FPC_L(size = [16.9,5.2,2], pitch=1);} +module ZF1_15(Name="",Value="",Library="") {rotate([0,0,180]) FPC_L(size = [20.9,5.2,2], pitch=1);} +module ZF1_10_4(Name="",Value="",Library="") {_687310124422(Name=Name,Value=Value,Library=Library);} +module _68711014522(Name="",Value="",Library="") {rotate([0,0,180]) FPC_L(size = [11.4,4.2,2], pitch=0.5);} +module _68710614522(Name="",Value="",Library="") {rotate([0,0,180]) FPC_L(size = [9.4,4.2,2], pitch=0.5);} + + +module 52746_8(Name="",Value="",Library="") // //Molex FPC +{ + rotate([0,0,180]) FPC_L(size = [10.4,4.2,2], pitch=0.5); +} + +module M50F_SMT(Name="",Value="",Library="") {SMD_IC([6.8,3.4,1.7],pinrows=2,pitch=1.27); + color("DarkSlateGray") translate([+1.2/2,0,3.4]) cubepart([9.6,3,4.8]); + color("Yellow") translate([-9.6/2,0,3.4]) cubepart([1.2,3,4.8]); + translate([-2.54,1.27/2,4]) make_line_of(1.27, 5) LOETPIN(height = 3.5, dim = 0.45); + translate([-2.54,-1.27/2,4]) make_line_of(1.27, 5) LOETPIN(height = 3.5, dim = 0.45);} +module M50F_SMS(Name="",Value="",Library="") {M50F_SMT(Name=Name,Value=Value,Library=Library);} +module M50F2_SM(Name="",Value="",Library="") {M50F_SMT(Name=Name,Value=Value,Library=Library);} +module M50F4_SM(Name="",Value="",Library="") {M50F_SMT(Name=Name,Value=Value,Library=Library);} +module M50F_SM2(Name="",Value="",Library="") {M50F_SMT(Name=Name,Value=Value,Library=Library);} + +// Speeker +module UEB025(Name="",Value="",Library="") { color("silver") cylinder(12,12.5,12.5, $fn=Detailgrad); } +// BUTTON Switch +module BT_4025(Name="",Value="",Library="") { color("DarkSlateGray") cylinder(1.5,0.8,0.8, $fn=Detailgrad); color("silver") translate([-1.5,-1.25,0]) cube([3,2.5,1.2]); +} + +module BT_6030(Name="",Value="",Library="") { color("DarkSlateGray") cylinder(2.1,0.9,0.9, $fn=Detailgrad); color("silver") translate([-2,-1.5,0]) cube([4,3,1.5]); +} + +module B3F_10XX(Name="",Value="",Library="") { color("DarkSlateGray") cylinder(4.5,1.75,1.75, $fn=Detailgrad); color("silver") translate([-3,-3,0]) cube([6,6,3.25]); +} + +module KMR2() { color("DarkSlateGray") cylinder(2.1,0.9,0.9, $fn=10); color("silver") translate([-2,-1.5,0]) cube([4,3,1.5]);// Button + } + +// Switch +module _450301014042(Name="",Value="",Library="") { color("silver") cubepart([10,2.5,5]); color("orange") translate([0,0,5]) cubepart([8.4,2.5,1.4]);} + +module 320_938(Name="",Value="",Library="") +{ + color("Blue") translate([0,0,2]) cubepart([12,13.5,11]); + color("Silver") translate([0,0,2.1]) cubepart([12.1,10.5,11]); + color("Silver") translate([0,0,2.1+11]) cylinder(9,6.3/2,6.3/2); + color("Silver") translate([0,0,2.1+11]) cylinder(1,8/2,8/2); + color("Silver") translate([0,0,2.1+11+9]) + difference() + { + cylinder(12,2.5/2,5/2); + translate([0,-3-1.1,-1]) cubepart([6,6,14]); + translate([0,+3+1.1,-1]) cubepart([6,6,14]); + } + translate([0,0,2]) make_line_of(4.75, 2, center=true) rotate([0,0,90]) make_line_of(4.0, 3, center=true) LOETPIN(height = 5, dim = 0.8); +} + + +// Quarz SMD +module Q_2X3(Name="",Value="",Library="") {color("silver") cubepart([3.2,2.5,1.2],r=0.25);} +module Q_2X25(Name="",Value="",Library="") {color("silver") cubepart([2.5,2,1.2],r=0.25);} +module Q_7X5(Name="",Value="",Library="") {color("silver") cubepart([7,5,2],r=0.25);} + +// QUARZ-THT +module HC_QUARZ(h=4) //X2 CRYSTALS-NOGND-HC49 +{ + function bogen(point=[0,0], r = 1 ,phase = 0, winkel = 90, $fn=$fn) = [let(num=abs($fn*winkel/360)) for (i=[0:num], x=i*winkel/num) [point[0]+r*cos(x+phase),point[1]+r*sin(x+phase)]]; + function winkel(a,b=[0,0]) = atan2(a[1]-b[1],a[0]-b[0]); + if (Detailgrad > 9) + { + color("silver") linear_extrude(1) + //hull(Name="",Value="",Library=""){translate([6.85/2,0,0]) circle(4.65/2,$fn=Detailgrad);translate([-6.85/2,0,0]) circle(4.65/2,$fn=Detailgrad);} + polygon(concat(bogen(point=[6.85/2,0], r=4.65/2 ,phase = winkel([6.85/2,0],[-6.85/2,0])-90, winkel = 180, $fn=Detailgrad), bogen( point=[-6.85/2,0], r=4.65/2 ,phase = winkel([-6.85/2,0],[6.85/2,0])-90, winkel = 180, $fn=Detailgrad))); + + color("silver") linear_extrude(h) + // hull(Name="",Value="",Library=""){translate([6.85/2,0,0]) circle(3.5/2,$fn=Detailgrad);translate([-6.85/2,0,0]) circle(3.5/2,$fn=Detailgrad);} + + polygon(concat(bogen(point=[6.85/2,0], r=3.5/2 ,phase = winkel([6.85/2,0],[-6.85/2,0])-90, winkel = 180, $fn=Detailgrad), bogen( point=[-6.85/2,0], r=3.5/2 ,phase = winkel([-6.85/2,0],[6.85/2,0])-90, winkel = 180, $fn=Detailgrad))); +//rotate([0,0,270]) linear_extrude(10) translate([-2.159000,-5.207000,0]) square([4.318000,10.414000]); //Board + } + else + color("silver") cubepart([4.65+6.85, 4.65,h]); +} + +module QS(Name="",Value="",Library="special") {HC_QUARZ(h = 4);make_line_of(4.88, 2, center=true) LOETPIN(height = 3, dim = 0.6, rnd = true);} +module HC49(Name="",Value="",Library="") {HC_QUARZ(h = 4);make_line_of(4.88, 2, center=true) LOETPIN(height = 3, dim = 0.6, rnd = true);} +module HC49_S(Name="",Value="",Library="") {HC_QUARZ(h = 4);make_line_of(4.88, 2, center=true) LOETPIN(height = 3, dim = 0.6, rnd = true);} +module HC18U_V(Name="",Value="",Library="") {HC_QUARZ(h = 13.5);make_line_of(4.88, 2, center=true) LOETPIN(height = 3, dim = 0.6, rnd = true);} + +// Diodes + +module 1KAB(Name="",Value="",Library="") {color("DarkSlateGray") translate([0,0,0.1])difference(){translate([0,0,0.1]) cylinder(5,9.5/2,9.5/2, $fn=Detailgrad); translate([8.7,0,0]) cubepart([10,10,6]);}} +module DO15_12E(Name="",Value="",Library="") {color("white") translate([-3,0,2.25]) rotate([0,90,0])cylinder(1,2.1,2.1); + color("DarkSlateGray") translate([-4,0,2.25]) rotate([0,90,0])cylinder(8,2,2); + translate([6.38,0,0]) BendedPIN(1,l2=2); + translate([-6.38,0,0]) rotate([0,0,180]) BendedPIN(1,l2=2); + } +module DO15_12(Name="",Value="",Library="") {DO15_12E(Name="",Value="",Library="") ;} +module DO_214AA(Name="",Value="",Library="") {DIODE(size = [4.6,4,2]); } +module DO_214AC(Name="",Value="",Library="") {DIODE(size = [4.24,2.7,2.6]);} +module DO_220AA(Name="",Value="",Library="") {DIODE(size = [3.5,2,1]); } +module VARTVSP_SMB_DO_214AA_UNI(Name="",Value="",Library="") {DIODE(size = [4.32,3.62,2.4]);} +module SOD_87(Name="",Value="",Library="") {DIODE(size = [3.6,1.778,2]);} +module SOD123(Name="",Value="",Library="") { DIODE(size = [2.8,1.8,2]);} +module PDI123(Name="",Value="",Library="") { + size = [2,3,1]; + color("DarkSlateGray") cubepart(size, frustum = 20); + color("white") translate([-size[0]*0.8/2,size[1]/8,0.01]) cube([size[0]*0.8,size[1]/8, size[2]]); + translate([0,+2.6-.275-1.4,0]) color("silver") cubepart([1.25,2.175,0.25]); + translate([0,-1.9+0.275,0]) color("silver") cubepart([1.25,0.775,0.25]); + //rotate([0,0,180]) SMD_IC(size = [2,3,2],pinrows=2,pitch=1.2); + } +module POWER_DI_123(Name="",Value="",Library="") {rotate([0,0,90]) PDI123(Name="",Value="",Library="") ;} +module MELF2(Name="",Value="",Library="") { translate([0,3.6/2,0.75]) // sod-80 + rotate([90,0,0]) + { + color("Crimson") translate([0,0,0.35]) cylinder(3.6-0.7,0.6,0.6, $fn=Detailgrad); + color("silver") + { + translate([0,0,3.6-0.35]) cylinder(0.35,0.75,0.75, $fn=Detailgrad); + translate([0,0,0]) cylinder(0.35,0.75,0.75, $fn=Detailgrad); + } + color("black") translate([0,0,0.75]) cylinder(0.35,0.65,0.65, $fn=Detailgrad); + } +} + +module MELF3(Name="",Value="",Library="") {rotate([0,0,90]) MELF2(Name=Name,Value=Value,Library=Library);} + + +module MELF1406(Name="",Value="",Library="") {MELF2(Name=Name,Value=Value,Library=Library);} +module SOP65P640X120_14N(Name="",Value="",Library="") {rotate([0,0,270]) SMD_IC([5,4.5,0.6],pinrows=2,pitch=0.65);} +module SOT65P280X100_8N(Name="",Value="",Library="") {rotate([0,0,270]) SMD_IC([2.9,1.7,0.8],pinrows=2,pitch=0.65, pinlength=0.6);} +module SOT65P280X100_8N(Name="",Value="",Library="") {rotate([0,0,270]) SMD_IC([2.9,1.7,0.8],pinrows=2,pitch=0.65, pinlength=0.6);} +module TSOT6(Name="",Value="",Library="") {SMD_IC([2.9,1.6,1.1],pinrows=2,pitch=0.95, pinlength=0.6);} +module SOT95P280X100_6N(Name="",Value="",Library="") {rotate([0,0,270]) SMD_IC([2.9,1.6,1.1],pinrows=2,pitch=0.95, pinlength=0.6, pinheight = 0.50);} +module SOD323_ST(Name="",Value="",Library="") {DIODE([1.8,1.3,1.17]); } +module SOD_323F(Name="",Value="",Library="") {SOD323_ST(Name=Name,Value=Value,Library=Library); } +module SOD110(Name="",Value="",Library="") {DIODE([2,1.27,1.2]); } +module WE_TVS_DFN1610_2L(Name="",Value="",Library="") {DIODE([1.6,1,0.5], pinlength = 0.01); } +module SMC(Name="",Value="",Library="") {DIODE(size = [7,6,2.6]);} // +module DO_214AB(Name="",Value="",Library="") {SMC(Name=Name,Value=Value,Library=Library);} +module SMB(Name="",Value="",Library="") {DO_214AA(Name=Name,Value=Value,Library=Library);} +module SOP65P600X115_15N_V(Name="",Value="",Library="") //U?1 726-BTS72002EPAXUMA1 + { + rotate([0,0,270]) SMD_IC([4.9,3.9,1],pinrows=2,pitch=0.65, pinlength=1.05); + } + +module SOP4(Name="",Value="",Library="") { SMD_IC([3.85,4.4,2],pinrows=2,pitch=2.54, pinwidth = 0.4, pinlength=1.3, pinheight = 1, phase = -1); +} + + +module POWERPAK_1212_8(Name="",Value="",Library="microbuilder") // DFN 3x3_EP +{ + SMD_IC([3.05,3.05,0.85],pinrows=2,pitch=0.65, pinlength=0.125); + color("Silver")cubepart([3.4,0.3,0.25]); +} + +module POWERDI3333(Name="",Value="",Library="microbuilder") // DFN 3x3_EP +{ + rotate([0,0,-90]) + { + SMD_IC([3.15,3.10,0.9],pinrows=2,pitch=0.65, pinlength=0.15); + color("Silver")cubepart([3.4,0.3,0.25]); + } +} + + +module TO_277A(Name="",Value="",Library="") { SMD_FN(size = [4.35,6.15,0.9],pinrows=2,pitch=2.13, pinheight = 0.4); } + +module 7PIN_PFM(Name="",Value="",Library="") { translate([7,0,0]) rotate([0,0,-90]) SMD_IC([10.8,10.8,2.5],pinrows=1,pitch=1.27,phase=1); } +module DPAK(Name="",Value="",Library="") +{ + SMD_IC([6.4,6,2.5]); + SMD_PIN(size=[6.4,6,2.5], pinnumber = 1, pitch=2.159, pinlength=2.7, pinwidth = 0.7 ); + SMD_PIN(size=[6.4,6,2.5], pinnumber = 2, pitch=2.159, pinlength=0.6, pinwidth = 0.7 ); + SMD_PIN(size=[6.4,6,2.5], pinnumber = 3, pitch=2.159, pinlength=2.7, pinwidth = 0.7 ); + rotate([0,0,180]) SMD_PIN(size=[6,6,2.5], pinnumber = 1, pitch=10, pinlength=0.65, pinheight = 1 ); +} +module TO252_5_11(Name="",Value="",Library="") {SMD_IC([6,6,2.5],pinrows=1,pitch=1.125, pinlength=2.5); + color("silver") translate([0,2.5,0]) cubepart([5.5,2,1]); } +module TO263_5(Name="",Value="",Library="") { translate([0,2,0]) SMD_IC([10.2,9.25,4.4],pinrows=1,pitch=1.7, pinlength=4.0); +color("silver") translate([0,6.5,0]) cubepart([10,2,1]); } +module SO235LAU(Name="",Value="",Library="") {SOT_23_5(Name=Name,Value=Value,Library=Library);} +module SO235LOS(Name="",Value="",Library="") {SOT_23_5(Name=Name,Value=Value,Library=Library);} +module SO235LOR(Name="",Value="",Library="") {SOT_23_5(Name=Name,Value=Value,Library=Library);} +module SOT95P280X145_5N(Name="",Value="",Library="") {rotate([0,0,-90]) SOT_23_5(Name=Name,Value=Value,Library=Library);} + +module SC70(Name="",Value="",Library="") {color("DarkSlateGray") cubepart([2,1.25,1]); + rotate([0,0,180]) SMD_PIN(size=[2,1.25,1], pinnumber = 1, pitch=0.65, pinlength=0.6 ); + rotate([0,0,180]) SMD_PIN(size=[2,1.25,1], pinnumber = 3, pitch=0.65, pinlength=0.6 ); + SMD_PIN(size=[2,1.25,1], pinnumber = 1, pitch=0.65, pinlength=0.6 ); + SMD_PIN(size=[2,1.25,1], pinnumber = 3, pitch=0.65, pinlength=0.6 ); + SMD_PIN(size=[2,1.25,1], pinnumber = 2, pitch=0.65, pinlength=0.6 ); +} + +module SC70_5(Name="",Value="",Library="") {SC70(Name=Name,Value=Value,Library=Library);} + + +module SOT23_6L(Name="",Value="",Library="") {SMD_IC(size = [3,1.5,1],pinrows=2,pitch=1,pinlength=0.6, pinheight = 0.5);} +module SOT65P210X110_5N(Name="",Value="",Library="") {SOT23_6L(Name=Name,Value=Value,Library=Library);} +module SOT23_6(Name="",Value="",Library=""){SOT23_6L(Name=Name,Value=Value,Library=Library);} +module SOT23_8(Name="",Value="",Library="") {SMD_IC(size = [2.9,1.7,1.4],pinrows=2,pitch=0.65,pinlength=0.6, pinheight = 0.5);} + + +module SOT95P280X145_6N(Name="",Value="",Library="") {rotate([0,0,-90]){SMD_IC(size = [3,1.5,1],pinrows=2,pitch=1,pinlength=0.6);}} +module SOT_23_5(Name="",Value="",Library="") {SOT_23(Name="",Value="",Library=""); // SC_74A + SMD_PIN(size=[3,1.5,1], pinnumber = 1, pitch=0.9, pinlength=0.60, pinheight = 0.5 ); + SMD_PIN(size=[3,1.5,1], pinnumber = 3, pitch=0.9, pinlength=0.60, pinheight = 0.5 );} + +module SC_74(Name="",Value="",Library="") {SOT23_6L(Name=Name,Value=Value,Library=Library);} +module SOT95P270X145_5N(Name="",Value="",Library="") {rotate([0,0,90]) SOT_23_5(Name=Name,Value=Value,Library=Library);} +module WE_TVS_SOT23_3L(Name="",Value="",Library="") {rotate([0,0,180]) SOT_23(Name=Name,Value=Value,Library=Library);} + +module SOT23(Name="",Value="",Library="") {SOT_23(Name=Name,Value=Value,Library=Library);} +module SOT95P240X120_3N(Name="",Value="",Library="") {rotate([0,0,90]) SOT_23(Name=Name,Value=Value,Library=Library);} +module SOT95P237X112_3N(Name="",Value="",Library="") {rotate([0,0,180]) SOT_23(Name=Name,Value=Value,Library=Library);} + +module SOT_23(Name="",Value="",Library="") { + Rotation = (Library == "diode")?[0,0,180]:[0,0,0]; + rotate(Rotation){ + color("DarkSlateGray") cubepart([3,1.5,1]); + rotate([0,0,180]) SMD_PIN(size=[3,1.5,1], pinnumber = 1, pitch=0.9, pinlength=0.60, pinheight = 0.5 ); + rotate([0,0,180]) SMD_PIN(size=[3,1.5,1], pinnumber = 3, pitch=0.9, pinlength=0.60, pinheight = 0.5 ); + SMD_PIN(size=[3,1.5,1], pinnumber = 2, pitch=0.9, pinlength=0.60, pinheight = 0.5 ); + } +} + +module SOT_363(Name="",Value="",Library="") { SMD_IC(size = [2.2,1.35,1],pinrows=2, pinheight = 0.40, pinlength = 0.4, pinwidth = 0.3, pitch=0.65); } + +module SOT353(Name="",Value="",Library="") +{ + dim = [2,1.25,1]; + rotate([0,0,180]){ + color("DarkSlateGray") cubepart(dim); + rotate([0,0,180]) SMD_PIN(size=dim, pinnumber = 1, pitch=0.65, pinlength=0.425, pinheight = 0.4 ); + rotate([0,0,180]) SMD_PIN(size=dim, pinnumber = 2, pitch=0.65, pinlength=0.425, pinheight = 0.4 ); + rotate([0,0,180]) SMD_PIN(size=dim, pinnumber = 3, pitch=0.65, pinlength=0.425, pinheight = 0.4 ); + SMD_PIN(size=dim, pinnumber = 1, pitch=0.65, pinlength=0.425, pinheight = 0.4 ); + SMD_PIN(size=dim, pinnumber = 3, pitch=0.65, pinlength=0.425, pinheight = 0.4 ); + } +} + +module SOT143_4(Name="",Value="",Library="") {SMD_IC(size = [3,1.4,1],pinrows=2,pitch=1.72, pinlength = 0.45);} +module SOT223(Name="",Value="",Library="") {if (Library == "MySMD") translate([2.3,3,0]) SOT_223(); else SOT_223();} +module SOT_223(Name="",Value="",Library="") {SMD_IC(size = [6.25,3.45,1.5],pinrows=1,pitch=2); + //color("silver") translate([0,2.5,0]) cubepart([3,2,1]); + rotate([0,0,180]) SMD_PIN(size=[6.25,3.45,1.5], pinnumber = 1, pitch=6, pinlength=2, pinheight = 1 );} +module SOT223R_INFINEON(Name="",Value="",Library="") {SOT_223(Name=Name,Value=Value,Library=Library);} + +module SOD_89(Name="",Value="",Library="") {translate([0,1.3,0]) SOT_89(Name=Name,Value=Value,Library=Library);} +module SOT_89(Name="",Value="",Library="") {translate([0,1,0]) {SMD_IC(size = [4.5,2.5,1.5],pinrows=1,pitch=1.5, pinlength=1, pinheight = 0.4 ,pinwidth = 0.5, frustum = 10 , Pinsbended = false); + rotate([0,0,180]) SMD_PIN(size=[4.5,2.5,1.5], pinnumber = 1, pitch=4, pinlength=0.6, pinheight = 0.4, bended = false );}} +// Eigentlich SOT-89. SOD-89 ist eine Diode + + +//module SOT_89(Name="",Value="",Library="") {translate([0,1,0]){SMD_IC(size = [4.5,2.5,1.5],pinrows=1,pitch=1.5,pinlength=1, pinwidth = 0.5, frustum=15); color("silver") translate([0,1.5,0]) cubepart([1.6,0.5,0.4]);}} + +module SOD_223_(Name="",Value="",Library="") {SOT_223(Name=Name,Value=Value,Library=Library);} +module OK6(Name="",Value="",Library="") {SMD_IC(size = [3.6,4.4,2.5],pinrows=2,pitch=2.54, pinwidth = 0.4, phase = -1);} +module SO_8(Name="",Value="",Library="") {translate([0.635,0,0]) SO08(Name="",Value="",Library=""); } +module SO8(Name="",Value="",Library="") {if (Library == "linear") translate([0,0.25,0]) SO08(Name="",Value="",Library=""); else if (Library != "analog-devices") translate([0.635,0,0]) SO08(Name="",Value="",Library=""); else SO08(Name="",Value="",Library=""); } +module SOIC08(Name="",Value="",Library="") { SO08(Name="",Value="",Library=""); } +module SOIC8(Name="",Value="",Library="") { SO08(Name="",Value="",Library=""); } +module 8S2(Name="",Value="",Library="") { SMD_IC(size = [5.3,5.3,2],pinrows=2,pinwidth = 0.4, pitch=1.27); } // atmel.lbr +module SOIC8W(Name="",Value="",Library="") { 8S2(Name="",Value="",Library=""); } +module R_PDSO_G8(Name="",Value="",Library="") {SO08(Name=Name,Value=Value,Library=Library);} +module SO08(Name="",Value="",Library="") {SMD_IC(size = [5,4,1.4],pinrows=2,pitch=1.27);} +module HSOIC_8(Name="",Value="",Library="") {SMD_IC(size = [5,4,1.7],pinrows=2,pitch=1.27);} +module SOIC127P600X175_8N(Name="",Value="",Library="") {rotate([0,0,270]){SMD_IC(size = [5,4,1.7],pinrows=2,pitch=1.27);}} +module SOIC127P1030X265_20N(Name="",Value="",Library="") {rotate ([0,0,270]){SMD_IC(size = [13.5,7.5,1.7],pinrows=2,pitch=1.27);}} + +module SO_16(Name="",Value="",Library="") {translate([0.635,0,0]) SMD_IC(size = [10.6,4,1.4],pinrows=2,pitch=1.27);} +module SO_16L(Name="",Value="",Library="") {translate([0.635,0,0]) SMD_IC(size = [11.5,7.6,2.6],pinrows=2,pitch=1.27);} +module SO16L(Name="",Value="",Library=""){translate([-0.635,0.86,0]) SMD_IC(size = [11.5,7.6,2.6],pinrows=2,pitch=1.27);} +module SO14(Name="",Value="",Library="") {SO_14(Name=Name,Value=Value,Library=Library);} +module SO16(Name="",Value="",Library="") { if (Library=="74xx-eu" || Library=="74xxsmd") {translate([-1.27/2,0,0]) SO_16(Name=Name,Value=Value,Library=Library);} else SO_16(Name=Name,Value=Value,Library=Library);} +module SO_14(Name="",Value="",Library="") {translate([0,0,0]) SMD_IC(size = [9.3,4,1.4],pinrows=2,pitch=1.27);} +module SO24L(Name="",Value="",Library="") {translate([-1.27/2,0,0]) SMD_IC(size = [15.6,7.6,2.65],pinrows=2,pitch=1.27, phase = -1);} +module SO_28L(Name="",Value="",Library="") {translate([+1.27/2,0,0]) SMD_IC(size = [18.14,7.6,2.65],pinrows=2,pitch=1.27, phase = -1);} + + +module PDSO6(Name="",Value="",Library="") {SMD_FN(size = [2.1,2.1,0.65],pinrows=2,pitch=0.65);} +module VO20(Name="",Value="",Library="") {SMD_IC([7,4.5,0.7],pinrows=2,pitch=0.65);} +module MSOP8(Name="",Value="",Library="") {SMD_IC([3,2.9,0.7],pinrows=2,pitch=0.7);} +module SSOP8(Name="",Value="",Library="") {SMD_IC([3,3,1],pinrows=2,pitch=0.65, pinlength=0.55,pinheight=0.5);} +module TSSOP8(Name="",Value="",Library="") {SMD_IC([3,2.9,0.7],pinrows=2,pitch=0.65, pinlength=0.55,pinheight=0.5);} +module VSSOP8(Name="",Value="",Library="") {SMD_IC([2,2.4,0.7],pinrows=2,pitch=0.5, pinlength=0.45,pinheight=0.4);} // Prototyp +module SOT_5X3(Name="",Value="",Library="") {SMD_IC([2.2,1.3,0.6],pinrows=2,pitch=0.5, pinlength=0.3,pinheight=0.2,frustum = 10, Pinsbended = false);} +module SSOP20_DBQ(Name="",Value="",Library="") {SMD_IC([7.200,5.000,1.75],pinrows=2,pitch=0.635);} +module SSOP28(Name="",Value="",Library="") { if (Library == "MySMD2") translate([4.23,3.5,0]) SMD_IC([10.200,5.200,2],pinrows=2,pitch=0.65); + else SMD_IC([10.200,5.200,2],pinrows=2,pitch=0.65);} +module SOP50P310X90_8N(Name="",Value="",Library="") {rotate([0,0,270]){SMD_IC([2.2,2.4,0.7],pinrows=2,pitch=0.7);}} +module WSON(Name="",Value="",Library="") {rotate([0,0,270]) SMD_FN(size = [3,2,0.8],pinrows=2,pitch=0.5);} +module SON50P250X250X80_11N(Name="",Value="",Library="") {rotate([0,0,270]) SMD_FN(size = [3,2,0.8],pinrows=2,pitch=0.5);} +module MSOP10(Name="",Value="",Library="") {SMD_IC([3,3,1.1],pinrows=2,pitch=0.5);} +module TSSOP5(Name="",Value="",Library="") {SOT_23(Name="",Value="",Library=""); + SMD_PIN(size=[3,1.5,1], pinnumber = 1, pitch=0.9, pinlength=0.6 ); + SMD_PIN(size=[3,1.5,1], pinnumber = 3, pitch=0.9, pinlength=0.6 );} +module TSSOP14(Name="",Value="",Library="") {SMD_IC([5,4.4,0.6],pinrows=2,pitch=0.65);} +module TSSOP16(Name="",Value="",Library="") {SMD_IC([5.5,4.4,0.6],pinrows=2,pitch=0.65);} +module QSOP16(Name="",Value="",Library="") {translate([0.635/2,0,0]) SMD_IC([5.5,4.4,0.6],pinrows=2,pitch=0.635);} // SSOP +module TSSOP20(Name="",Value="",Library="74xx-eu") {translate([-0.65/2,0,0]) SMD_IC([6.9,4.4,0.6],pinrows=2,pitch=0.65); + } + + +module PQFP44(Name="",Value="",Library="") {rotate([0,0,-90]) SMD_IC(size = [10,10,1.6],pinrows=4,pitch=0.8);} + + +module VQ100(Name="",Value="",Library="") {rotate([0,0,-90]) SMD_IC(size = [14,14,1.2],pinrows=4,pitch=0.5);} +module VQ44(Name="",Value="",Library="") {SMD_IC(size = [10,10,1.2],pinrows=4,pitch=0.8);} +module LQFP64(Name="",Value="",Library="") {rotate([0,0,-90]) SMD_IC(size = [10,10,1.4],pinrows=4,pitch=0.5,phase=1);} +module TQFP64(Name="",Value="",Library="") {LQFP64(Name=Name,Value=Value,Library=Library);} +module LQFP100(Name="",Value="",Library="") {rotate([0,0,-90]) SMD_IC(size = [13.8,13.8,1.4],pinrows=4,pitch=0.5);} +module TQ144(Name="",Value="",Library="") {rotate([0,0,-90]) SMD_IC(size = [20,20,1.4],pinrows=4,pitch=0.5);} +module PQ208(Name="",Value="",Library="") {rotate([0,0,-90]) SMD_IC(size = [28.9,28.9,2.4],pinrows=4,pitch=0.5);} +module QFP_80(Name="",Value="",Library="") {rotate([0,0,-90]) SMD_IC(size = [14.2,14.2,2],pinrows=4,pitch=0.65);} +module QFN28(Name="",Value="",Library="") {SMD_FN(size = [5,5,0.8],pinrows=4,pitch=0.5, phase=1);} +module QFN_138(Name="",Value="",Library="") {SMD_FN(size = [12,12,0.8],pinrows=0,pitch=0.5, phase=1);} + +module QFN32(Name="",Value="",Library="") {if (Library == "atmel") rotate([0,0,-90]) SMD_IC(size = [5,5,1]); else SMD_IC(size = [5,5,1]);} +module TQFN32(Name="",Value="",Library="") {SMD_IC(size = [5,5,1]);} +module TQFN24(Name="",Value="",Library="") {SMD_FN(size = [4,4,0.8],pinrows=4,pitch=0.5, phase = 0.5 );} +module PVQFN48(Name="",Value="",Library="") {rotate([0,0,-90]) SMD_FN(size = [6.9,6.9,1],pinrows=4,pitch=0.5);} +module ESP32_PICO_D4_1 (Name="",Value="",Library="") {rotate([0,0,-90]) SMD_FN(size = [6.9,6.9,1],pinrows=4,pitch=0.5);} + +module 21_0139I_T2444_4(Name="",Value="",Library="") {rotate([0,0,270]) TQFN24(Name=Name,Value=Value,Library=Library);} // MAXIM +module QFN24(Name="",Value="",Library="") {rotate([0,0,-90]) SMD_FN(size = [4,4,1],pinrows=4,pitch=0.5,phase = 0.4);} +module QFN65P500X500X80_21N(Name="",Value="",Library="") {rotate([0,0,-90]) SMD_FN(size = [5,5,1],pinrows=4,pitch=0.7,phase = 1);} +module DFN14(Name="",Value="",Library="") {SMD_FN(size = [4,3,0.8],pinrows=2,pitch=0.5);} +module QFN_172(Name="",Value="",Library="") {rotate([0,0,90]) SMD_FN(size = [13,13,0.9],pinrows=4,pitch=0.5, phase = 0.7);} +module VFQFPN36(Name="",Value="",Library="") {SMD_FN(size = [6,6,0.9],pinrows=4,pitch=0.5);} +module DFN_3030_10(Name="",Value="",Library="") {SMD_FN(size = [3,3,0.75],pinrows=2,pitch=0.5);} +module DFN6(Name="",Value="",Library="HAutomation_6") {difference() {SMD_FN(size = [3,3,0.9],pinrows=2,pitch=1); translate([0.7,0,0.5]) cubepart([0.7,2.0,1]);}} +module DFN8_3X3(Name="",Value="",Library="") {SMD_FN(size = [3,3,0.9],pinrows=2,pitch=0.65);} +module DD10_3X3(Name="",Value="",Library="") {SMD_FN(size = [3,3,0.9],pinrows=2,pitch=0.5);} +module QFN38_5X7(Name="",Value="",Library="") {rotate([0,0,-90]) SMD_FN(size = [7,5,0.75],pinrows=4,pitch=0.5,phase = 0.2);} +module QFN28_ML_6X6MM(Name="",Value="",Library="") {rotate([0,0,-90]) SMD_FN(size = [5.9,5.9,0.75],pinrows=4,pitch=0.65,phase = 0.5);} + +module 2L10_SU72(Name="",Value="",Library="") {rotate([0,0,-90]) SMD_FN(size = [20.32,20.32,1.83],pinrows=2,pitch=2.54);} + +module VSONP_8(Name="",Value="",Library="") { rotate([0,0,-90]) SMD_FN(size = [3.22,3,0.9],pinrows=2,pitch=0.65);} + +module MLF32(Name="",Value="",Library="") { rotate([0,0,-90]) SMD_FN(size = [5,5,0.9],pinrows=4,pitch=0.5,phase = 0.6);} + +module POWERSO2(Name="",Value="",Library=""){translate([0,1.7,0]) SMD_IC([15.8,11.5,2.8],pinrows=2,pitch=1.27);} + +module MB2S(Name="",Value="",Library=""){SMD_IC([5.5,4,2.8],pinrows=2,pitch=2.54,phase = 1);} + +module TO220_2S(Name="",Value="",Library="") {rotate([0,0,180]) TO220_PARAM(n=2);} +module TO220(Name="",Value="",Library="") {translate([0,-3.54,0]) rotate([0,0,180]) TO220_PARAM(n=3);} +module 78XXL(Name="",Value="",Library="") {translate([0,-1,0]) rotate([0,0,180]) TO220_PARAM(n=3);} +module TO220BH(Name="",Value="",Library="") {translate([0,-6.35,0]) rotate([0,0,180]) TO220L_PARAM(n=3);} + +module 78LXX(Name="",Value="",Library="") {TO92(Name=Name,Value=Value,Library=Library);} +module TO92(Name="",Value="",Library="") {translate([0,0,4]) color("DarkSlateGray") intersection(Name="",Value="",Library="") { + cylinder (h = 4.6, r=4.6/2, center = true, $fn=Detailgrad); + rotate([90,0,0]) translate([0,0,-3]) linear_extrude(4, scale=0.9) square(4.6, center = true);} + translate([-1.28,0,3.6]) LOETPIN(dim = 0.4, displacement=0.3); + translate([1.28,0,3.6]) LOETPIN(dim = 0.4, displacement=-0.3); + translate([0,1.90,3.6]) rotate([0,0,90]) LOETPIN(dim = 0.4, displacement=-0.8); +} + +module E2LINE(Name="",Value="",Library="") {translate([0,0,2]) rotate([0,0,90])ELINE_THT(2);} +module E3LINE(Name="",Value="",Library="") {translate([0,0,3]) ELINE_THT(3);} +module ELINE_THT(N = 3) +{ + r=1; + num = round(Detailgrad/4); + size = [2.2,0.4,4.2]; + function bogen(point=[0,0],aPhase = 0) = [for (i=[0:num], x=i*90/num) [point[0]+r*sin(x+aPhase),point[1]+r*cos(x+aPhase)]]; + function poli_round() = concat(bogen([0,0],180),[[0-r,size[1]+r]],[[size[0]+r,size[1]+r]],bogen([size[0],0],90)); + if (N==2) + { + color("DarkSlateGray") translate([-size[0]/2,-size[1]/2,0]) linear_extrude(size[2]) polygon(poli_round()); + translate([-1.27,0,0]) LOETPIN(dim = 0.4); + translate([1.27,0,0]) LOETPIN(dim = 0.4); + } + else + rotate([0,0,45]){ + color("DarkSlateGray") translate([-size[0]/2,-size[1]/2,0]) linear_extrude(size[2]) polygon(poli_round()); + translate([0,0,1.2]) LOETPIN(dim = 0.4); + translate([1.27,1.27,1.2]) rotate([0,0,90]) LOETPIN(dim = 0.4, displacement=-1.27); + translate([-1.27,-1.27,1.2]) rotate([0,0,-90]) LOETPIN(dim = 0.4, displacement=-1.27); + } + +} + +// IR-Empfänger +module TSOP38(Name="",Value="",Library="") { translate([0,0,3]) color("DarkSlateGray") { cubepart([5,2.8,6.95]); translate([0,-1,4]) sphere(2); translate([0,-1,0]) cylinder(4,2,2);} } + +module EE_SX1131(Name="",Value="",Library="") { + SMD_FN(size = [4,5,1.2],pinrows=2,pitch=1.4); + difference() + { + color("DarkSlateGray") translate([0,1.75,0]) cubepart(size = [4,1.5,4]); + color("DarkSlateGray") translate([0.55,1.725,2.5]) cubepart(size = [0.3,1.6,1]); + color("DarkSlateGray") translate([-0.55,1.725,2.5]) cubepart(size = [0.3,1.6,1]); + } + difference() + { + color("DarkSlateGray") translate([0,-1.75,0]) cubepart(size = [4,1.5,4]); + color("DarkSlateGray") translate([-0.55,-1.725,2.5]) cubepart(size = [0.3,1.6,1]); + color("DarkSlateGray") translate([0.55,-1.725,2.5]) cubepart(size = [0.3,1.6,1]); + } +} + +module ESP_12(Name="",Value="",Library=""){ // Eagle Adafruit + board_thicknessA = 1.000000; + eta = 0.2; + rotate([0,0,90]) translate([-12.065+1,-8.09625,0]) union(){ // PCB whith parts and text + color("DarkSlateGray")linear_extrude(height=board_thicknessA,center=false, convexity=10) + polygon(points = [[0,16.192500],[24.13,16.1925],[24.13,0],[0,0]]); //Board + + color("Goldenrod",0.7) translate([0,0,board_thicknessA-0.017]) linear_extrude(height=0.035,center=false, convexity=10) difference() { + union() { + translate([17.463,3.004]) rotate([0,0,270.000]) square([1.092,1.397], center = true); //LED0805 A + translate([17.463,1.124]) rotate([0,0,270.000]) square([1.092,1.397], center = true); //LED0805 K + translate([1.558,1.318])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([3.558,1.318])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([5.558,1.318])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([7.558,1.318])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([9.558,1.318])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([11.558,1.318])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([13.558,1.318])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([15.558,1.318])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([15.558,14.953])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([13.558,14.953])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([11.558,14.953])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([9.558,14.953])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([7.558,14.953])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([5.558,14.953])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([3.558,14.953])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + translate([1.558,14.953])square([1.270,2.540], center = true); //SMD1,27-2,54 1 + EagleWire([18.891,0.635],[23.336,0.635],width=0.610,$fn=8); + EagleWire([23.336,0.635],[23.336,3.334],width=0.610,$fn=8); + EagleWire([23.336,3.334],[20.320,3.334],width=0.610,$fn=8); + EagleWire([20.320,3.334],[20.320,6.033],width=0.610,$fn=8); + EagleWire([20.320,6.033],[23.336,6.033],width=0.610,$fn=8); + EagleWire([23.336,6.033],[23.336,8.731],width=0.610,$fn=8); + EagleWire([23.336,8.731],[20.320,8.731],width=0.610,$fn=8); + EagleWire([20.320,8.731],[20.320,11.430],width=0.610,$fn=8); + EagleWire([20.320,11.430],[23.336,11.430],width=0.610,$fn=8); + EagleWire([23.336,11.430],[23.336,13.494],width=0.610,$fn=8); + EagleWire([23.336,13.494],[23.336,15.558],width=0.610,$fn=8); + EagleWire([23.336,15.558],[18.574,15.558],width=0.610,$fn=8); + EagleWire([23.336,13.494],[18.574,13.494],width=0.610,$fn=8); + translate([1.510,15.000]) circle(r=0.453,$fn=fn); + translate([3.510,15.000]) circle(r=0.453,$fn=fn); + translate([5.510,15.000]) circle(r=0.453,$fn=fn); + translate([7.510,15.000]) circle(r=0.453,$fn=fn); + translate([9.510,15.000]) circle(r=0.453,$fn=fn); + translate([11.510,15.000]) circle(r=0.453,$fn=fn); + translate([13.510,15.000]) circle(r=0.453,$fn=fn); + translate([15.510,15.000]) circle(r=0.453,$fn=fn); + translate([1.525,1.143]) circle(r=0.453,$fn=fn); + translate([3.525,1.143]) circle(r=0.453,$fn=fn); + translate([5.525,1.143]) circle(r=0.453,$fn=fn); + translate([7.525,1.143]) circle(r=0.453,$fn=fn); + translate([9.525,1.143]) circle(r=0.453,$fn=fn); + translate([11.525,1.143]) circle(r=0.453,$fn=fn); + translate([13.525,1.143]) circle(r=0.453,$fn=fn); + translate([15.525,1.143]) circle(r=0.453,$fn=fn); + } + + } +color("Goldenrod",0.7) translate([0,0,-0.017]) linear_extrude(height=0.035,center=false, convexity=10) difference() { + union() { + translate([1.510,15.000]) circle(r=0.453,$fn=fn); + translate([3.510,15.000]) circle(r=0.453,$fn=fn); + translate([5.510,15.000]) circle(r=0.453,$fn=fn); + translate([7.510,15.000]) circle(r=0.453,$fn=fn); + translate([9.510,15.000]) circle(r=0.453,$fn=fn); + translate([11.510,15.000]) circle(r=0.453,$fn=fn); + translate([13.510,15.000]) circle(r=0.453,$fn=fn); + translate([15.510,15.000]) circle(r=0.453,$fn=fn); + translate([1.525,1.143]) circle(r=0.453,$fn=fn); + translate([3.525,1.143]) circle(r=0.453,$fn=fn); + translate([5.525,1.143]) circle(r=0.453,$fn=fn); + translate([7.525,1.143]) circle(r=0.453,$fn=fn); + translate([9.525,1.143]) circle(r=0.453,$fn=fn); + translate([11.525,1.143]) circle(r=0.453,$fn=fn); + translate([13.525,1.143]) circle(r=0.453,$fn=fn); + translate([15.525,1.143]) circle(r=0.453,$fn=fn); + } + } + union(){ // parts + translate([8.731,8.096,board_thicknessA])rotate([0,0,90])SHIELD12X15(); //CA1 SHIELD12X15 + translate([17.463,2.064,board_thicknessA])rotate([0,0,270])LED0805(); //LED1 LED0805 + } + } //endunion() + module SHIELD12X15() //CA1 SHIELD12X15 + { + rotate([0,0,270]) + { + color ("silver") + linear_extrude(2.3) translate([-7.500000,-6.000000,0]) square([ 15.000000,12.000000]); //Board + + + } + } + module LED0805(Enable = false) + { + rotate([0,0,90]) + { + color("gray") translate([0,0,0.125/2]) cube([1.2,2,0.125], center = true); + if (!Enable) + { + color("green") linear_extrude(0.65,scale = 0.9) square([1.2,1.8],center = true); + } + else + { + color("lightgreen") linear_extrude(0.65,scale = 0.9) square([1.2,1.8],center = true); + } + } + } +} // end ESP12 + + +module FSMD(Name="",Value="",Library="") { + + difference() + { + union() + { + color("DarkSlateGray") cubepart(size = [12,5.2,6]); + color("silver") cubepart(size = [11,2.2,6.1]); + } + color("DarkSlateGray") union() + { + translate([0,0,1]) cubepart(size = [9,4,6]); + translate([0,0,2]) cubepart(size = [3,6,6]); + } + } + color("Beige") cubepart(size = [8,3.5,5]); +} +module FSMD185(Name="",Value="",Library="") {color("silver") cubepart(size = [9.5,6.71,3]);} + +//Microfone +module ELECTRET_9_7(Name="",Value="",Library="") +{ + color("silver") translate([0,0,0.4]) cylinder(4.5,9.7/2,9.7/2); + color("DarkSlateGray") cylinder(5.2,7.6/2,7.6/2); + translate([-1.25,2,0.0]) make_line_of(2.5, 2) LOETPIN(height = 2, dim=0.4); +} + +// IR EMpfänger +// CHQ1838, VS1838B, TL1838 +module VS1838B_H(Name="",Value="",Library="") +{ + color("silver") translate([-14.097,-3.556,0]) cube([7.747,7.112, 3.6]); + translate([-14.097+7.7,0,5.2-2.3]) rotate([0,-90,0]) + union() + { + color("silver") cylinder(2,4.6/2,4.6/2); + translate([0,0,2]) color("DarkSlateGray") cylinder(4.6/2,4.6/2,4.6/2); + translate([0,0,2+4.6/2]) color("DarkSlateGray") sphere(4.6/2); + } +} +//Display +//OLED +module UG_2832HSWEG02_WRAPUNDER(Name="",Value="",Library="") //LCD1 +{ +color("DarkSlateGray") linear_extrude(1.45) translate([-30,-11.5/2,0]) square([30,11.5]); //Crystal +color("Black") translate([-30.000000+2.1,-2.1,0.01]) linear_extrude(1.45) square([22.384,5.584]); //FOV +color("White") +{ translate([-30.000000+2.1+0.1,-2.1+4.2,0.02]) linear_extrude(1.45) text("UG-2832HSWEG02",size = 1.2); + translate([-30.000000+2.1+0.1,-2.1+1.6,0.02]) linear_extrude(1.45) text("128x32 dot",size = 1.2); + translate([-30.000000+2.1+0.1,-2.1+0.1,0.02]) linear_extrude(1.45) text("21x4 char",size = 1.2); + + } +} + +module TEST_POINT_1MM(Name="",Value="",Library="") +{ + function bogen(point=[0,0], r = 1 ,phase = 0, winkel = 90, $fn=$fn) = [let(num=abs($fn*winkel/360)) for (i=[0:num], x=i*winkel/num) [point[0]+r*cos(x+phase),point[1]+r*sin(x+phase)]]; + function winkel(a,b=[0,0]) = atan2(a[1]-b[1],a[0]-b[0]); + + if (Detailgrad > 15) + { + LOETPIN(height = 4); + color("silver") rotate([0,270,90]) translate([0,0,-0.4]) linear_extrude(0.8) + { + + difference() + { + polygon(concat(bogen(point=[1,0], r=2.3/2 ,phase = winkel([1,0],[4.5,0])-90, winkel = 180, $fn=Detailgrad), bogen( point=[4.5,0], r=2.3/2 ,phase = winkel([4.5,0],[1,0])-90, winkel = 180, $fn=Detailgrad))); + + polygon(concat(bogen(point=[1,0], r=1.8/2 ,phase = winkel([1,0],[4.5,0])-90, winkel = 180, $fn=Detailgrad), bogen( point=[4.5,0], r=1.8/2 ,phase = winkel([4.5,0],[1,0])-90, winkel = 180, $fn=Detailgrad))); + }; + + // hull(Name="",Value="",Library="") { translate([1,0]) circle(2.3/2, $fn=Detailgrad); translate([4.5,0]) circle(2.3/2, $fn=Detailgrad); } + // hull(Name="",Value="",Library="") { translate([1,0]) circle(1.8/2, $fn=Detailgrad); translate([4.5,0]) circle(1.8/2, $fn=Detailgrad); } + + } + } + else + { + color("silver") cubepart([2,1,5.5]); + } +} + +// Lichtschranke +module KRA011(Name="",Value="",Library="") //LS1 +{ + + difference() + { + color("DarkSlateGray") cubepart(size = [5,4.2,5.2]); + color("DarkSlateGray") translate([-1,-2.5,2.4]) cube([2,5,2.81]); + color("white") translate([-1.05,-0.2,5.2-0.6-0.8]) cube([2.1,0.4,1.2]); + color("DarkSlateGray") translate([-3,0,7.3-0.5]) rotate([-45,0,0]) cube([6,5,3]); + } + + translate([-2,1.25,0]) make_line_of(4, 2) LOETPIN(height = 5, dim = 0.5);translate([-2,-1.25,0])make_line_of(4, 2) LOETPIN(height = 5, dim = 0.5); + + +} + + + +module DIL08S(Name="",Value="",Library="") +{color("silver") translate([0,0,0.5]) {cubepart(size = [12.8,12.8,0.8]);cubepart(size = [12.1,12.1,5.08],r = 1.5); translate([-3.81,3.81,0]) make_line_of(7.62, 2) LOETPIN(height = 6.35);translate([-3.81,-3.81,0])make_line_of(7.62, 2) LOETPIN(height = 6.35);}} + +module Q_5X3(Name="",Value="",Library="") {color("silver") cubepart(size = [5.15,3.35,1]);} + +module InvisiblePart() +{ + rotate([0,0,0]) ; +} +module SCHRIFTF(Name="",Value="",Library="") {InvisiblePart();} // Ausblenden +module SCHRIFTA(Name="",Value="",Library="") {InvisiblePart();} // Ausblenden +module SCHRI_A5(Name="",Value="",Library="") {InvisiblePart();} // Ausblenden +module SCHRI_A6(Name="",Value="",Library="") {InvisiblePart();} // Ausblenden +module A5_LOC2(Name="",Value="",Library="") {InvisiblePart();} // Ausblenden +module A6_LOC2(Name="",Value="",Library="") {InvisiblePart();} // Ausblenden +module A4_LOC2(Name="",Value="",Library="") {InvisiblePart();} // Ausblenden +module FIDUCIAL_1MM(Name="",Value="",Library="") {InvisiblePart();} // Ausblenden +module 3_2(Name="",Value="",Library="") {InvisiblePart();} // Ausblenden +module B2_54(Name="",Value="",Library="") {InvisiblePart();} // Ausblenden +module VG32(Name="",Value="",Library="") {InvisiblePart();} // Ausblenden + +module __D(Name="",Value="",Library="") {InvisiblePart();} // Ausblenden +module LOGO(Name="",Value="",Library="") {InvisiblePart();} +module LOGO2(Name="",Value="",Library="") {InvisiblePart();} +module LOGOSS40(Name="",Value="",Library="") {scale(40/35)LOGOSS35(Name=Name,Value=Value,Library=Library);} +module LOGOSS50(Name="",Value="",Library="") {scale(50/35)LOGOSS35(Name=Name,Value=Value,Library=Library);} +module LOGOSS60(Name="",Value="",Library="") {scale(60/35)LOGOSS35(Name=Name,Value=Value,Library=Library);} +module LOGOSS35(Name="",Value="",Library="") { + if (Detailgrad > 15) + { + translate([-1.257,-2.5278]) color("Goldenrod") linear_extrude(0.05) union() + { + translate([1.257,3.569]) polygon([[0.381,1.562],[0.381,0.940],[0.927,0.940],[0.927,1.562],[1.295,1.562],[1.295,0.000],[0.927,0.000],[0.927,0.635],[0.381,0.635],[0.381,0.000],[0.000,0.000],[0.000,1.562]]); + + translate([2.743,2.527]) polygon([[0.660,2.603],[1.041,2.603],[2.083,0.000],[1.702,0.000],[1.156,1.397],[0.533,1.397],[0.394,1.041],[0.000,1.041],[0.839,2.197],[1.042,1.702],[0.648,1.702]],[[0,1,2,3,4,5,6,7],[8,9,10]]); + + translate([3.035,4.940]) polygon([[0.229,0.191],[0.229,0.000],[0.000,0.000],[0.000,0.191]]); + + translate([3.924,4.940]) polygon([[0.229,0.191],[0.229,0.000],[0.000,0.000],[0.000,0.191]]); + + translate([4.420,3.569]) polygon([[1.295,1.562],[0.762,1.562],[0.597,1.549],[0.432,1.524],[0.292,1.461],[0.191,1.372],[0.102,1.257],[0.038,1.118],[0.000,0.940],[0.000,0.699],[0.013,0.508],[0.076,0.330],[0.152,0.203],[0.292,0.089],[0.419,0.025],[0.572,0.000],[1.295,0.000],[1.295,0.279],[0.724,0.279],[0.572,0.305],[0.495,0.356],[0.432,0.457],[0.394,0.584],[0.381,0.711],[0.394,0.864],[0.419,1.016],[0.470,1.130],[0.521,1.194],[0.584,1.232],[0.699,1.270],[0.775,1.283],[1.295,1.283]]); + + translate([5.918,3.569]) polygon([[0.368,0.000],[0.368,0.711],[0.914,0.000],[1.384,0.000],[0.762,0.787],[1.397,1.562],[0.940,1.562],[0.368,0.851],[0.368,1.562],[0.000,1.562],[0.000,0.000]]); + + translate([7.277,3.569]) polygon([[1.308,1.562],[0.673,1.562],[0.508,1.537],[0.343,1.486],[0.229,1.410],[0.140,1.308],[0.076,1.194],[0.025,1.029],[0.000,0.826],[0.000,0.648],[0.038,0.432],[0.102,0.279],[0.216,0.152],[0.330,0.064],[0.483,0.013],[0.584,0.000],[1.308,0.000],[1.308,0.279],[0.749,0.279],[0.597,0.305],[0.508,0.356],[0.457,0.419],[0.419,0.508],[0.419,0.635],[1.308,0.635],[1.308,0.940],[0.406,0.940],[0.419,1.041],[0.457,1.118],[0.521,1.194],[0.610,1.245],[0.686,1.257],[1.308,1.257]]); + + translate([8.827,3.569]) polygon([[0.000,1.562],[0.902,1.562],[1.041,1.549],[1.156,1.511],[1.257,1.435],[1.334,1.334],[1.372,1.232],[1.384,1.143],[1.384,1.054],[1.372,0.940],[1.321,0.813],[1.270,0.749],[1.207,0.699],[1.118,0.648],[1.092,0.635],[1.461,0.000],[1.054,0.000],[0.711,0.584],[0.368,0.584],[0.368,0.000],[0.000,0.000],[0.368,1.257],[0.787,1.257],[0.914,1.232],[0.965,1.207],[1.003,1.168],[1.016,1.118],[1.016,1.054],[1.003,0.991],[0.978,0.953],[0.940,0.927],[0.826,0.889],[0.368,0.889]],[[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],[21,22,23,24,25,26,27,28,29,30,31,32]]); + + make_line_of(0.2286,8) translate([1.257,2.985]) polygon([[0.140,0.140],[0.140,0.000],[0.000,0.000],[0.000,0.140]]); + + make_line_of(0.2286,6) translate([1.257,2.985-0.2286]) polygon([[0.140,0.140],[0.140,0.000],[0.000,0.000],[0.000,0.140]]); + + make_line_of(0.2286,6) translate([1.257,2.5278]) polygon([[0.140,0.140],[0.140,0.000],[0.000,0.000],[0.000,0.140]]); + + translate([4.839,2.527]) polygon([[0.000,0.165],[0.025,0.102],[0.089,0.038],[0.152,0.013],[0.229,0.000],[0.546,0.000],[0.572,0.025],[0.572,0.610],[0.381,0.610],[0.381,0.165],[0.229,0.165],[0.203,0.191],[0.203,0.610],[0.000,0.610]]); + + translate([5.448,2.527]) polygon([[0.305,0.826],[0.305,0.610],[0.470,0.610],[0.470,0.470],[0.305,0.470],[0.305,0.216],[0.318,0.178],[0.330,0.165],[0.356,0.152],[0.470,0.152],[0.470,0.025],[0.445,0.000],[0.279,0.000],[0.216,0.013],[0.165,0.051],[0.127,0.102],[0.114,0.152],[0.114,0.470],[0.000,0.470],[0.000,0.610],[0.114,0.610],[0.114,0.826]]); + + // o + translate([5.918,2.527]) polygon([[0.394,0.622],[0.483,0.597],[0.546,0.559],[0.610,0.495],[0.648,0.419],[0.660,0.343],[0.660,0.254],[0.648,0.191],[0.622,0.140],[0.584,0.089],[0.521,0.038],[0.445,0.013],[0.356,0.000],[0.279,0.000],[0.203,0.013],[0.127,0.051],[0.076,0.102],[0.025,0.178],[0.000,0.267],[0.000,0.356],[0.025,0.432],[0.064,0.495],[0.114,0.546],[0.178,0.597],[0.267,0.622],[0.292,0.152],[0.267,0.165],[0.229,0.203],[0.203,0.267],[0.203,0.343],[0.229,0.406],[0.254,0.445],[0.305,0.470],[0.368,0.470],[0.406,0.445],[0.432,0.419],[0.457,0.356],[0.457,0.267],[0.432,0.203],[0.394,0.165],[0.356,0.152]],[[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24],[25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40]]); + + translate([6.629,2.527]) polygon([[0.000,0.610],[0.711,0.610],[0.787,0.584],[0.838,0.533],[0.864,0.483],[0.876,0.419],[0.876,0.038],[0.838,0.000],[0.673,0.000],[0.673,0.419],[0.660,0.445],[0.635,0.457],[0.533,0.457],[0.533,0.025],[0.508,0.000],[0.356,0.000],[0.330,0.025],[0.330,0.457],[0.203,0.457],[0.203,0.025],[0.178,0.000],[0.000,0.000]]); + + // a + translate([7.569,2.527]) polygon([[0.470,0.610],[0.546,0.572],[0.597,0.521],[0.622,0.457],[0.635,0.406],[0.635,0.038],[0.597,0.000],[0.165,0.000],[0.089,0.025],[0.038,0.064],[0.000,0.127],[0.000,0.241],[0.025,0.305],[0.064,0.343],[0.114,0.368],[0.165,0.381],[0.419,0.381],[0.419,0.419],[0.406,0.445],[0.381,0.457],[0.038,0.457],[0.038,0.610],[0.229,0.152],[0.419,0.152],[0.419,0.241],[0.229,0.241],[0.203,0.229],[0.191,0.191],[0.203,0.165]],[[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21],[22,23,24,25,26,27,28]]); + + translate([8.2423,2.527]) polygon([[0.305,0.826],[0.305,0.610],[0.470,0.610],[0.470,0.470],[0.305,0.470],[0.305,0.216],[0.318,0.178],[0.330,0.165],[0.356,0.152],[0.470,0.152],[0.470,0.025],[0.445,0.000],[0.279,0.000],[0.216,0.013],[0.165,0.051],[0.127,0.102],[0.114,0.152],[0.114,0.470],[0.000,0.470],[0.000,0.610],[0.114,0.610],[0.114,0.826]]); + + // o + translate([8.992,2.527]) polygon([[0.394,0.622],[0.483,0.597],[0.546,0.559],[0.610,0.495],[0.648,0.419],[0.660,0.343],[0.660,0.254],[0.648,0.191],[0.622,0.140],[0.584,0.089],[0.521,0.038],[0.445,0.013],[0.356,0.000],[0.279,0.000],[0.203,0.013],[0.127,0.051],[0.076,0.102],[0.025,0.178],[0.000,0.267],[0.000,0.356],[0.025,0.432],[0.064,0.495],[0.114,0.546],[0.178,0.597],[0.267,0.622],[0.292,0.152],[0.267,0.165],[0.229,0.203],[0.203,0.267],[0.203,0.343],[0.229,0.406],[0.254,0.445],[0.305,0.470],[0.368,0.470],[0.406,0.445],[0.432,0.419],[0.457,0.356],[0.457,0.267],[0.432,0.203],[0.394,0.165],[0.356,0.152]],[[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24],[25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40]]); + + translate([8.750,3.188]) polygon([[0.000,0.000],[0.203,0.000],[0.203,0.165],[0.000,0.165]]); + + translate([8.750,2.527]) polygon([[0.000,0.000],[0.203,0.000],[0.203,0.610],[0.000,0.610]]); + + translate([9.716,2.527]) polygon([[0.000,0.610],[0.406,0.610],[0.495,0.572],[0.533,0.521],[0.559,0.470],[0.559,0.000],[0.368,0.000],[0.368,0.419],[0.343,0.445],[0.318,0.457],[0.191,0.457],[0.191,0.000],[0.000,0.000]]); + } + } + else + { + InvisiblePart(); + } +} + + +// linear_extrude(0.3) text("Häcker", size = 2);} +module ZERO_SMALL(Name="",Value="",Library="") {InvisiblePart();} // Ausblenden +module CON14S_2MM(Name="",Value="",Library="") {InvisiblePart();} // Ausblenden SmarAct Connector 2mm + + +module SJ(Name="",Value="",Library="") { + color("#DFDDE0") + { + translate([1.524/2,0,0]) cube([1.168,1.600,0.2], center = true); + translate([-1.524/2,0,0]) cube([1.168,1.600,0.2], center = true); + } +} +module SJ2(Name="",Value="",Library="") { + color("#DFDDE0") + { + cube([1.168,1.600,0.2], center = true); + translate([1.524,0,0]) cube([1.168,1.600,0.2], center = true); + translate([-1.524,0,0]) cube([1.168,1.600,0.2], center = true); + } +} +module SJ_2(Name="",Value="",Library="") {SJ2(Name=Name,Value=Value,Library=Library);} + + //SMD_IC([7,4.5,0.7],pinrows=2,pitch=0.7); + +module DIODE(size = [1,1,1], pinlength=0.2) +{ + translate([-size[0]/2,-size[1]/2,0]) + union() + { + color("DarkSlateGray") translate([size[0]/4,0,0]) cube([size[0]*3/4,size[1], size[2]]); + color("white") translate([size[0]/8,0,0]) cube([size[0]*1/8,size[1], size[2]]); + color("DarkSlateGray") cube([size[0]/8,size[1], size[2]]); + } + color("LightGrey") translate([-pinlength-size[0]/2,-size[0]/6,0]) cube([size[0]+2*pinlength,size[0]/3,0.3]); +} + +module TANTAL(size = [1,1,1]) +{ + translate([-size[0]/2,-size[1]/2,0]) + union() + { + color("Yellow") translate([size[0]/4,0,0]) cube([size[0]*3/4,size[1], size[2]]); + color("DarkOrange") cube([size[0]/4,size[1], size[2]]); + if (Detailgrad > 9) + {color("Silver") translate([-0.1,size[1]/6,0]) cube([size[0]+0.2,2*size[1]/3, size[2]/2]);} + } +} + +module DROSSEL(size = [1,1,1]) +{ + Offs=size[0]*0.3; + translate([(-size[0]+Offs)/2,(-size[1]+Offs)/2,0]) + color("DarkGray") linear_extrude(size[2]) offset_square(size = [size[0]-Offs,size[1]-Offs], r = Offs/2, $fn = Detailgrad); + if (Detailgrad > 15) // hier krachts immer bei FreeCAD (Plazierung) + color("LightGrey") translate([0-0.2-size[0]/2,0-size[0]/6,0]) cube([size[0]+2*0.2,size[0]/3,0.3]); +} + +module Ringkern(Da=29, Di=19, H=7.5, Color = "DarkGray") +{ + roundness = Di/12; + if (Detailgrad > 15) + color(Color) { + linear_extrude(H) difference() + { + circle(Da/2-roundness); + circle(Di/2+roundness); + } + translate([0,0,roundness]) linear_extrude(H-2*roundness) difference() + { + circle(Da/2); + circle(Di/2); + } + + rotate_extrude(convexity = 10) translate([Da/2-roundness, roundness, 0]) circle(r = roundness); + rotate_extrude(convexity = 10) translate([Da/2-roundness, H-roundness, ]) circle(r = roundness); + rotate_extrude(convexity = 10) translate([Di/2+roundness, roundness, 0]) circle(r = roundness); + rotate_extrude(convexity = 10) translate([Di/2+roundness, H-roundness, ]) circle(r = roundness); + } + else + { + color(Color)linear_extrude(H) difference() + { + circle(Da/2); + circle(Di/2); + } + } +} + + +module D_SENS(Name="",Value="",Library="") { + translate([0,8.89/2-1.778,8]) + { + color("DarkSlateGray") cubepart([12.7,8.89, 7.874]); + + color("Silver") translate([-3*1.27,1.778-8.89/2, -15.24]) make_line_of(2.54, 4) cylinder(15.24,0.6/2,0.6/2); + + color("DarkSlateGray") translate([0,8.89/2,7.874/2 ]) rotate([-90,00,0]) + { + Phased_cylinder(12.954,5.08/2,5.08/2, Roundness=1); + cylinder(5,6/2,6/2); + } + } + +} + +module SMD_PINS(size = [1,1,1],pinrows=0, pitch=1, pinlength=0, pinheight = 0, pinwidth = 0, phase = 0 , bended = true) +{ + pinlength = pinlength ? pinlength : sqrt(pitch) ; + pinheight = pinheight ? pinheight : sqrt(pitch/2) ; + pinwidth = pinwidth ? pinwidth : pitch/2; + pincount0 = round((size[0]-phase)*0.9 / pitch); + pincount1 = round((size[1]-phase)*0.9 / pitch); + + if (Detailgrad > 9) + { + dotpos0 = size[0] > size[1] ? size[1]*0.25 : size[0]*0.25; + dotpos = dotpos0 > 1.5 ? 1.5 : dotpos0; + translate([-size[0]/2+dotpos,-size[1]/2+dotpos,size[2]]) color("white") cylinder(0.02, dotpos/2, dotpos/2, $fn=Detailgrad); + + if (pinrows) + { + { + translate([pitch/2-pinwidth/2-(pincount0*pitch)/2,-pinlength-size[1]/2,0]) color("silver") make_line_of(pitch, pincount0) SMD_PIN_DETAIL([pinwidth,pinlength,pinheight], bended = bended); + + } + + if (pinrows > 1) + { + rotate([0,0,180]) translate([pitch/2-pinwidth/2-(pincount0*pitch)/2,-pinlength-size[1]/2,0]) color("silver") make_line_of(pitch, pincount0) SMD_PIN_DETAIL([pinwidth,pinlength,pinheight], bended = bended); + + } + if (pinrows > 2) + { + rotate([0,0,90]) translate([pitch/2-pinwidth/2-(pincount1*pitch)/2,-pinlength-size[0]/2,0]) color("silver") make_line_of(pitch, pincount1) SMD_PIN_DETAIL([pinwidth,pinlength,pinheight], bended = bended); + + } + if (pinrows > 3) + { + rotate([0,0,270]) translate([pitch/2-pinwidth/2-(pincount1*pitch)/2,-pinlength-size[0]/2,0]) color("silver") make_line_of(pitch, pincount1) SMD_PIN_DETAIL([pinwidth,pinlength,pinheight], bended = bended); + + } + } + } + else {InvisiblePart();} +} + + +module SMD_PIN(size = [1,1,1], pinnumber = 1, pitch=1, pinlength=0, pinheight= 0, pinwidth = 0, bended = true ) +{ + pinheight = pinheight ? pinheight : sqrt(pitch/2) ; + pinwidth = pinwidth ? pinwidth : pitch/2; + if (Detailgrad > 9) + { + pinlength = pinlength ? pinlength : sqrt(pitch) ; + pos = pinnumber - 1; + + pincount = round(size[0]*0.9 / pitch); + translate([pitch/2-pinwidth/2-(pincount*pitch)/2,-pinlength-size[1]/2,0]) color("silver") translate([pitch*pos,0,0]) SMD_PIN_DETAIL([pinwidth,pinlength,pinheight],bended = bended); + } else {InvisiblePart();} +} + +module SMD_PIN_DETAIL(size = [1,1,1], bended = true) +{ + if ((Detailgrad < 20) || (size[2] > size[1]) || !bended) + { + cube(size); + } + else + { + r = size[2]/2-size[2]/8; + angle = 90; + pinwidth = size[0]; + pinheight = size[2] /4; + translate([pinwidth,(size[1]-size[2]*3/4),size[2]]) + rotate([00,-90,-90]) translate([pinheight/2-size[2],-size[0]/2,0]) + union() + { + translate([0,0,-(size[1]-size[2]*3/4 )/2]) cube([pinheight,pinwidth,size[1]-size[2]*3/4], center = true); + //translate([r,0,0]) rotate([-90,0,00]) rotate_extrude(angle=angle) translate([-r,0]) square([pinheight,pinwidth], center = true); + translate([r,0,0]) rotate([-90,00,90]) BendedRectangle([pinheight,size[0]], r=r); + translate([r*(1-cos(angle)),0,(r)*sin(angle)]) rotate([0,angle,0]) rotate([0,0,180]) translate([r,0,0]) rotate([-90,00,90]) BendedRectangle([pinheight,size[0]], r=r); + + + // translate([r,0,0]) rotate([-90,0,00]) rotate_extrude(angle=angle) translate([-r,0]) square([pinheight,pinwidth], center = true); + // translate([r*(1-cos(angle)),0,(r)*sin(angle)]) rotate([0,angle,0]) rotate([0,0,180]) translate([r,0,0]) rotate([-90,0,00]) rotate_extrude(angle=angle) translate([-r,0]) square([pinheight,pinwidth], center = true); + } + } +} + + + +module SMD_IC(size = [1,1,1],pinrows=0, pitch=1, pinlength=0, pinheight = 0, pinwidth = 0, phase = 0, r = 0 , frustum = 0, Pinsbended = true ) +{ + posphase = (phase > 0) ? phase : 0; + frust = (Detailgrad > 20) ? frustum : 0; + color("DarkSlateGray") cubepart(size = [size[0],size[1],size[2]], phase = posphase, r = r, frustum = frust); + SMD_PINS(size = [size[0],size[1],size[2]],pinrows=pinrows, pitch=pitch, pinlength=pinlength, pinheight = pinheight, pinwidth=pinwidth, phase = phase, bended = Pinsbended ) ; +} + +module SMD_FN(size = [1,1,1],pinrows=0, pitch=1, pinheight = 0, phase = 0) +{ + SMD_IC(size = [size[0],size[1],size[2]],pinrows=pinrows, pitch=pitch, pinlength = 0.05, pinheight = pinheight, phase = phase ); +} + +module R_SMD(size = [1,1,1]) +{ + if (Detailgrad > 9) + { + r = Detailgrad > 19 ? 0.08 : 0; + color("DarkSlateGray") cubepart([size[0]*0.9,size[1]*0.9,size[2]*0.9]); + color("silver") translate([size[0]*3/8,0,0]) cubepart([size[0]/4,size[1],size[2]], r=r); + color("silver") translate([-size[0]*3/8,0,0]) cubepart([size[0]/4,size[1],size[2]], r=r); + } else {InvisiblePart();} +} + +module R_SIL(n = 5) +{ + b=1; + color("Goldenrod") translate([-b/2,0,-b/2]) + { + translate([0,0,3.5]) + { sphere(b/2); + translate([b+(n-1)*2.54,0,0]) sphere(b/2); + rotate([0,90,0]) cylinder(b+(n-1)*2.54,b/2,b/2); + } + translate([0,0,6.5]) + { sphere(b/2); + translate([b+(n-1)*2.54,0,0]) sphere(b/2); + rotate([0,90,0]) cylinder(b+(n-1)*2.54,b/2,b/2); + } + translate([0,0,3.5]) cylinder(6-3,b/2,b/2); + translate([b+(n-1)*2.54,0,3.5]) cylinder(6-3,b/2,b/2); + translate([0,-b/2,3.5]) cube([b+(n-1)*2.54,b,3]); + + } + + translate([0,0,2.6]) make_line_of(2.54, n) LOETPIN(height =4.4, dim = 0.45); +} + +module C_SMD(size = [1,1,1]) +{ + if (Detailgrad > 9) + { + r = Detailgrad > 19 ? 0.08 : 0; + color("Khaki") cubepart([size[0]*0.9,size[1]*0.9,size[2]*0.9]); + color("silver") translate([size[0]*3/8,0,0]) cubepart([size[0]/4,size[1],size[2]], r=r); + color("silver") translate([-size[0]*3/8,0,0]) cubepart([size[0]/4,size[1],size[2]], r=r); + } else {InvisiblePart();} +} + + +module 0309_12(Name="",Value="",Library="rcl") +{ + R_THT(Diameter = 3, l = 6.38*2, Pin = 0.5); +} +module 0207_10(Name="",Value="",Library="rcl") +{ + R_THT(Diameter = 2, l = 5.08*2, Pin = 0.4); +} +module 0411_12(Name="",Value="",Library="Resistor") +{ + R_THT(Diameter = 4, l = 2.54*5, Pin = 0.4); +} + +//C050-025X075 +module MSR3(Name="",Value="",Library="Arcol") +{ + translate([-7.620,0,1]) LOETPIN(height = 6, dim = 1.7, rnd = true); + translate([+7.620,0,1]) LOETPIN(height = 6, dim = 1.7, rnd = true); + translate([-7.620,0,1]) color("silver") cubepart([1,5,15]); + translate([+7.620,0,1]) color("silver") cubepart([1,5,15]); + color("silver") translate([0,0,15]) cubepart([15.2,5,1]); +} + +module MSR1(Name="",Value="",Library="Arcol") +{ + translate([-5.7,0,1]) LOETPIN(height = 6, dim = 1.7, rnd = true); + translate([+5.7,0,1]) LOETPIN(height = 6, dim = 1.7, rnd = true); + translate([-5.7,0,1]) color("silver") cubepart([1,4,7]); + translate([+5.7,0,1]) color("silver") cubepart([1,4,7]); + color("silver") translate([0,0,7]) cubepart([11.4,4,1]); +} + +module R_THT(Diameter = 4.5, l = 6.38*2, Pin = 0.5) +{ + Korpus = l/1.27; + if (Detailgrad < 30) + { + color("DarkKhaki") translate([-Korpus/2,0,Diameter/2])rotate([0,90,0]) + union() + { + cylinder(Korpus/5,Diameter/2,Diameter/2); + cylinder(Korpus,7*Diameter/16,7*Diameter/16); + translate([0,0,4*Korpus/5]) cylinder(Korpus/5,Diameter/2,Diameter/2); + } + } + else + R_THT_DETAIL(Diameter = Diameter, l = l, Pin = Pin); + color("Silver") + { + translate([l/2,0,-2.25*Pin+Diameter/2]) BendedPIN(Pin,3,l2=2*Pin); + translate([-l/2,0,-2.25*Pin+Diameter/2]) rotate([0,0,180]) BendedPIN(Pin,3,l2=2*Pin); + } +} + +module R_THT_DETAIL(Diameter = 4.5, l = 6.38*2, Pin = 0.9) +{ + Resistor6_polygon = [[0.100,6.000],[0.125,5.925],[0.150,5.875],[0.200,5.800],[0.238,5.750],[0.288,5.700],[0.338,5.663],[0.400,5.625],[0.450,5.600],[0.525,5.575],[0.613,5.563],[0.675,5.550],[0.725,5.538],[0.775,5.513],[0.825,5.475],[0.850,5.450],[0.875,5.400],[0.888,5.362],[0.900,5.300],[0.900,4.525],[0.888,4.475],[0.875,4.438],[0.850,4.400],[0.775,4.325],[0.738,4.275],[0.713,4.225],[0.700,4.150],[0.700,1.850],[0.713,1.775],[0.738,1.725],[0.775,1.675],[0.850,1.600],[0.875,1.563],[0.888,1.525],[0.900,1.475],[0.900,0.700],[0.888,0.638],[0.875,0.600],[0.850,0.550],[0.825,0.525],[0.775,0.488],[0.725,0.463],[0.675,0.450],[0.613,0.438],[0.525,0.425],[0.450,0.400],[0.400,0.375],[0.338,0.338],[0.288,0.300],[0.238,0.250],[0.200,0.200],[0.150,0.125],[0.125,0.075],[0.100,0.000],[0.000,0.000],[0.000,6.000]]; + + Korpus = l/1.27; + translate([0,0,Diameter/2]) rotate([0,90,0]) scale([Diameter/2.5, Diameter/2.5,l/(6.38*1.3)]) + { + + + color("DarkKhaki") rotate_extrude($fn=100) translate([0.300,-3.000]) polygon(Resistor6_polygon); + color("brown") translate([0,0,1.6])cylinder(0.5,1.201,1.201,$fn=100); + color("black") translate([0,0,0.6])cylinder(0.5,1.001,1.001,$fn=100); + color("red") translate([0,0,-0.4])cylinder(0.5,1.001,1.001,$fn=100); + + color("gold") translate([0,0,-2.1])cylinder(0.5,1.201,1.201,$fn=100); + } + color("Silver") + { + translate([l/2,0,-2.25*Pin+Diameter/2]) BendedPIN(Pin,3,l2=2*Pin); + translate([-l/2,0,-2.25*Pin+Diameter/2]) rotate([0,0,180]) BendedPIN(Pin,3,l2=2*Pin); + } +} + + + +module C_THT(Diameter = 4.5, l = 6.38*2, Pin = 0.5) +{ + Korpus = l-2; +color("Orange") translate([-Korpus/2,0,Diameter/2])rotate([0,90,0]) + union() + { + cylinder(Korpus,Diameter/2,Diameter/2); + } + translate([l/2,0,Diameter/2-1.25]) BendedPIN(Pin,3,l2=2*Pin); + translate([-l/2,0,Diameter/2-1.25]) rotate([0,0,180]) BendedPIN(Pin,3,l2=2*Pin); +} + +module LED_BR00(Name="",Value="",Library="") +{ + rotate([0,0,90]) union() + { + color("white") cubepart(size = [2.8,3.2,1.9]); + color(LEDCOLOR(Value)) cylinderpart(size = [2.5,2]); + SMD_PINS(size = [2.8,3.2,1.9],pinrows=2, pitch=3, pinlength=0.15 ) ; + } +} + +module LED_1W(Name="",Value="",Library="") +{ + color("white") SMD_IC([6.2,7.2,2],pinrows=2,pitch=4,r=1.5, pinlength=2, pinheight=1 ); + color(LEDCOLOR(Value)) cylinderpart(size = [3,2.01]); +} + +module P_LCC4_0(Name="",Value="",Library="") +{ + color("white") cubepart(size = [2.8,3.2,1.9]); + color(LEDCOLOR(Value)) cylinderpart(size = [2.5,2]); +} + +module LRTB_G6(Name="",Value="",Library="") +{ + color("white") cubepart(size = [3.3,3,1.8]); + color(LEDCOLOR(Value)) cylinderpart(size = [2.5,2]); + SMD_PINS(size = [3.3,3,1.8],pinrows=2,pitch=1.1,pinlength = 0.2); +} + +module LRTB_GVTG(Name="",Value="",Library="") {rotate([0,0,180]) LRTB_G6(Name=Name,Value=Value,Library=Library);} + +module WS2812B(Name="",Value="",Library="") +{ + color("white") cubepart(size = [5,5,1.8]); + color(LEDCOLOR(Value)) cylinderpart(size = [4,1.9]); +} + +module LED_SMD(size = [0.8,1.7,0.65], Enable = false, Value = "") +{ + rotate([0,0,90]) + { + color("gray") translate([0,0,0.125/2]) cube([size[0]*0.85,size[1],size[2]/5], center = true); + if (!Enable) + { + color(LEDCOLOR(Value)) linear_extrude(size[2],scale = 0.9) square([size[0],0.75*size[1]],center = true); + } + else + { + color("lightgreen") linear_extrude(size[2],scale = 0.9) square([size[0],0.75*size[1]],center = true); + } + } + +} + +module LED3L(Name="",Value="",Library=""){translate([0,7,4]) rotate([-90,0,0]) LED(dia = 3, Value = Value);} +module 3MM_REAR(Name="",Value="",Library=""){translate([0,0,2]) rotate([0,180,90]) LED3(Name=Name,Value=Value,Library=Library);} +module LED_3L3(Name="",Value="",Library=""){translate([0,7,4]) rotate([90,0,0]) LED(dia = 3, Value = Value);} +module LED3MM(Name="",Value="",Library=""){LED3(Name=Name,Value=Value,Library=Library);} +module LED3E(Name="",Value="",Library=""){LED3(Name=Name,Value=Value,Library=Library);} +module LED3(Name="",Value="",Library="") +{ + translate([0,0,4.5]) LED(dia = 3, Value = Value); +} + +module LED(dia = 3, Value = "") +{ + rotate([180,0,0]) color(LEDCOLOR(Value),0.7) + { + sphere(dia/2, $fn=Detailgrad); + cylinder(3.7,dia/2,dia/2,$fn=Detailgrad); + translate([0,0,3.7-0.5]) cylinder(0.5,dia/2+0.3,dia/2+0.3,$fn=Detailgrad); + } + translate([-2.54/2,0,-3.5]) make_line_of(2.54, 2) LOETPIN(height =3.4, dim = 0.45); +} + +module ZERO(Name="",Value="",Library="HAutomation_6") +{ + board_thickness = 1.600; + color("white") translate([0,0,-board_thickness-0.05]) linear_extrude(board_thickness+0.1) difference() { circle(1.3);circle(1.2);} + color("white") + { + translate([-0.8/2,+0.8/2,0]) cubepart([0.8,0.8,0.05]); + translate([+0.8/2,-0.8/2,0]) cubepart([0.8,0.8,0.05]); + } + color("white") + { + translate([+0.8/2,+0.8/2,-board_thickness-0.05]) cubepart([0.8,0.8,0.05]); + translate([-0.8/2,-0.8/2,-board_thickness-0.05]) cubepart([0.8,0.8,0.05]); + } + +} + +module cubestack(size = [1,1,1]) +{ + translate([-size[0]/2, -size[1]/2,0]) cube([size[0],size[1],size[2]], center = false); + translate([0, 0,size[2]]) children(); +} + + +module MW15_2(Name="",Value="",Library="") { MW15(Name = Name, Value = Value, Library = Library); } +module MW15(Name="",Value="",Library="") //IC24 L298-2 +{ + h = 18.1; + translate([0,4.6,0]) rotate([0,0,180]) + { + translate([-19.6/2,0,2.8-17.5+h]) color("silver") + difference() + { + // cube([19.6,1.6,17.5]); + rotate([90,0,0]) translate([0,0,-1.6]) linear_extrude(1.6) polygon([[0,0],[19.6,0],[19.6,17.5-2.2],[19.6-2.2,17.5],[0+2.2,17.5],[0,17.5-2.2]]); + + translate([19.6/2,1.8,17.5-2.8]) rotate([90,0,0]) cylinder(2,2,2); + } + translate([-19.6/2,1.6,h-17.5+2.8]) color( "DarkSlateGray") cube([19.6,5-1.6,10.7]); + + translate([-6*1.27+0.75/2,0,h-17.5+2.8]) + + make_line_of(2.54, 7) color("silver") + { + translate([0,2.25+2.6,-7.4]) rotate([90,0,-90]) linear_extrude(0.75) polygon([[2.225,6.297500],[0.55,4.6225],[0.55,0.0],[0.0,0.0],[0.0,4.805],[1.675,6.48],[1.675,7.4],[2.225,7.4]]); // pin + } + translate([-7*1.27+0.75/2,0,h-17.5+2.8]) + make_line_of(2.54, 8) color("silver") + { + translate([0,7.35+2.6,-6.985]) rotate([90,0,-90]) linear_extrude(0.75) polygon([[7.35,5.785],[0.595,3.885],[0.595,0.0],[0.0,0.0],[0.0,4.385],[6.8,6.285],[6.8,6.985],[7.35,6.985]]); // pin + } + } +} + +module TO220_PARAM(n=2) +{ + h = 6; + angle = bended ? 90 : 0; + translate([-5,0,h]) rotate([angle,0,0]) + { + translate([0.05,0,2.8]) color("silver") + difference() + { + cube([9.9,1.3,12]); + translate([5,1.5,12-2.8]) rotate([90,0,0]) cylinder(2,2,2); + } + translate([0,0.05,0]) color("DarkSlateGray") cube([10,4.5,8.6]); + } + translate([-2.54-0.9/2,2.5,-14.7+h]) make_line_of(5.08/(n-1), n) color("silver") + { + cube([0.9,0.6,14.73]); translate([-0.45,0,14.7-h]) cube([1.8,0.6,h]); // pin + } +} + +module TO220L_PARAM(n=2) +{ + h = 0.1; + translate([-5,-5.5,h]) rotate([90,0,0]) + { + translate([0.05,0,2.8]) color("silver") + difference() + { + cube([9.9,1.3,12]); + translate([5,1.5,12-2.8]) rotate([90,0,0]) cylinder(2,2,2); + } + translate([0,0.05,0]) color("DarkSlateGray") cube([10,4.5,8.6]); + + translate([5-2.54-0.9,2.5,-3]) make_line_of(5.08/(n-1), n) color("silver") + { + cube([1.8,0.6,3]); + translate([0.9/2,0,-1.27-0.3]) cube([0.9,0.6,3]); + translate([0.9,-0.7,-1.27-0.24]) rotate([180,0,0]) BendedRectangle(Dim=[0.6,0.9], r=1); + } + } + translate([-2.54-0.9/2,-0.3,-3.1]) make_line_of(5.08/(n-1), n) color("silver") + { + cube([0.9,0.6,5]); + } +} + +module FPC_L(size = [12,4.5,2], pitch=0.5, pinlength = 1.1) +{ + NB_PINS = round((size[0]-6.4) / pitch); + pinheight = 0.3; + + difference() + { + color("DarkSlateGray") translate([-size[0]/2,size[1]-1.3,0]) cube([size[0],1.3,2]); + translate([-(pitch*(NB_PINS+1))/2,size[1]-1.4,-0.05]) cube([pitch*(NB_PINS+1),1.5,1.25]); + } + difference() + { + color("Beige") translate([-(size[0]-2)/2,0,0]) cube([size[0]-2,size[1]-1.3,2]); + translate([-(pitch*(NB_PINS+1))/2,0.1,0.25]) cube([pitch*(NB_PINS+1),size[1]-1.3,0.8]); + } + + translate([pitch/4-(NB_PINS*pitch)/2,-pinlength,0]) color("silver") make_line_of(pitch, NB_PINS) cube([pitch/2,size[1],pinheight]); +} + + +module FPC_S(size = [11.44,2,4.5], pitch=0.5, invers = false) +{ + NB_PINS = round((size[0]-6.4) / pitch); + pin1 = invers ? -size[0]/2+2.5 : size[0]/2-2.5; + + if (Detailgrad > 9) + { + translate([pin1,0,0]) color("white") cylinder(size[2]*1.02, size[1]*0.1, size[1]*0.1, $fn=Detailgrad); + color("LemonChiffon") + difference() + { + cubepart([size[0]-1.4,size[1],size[2]*3/4]); + translate([0,0,size[2]*1/4]) cubepart([size[0]-6,size[1]/2,size[2]*3/4],r=0); + } + + // Außenpins + translate([pitch/4-(NB_PINS*pitch)/2+pitch,-size[1]/2,0]) color("silver") make_line_of(pitch*2, NB_PINS/2) cube([pitch/2,size[1]+0.75,0.5]); + translate([pitch/4-(NB_PINS*pitch)/2,-0.75-size[1]/2,0]) color("silver") make_line_of(pitch*2, NB_PINS/2) cube([pitch/2,size[1]+0.75,0.5]); + translate([pitch/4-(NB_PINS*pitch)/2-2*pitch,-0.75-size[1]/2,0]) color("silver") cube([pitch/2,size[1]+1.5,0.5]); + translate([pitch/4-(-(NB_PINS*pitch)/2)+pitch,-0.75-size[1]/2,0]) color("silver") cube([pitch/2,size[1]+1.5,0.5]); + + // Innenpins + + translate([pitch/4-(NB_PINS*pitch)/2,size[1]/5,size[2]*1/4+0.1]) color("silver") make_line_of(pitch, NB_PINS) cube([pitch/2,size[1]/8,size[2]/2]); + + // Klips + Boffset = (pitch > 0.9) ? 0.8:0.1; // Seitlich etwas breiterer Clips + poly = [[-size[0]/2,size[1]/2],[-size[0]/2,-size[1]/2],[-size[0]/2+2.8,-size[1]/2-Boffset],[size[0]/2-2.8,-size[1]/2-Boffset],[size[0]/2,-size[1]/2],[size[0]/2,size[1]/2],[size[0]/2-3,size[1]/2],[size[0]/2-3,-size[1]/4],[-size[0]/2+3,-size[1]/4],[-size[0]/2+3,size[1]/2]]; + + color("DarkSlateGray") translate([0,0,size[2]*3/4]) linear_extrude(size[2]*1/4) polygon(poly); + } + else + { + color("DarkSlateGray") cubepart([size[0],size[1],size[2]]); + } +} + + +module JST(n=4) +{ + w = 0.4; + translate([-(1+1.9/2),-1.7,0]) color("Linen") difference() + { + cube([1.9+n*2,4.5,6], center = false); + translate([n*2+0.5,-2*w,4]) rotate([0,0,45]) cube([2*w,2*w,3], center = false); + + if (Detailgrad > 8) + { + translate([0.75+2,-w/2,2]) cube([(n-2)*2+0.4,2*w,5], center = false); + translate([w,w,w]) cube([-2*w+1.9+n*2,-2*w+4.5,6], center = false); + translate([-w/2,1.0,4]) cube([w+1.9+n*2,0.7,3], center = false); + } + } + if (Detailgrad > 8) + { + translate([0,0,(8.4)-3.4]) make_line_of(2, n) LOETPIN(height = 8.4, dim = 0.5); + // color("Silver") translate([0,0,(8.4/2)-3.4]) make_line_of(2, n) cube([0.5,0.5,8.4], center = true); + } +} + +module JSTL(n=4) +{ + translate([-(1+1.9/2),-6.25,0]) color("Linen") difference() + { + union() + { + cube([1.9+n*2,6,4.8], center = false); + cube([1.9+n*2,7.6,3], center = false); + } + translate([0.5,-1,5.2]) rotate([0,45,0]) cube([1,3,1], center = false); + + translate([0.75+2,-1,3.5]) cube([(n-2)*2+0.4,5,2], center = false); + + if (Detailgrad > 8) + { + translate([0.5,-0.5,0.5+0.3]) cube([-1+1.9+n*2,6,-1+4.5], center = false); + } + } + if (Detailgrad > 8) + { + color("Silver") translate([0,0,(6.4/2)-3.4]) make_line_of(2, n) cube([0.5,0.5,6.4], center = true); + color("Silver") translate([0,-2.5,3.1]) make_line_of(2, n) cube([0.5,6,0.5], center = true); + } +} + + +module JSTSMD(n=4) +{ + color("Linen"); + w = 0.4; + color("Linen") difference() + { + union() + { + translate([0,-0.5,0]) cubepart([3.9+(n*2),5,6]); + } + + + if (Detailgrad > 8) + { + translate([0,-0.5,2.5]) cubepart([0.5+(n*2),3.5,6]); + translate([-n-0.5,1,0.6]) make_line_of(2*n, 2) cube([1,2,4], center = false); + translate([0,1,2.5]) cubepart([-3.3+(n*2),4.5, 6.3]); + translate([-n-2.9+0.5,-0.5-1,0.2]) make_line_of(3.9+2*n, 2) cube([1,2,6], center = false); + // translate([-w/2,1.0,4]) cube([w+1.9+n*2,0.7,3], center = false); + } + } + if (Detailgrad > 8) + { + translate([-(n-1),0,5]) make_line_of(2, n) LOETPIN(height = 5, dim = 0.5); + color("Silver") translate([-(n-1),-2.5,0.25]) make_line_of(2, n) cube([0.5,4,0.5], center = true); + // color("Silver") translate([0,0,(8.4/2)-3.4]) make_line_of(2, n) cube([0.5,0.5,8.4], center = true); + } + + +} + +module JSTLSMD(n=4) +{ + color("Linen") + difference() + { + union() + { + translate([0,-4.05,0]) cubepart([3.9+(n*2),6.3,5.5]); + translate([-n-1.95,-0.9,0]) make_line_of(2*n+2.9, 2) cube([1,1.3,2], center = false); + } + translate([-n-0.5,-4.5,4.5]) make_line_of(2*n, 2) cube([1,5,2], center = false); + translate([0,-4.55,0.5]) cubepart([0.5+(n*2),6.3,3.7]); + translate([0,-4.55,0.5]) cubepart([-3.3+(n*2),6.3,4.5]); + } + + + if (Detailgrad > 8) + { + color("Silver") translate([-(n-1),0,0.25]) make_line_of(2, n) cube([0.5,2.8,0.5], center = true); + color("Silver") translate([-(n-1),-3.7,2.5]) make_line_of(2, n) cube([0.5,5,0.5], center = true); + } +} + +module JSTXH(n=4) +{ + translate([-(2.54),-2.35,0]) color("Linen") difference() + { + cube([2.4+n*2.5,5.75,7], center = false); + translate([n*2.5+1.2,-1.1,4]) rotate([0,0,45]) cube([1,1,4], center = false); + + translate([-0.1,1,4]) cube([2.6+n*2.5,1,6], center = false); + translate([2,-0.2,4]) cube([1.5,1,6], center = false); + translate([n*2.5-1,-0.2,4]) cube([1.5,1,6], center = false); + + + if (Detailgrad > 8) + { + translate([0.5,0.5,0.5]) cube([-1+2.4+n*2.5,-1+5.75,7], center = false); + } + } + if (Detailgrad > 8) + { + color("Silver") translate([0,0,(8.4/2)-3.4]) make_line_of(2.5, n) cube([0.65,0.65,8.4], center = true); + } +} + +module LPV(n=4) +{ + color("Linen") difference() + { + translate([-1.27,-2.92,0.01]) + union() + { + cube([n*2.54,5.8,3.17], center = false); + translate([1.27,4.8,0]) + { + cube([(n-1)*2.54,1,11.7], center = false); + translate([0,-0.5,5]) cube([(n-1)*2.54,1,1], center = false); + } + } + make_line_of(2.54, n) cube([1.8,6,1], center = true); + // translate([0.5,0.5,0.5]) cube([-1+1.9+n*2,-1+4.5,6], center = false); + } + color("Silver") translate([0,0,(13.69/2)-3.8]) make_line_of(2.54, n) cube([0.5,0.5,13.69], center = true); +} + +module LPVL(n=4) +{ + translate([0,-2.72,2.92]) rotate([90,0,0]) difference() + { + color("Linen") translate([-1.27,-2.92,0]) + union() + { + cube([n*2.54,5.8,3.17], center = false); + translate([1.27,4.8,0]) + { + cube([(n-1)*2.54,1,11.7], center = false); + translate([0,-0.5,5]) cube([(n-1)*2.54,1,1], center = false); + } + } + make_line_of(2.54, n) cube([1.8,6,1], center = true); + // translate([0.5,0.5,0.5]) cube([-1+1.9+n*2,-1+4.5,6], center = false); + } + color("Silver") translate([0,0,(6.0/2)-3.8]) make_line_of(2.54, n) cube([0.5,0.5,6.0], center = true); + color("Silver") translate([0,-11.40/2-0.75,2.92]) make_line_of(2.54, n) cube([0.5,11.40,0.5], center = true); + color("Silver") translate([0,-0.75,2.92-0.75]) make_line_of(2.54, n) rotate([0,0,180]) BendedSquare(Dim=0.5, r=0.75); +} + + +module LSTA05(n=20,m=1) +{ + offs = 0.4; + height = 7.5; + pitch = 1.27; + pin = 0.4; + translate([-(pitch/2)*n+offs,-(pitch/2)*m-(pitch/2)+offs,4.6-0.38]) cube(0.4); + difference() + { + translate([-(pitch/2)*n+offs,-(pitch/2)*m-(pitch/2)+offs,0]) make_line_of(pitch, n) color("DarkSlateGray") linear_extrude(4.6) offset_square(size=[pitch-2*offs,pitch*m+(pitch)-2*offs], delta = offs, chamfer=true); + + translate([-(pitch/2)*(n-1),-(pitch/2)*(m-1),2]) make_line_of(pitch, n) color("DarkSlateGray") cubepart([0.6,0.6,3]); + + if (m>1) translate([-(pitch/2)*(n-1),+(pitch/2)*(m-1),2]) make_line_of(pitch, n) color("DarkSlateGray") cubepart([0.6,0.6,3]); + + if (m>2) translate([-(pitch/2)*(n-1),0,2]) make_line_of(pitch, n) color("DarkSlateGray") cubepart([0.6,0.6,3]); + } + translate([-(pitch/2)*(n-1),-(pitch/2)*(m-1),0]) make_line_of(pitch, n) color("Silver") translate([0,0,-4.5+height/2]) cube([pin,pin,height-3], center = true); + + if (m>1) translate([-(pitch/2)*(n-1),+(pitch/2)*(m-1),0]) make_line_of(pitch, n) color("Silver") translate([0,0,-4.5+height/2]) cube([pin,pin,height-3], center = true); + + if (m>2) translate([-(pitch/2)*(n-1),0,0]) make_line_of(pitch, n) color("Silver") translate([0,0,-4.5+height/2]) cube([pin,pin,height-3], center = true); + +} + +module RSM_1(n=6, m=1) +{ + difference() + { + union() + { + color("DarkSlateGray") translate([0,0,0.31])cubepart([0.25+1.27*n, 2.54*m,5.79]); + translate([-1.27*(n)/2,-1.27,6.1]) color("Yellow") linear_extrude(0.01) square([1.27,2.54]); + } + color("DarkSlateGray") translate([-1.27*(n-1)/2,0,0]) make_line_of(1.27, n) cubepart([0.8,0.8,6.2]); + } + + + + r = 0.2; + h = 0.19; + l = 1.07; + b = 0.41; + + translate([-1.27*(n-1)/2,-(3.94/2-l),0]) make_line_of(2.54, n/2) color("Goldenrod") + { + translate([0,0,r+h/2]) rotate([180,00,0]) BendedRectangle(Dim=[h,b], r=r); + translate([-b/2,-l,0]) cube([b,l,h]); + } + rotate([0,0,180]) translate([-1.27*(n-1)/2,-(3.94/2-l),0]) make_line_of(2.54, n/2) color("Goldenrod") + { + translate([0,0,r+h/2]) rotate([180,00,0]) BendedRectangle(Dim=[h,b], r=r); + translate([-b/2,-l,0]) cube([b,l,h]); + } + +} + + + +module LSTA(n=20,m=1,mark=true) +{ + offs = 0.4; + height = 7.5; + pitch = 2.54; + pin = 0.4; + + difference() + { + union() + { + if (mark) + { + translate([-(pitch/2)*n+offs,-(pitch/2)*m+offs,8.4]) color("Yellow") linear_extrude(0.01) offset_square(size=[pitch-2*offs,pitch*m-2*offs], delta = offs, chamfer=true); + } + translate([-(pitch/2)*n+offs,-(pitch/2)*m+offs,0]) make_line_of(pitch, n) color("DarkSlateGray") linear_extrude(8.4) offset_square(size=[pitch-2*offs,pitch*m-2* offs], delta = offs, chamfer=true); + } + translate([-(pitch/2)*(n-1),-(pitch/2)*(m-1),3]) make_line_of(pitch, n) color("DarkSlateGray") cubepart([0.9,0.9,6]); + + if (m>1) translate([-(pitch/2)*(n-1),+(pitch/2)*(m-1),3]) make_line_of(pitch, n) color("DarkSlateGray") cubepart([0.9,0.9,6]); + + if (m>2) translate([-(pitch/2)*(n-1),0,3]) make_line_of(pitch, n) color("DarkSlateGray") cubepart([0.9,0.9,6]); + + } + translate([-(pitch/2)*(n-1),-(pitch/2)*(m-1),0]) make_line_of(pitch, n) color("Silver") translate([0,0,-4.5+height/2]) cube([pin,pin,height-3], center = true); + + if (m>1) translate([-(pitch/2)*(n-1),+(pitch/2)*(m-1),0]) make_line_of(pitch, n) color("Silver") translate([0,0,-4.5+height/2]) cube([pin,pin,height-3], center = true); + + if (m>2) translate([-(pitch/2)*(n-1),0,0]) make_line_of(pitch, n) color("Silver") translate([0,0,-4.5+height/2]) cube([pin,pin,height-3], center = true); +} + + +module LSTB05(n=20,m=1, mark=false) +{ + offs = 0.4; + height = 11.6; + pitch = 1.27; + pin = 0.4; + if (mark) + { + translate([-(pitch/2)*n+offs,-(pitch/2)*m-(pitch/2)+offs,2.6]) color("Yellow") linear_extrude(0.01) + offset_square(size=[pitch-2*offs,pitch*m+(pitch)-2*offs], delta = offs, chamfer=true); + } + translate([-(pitch/2)*n+offs,-(pitch/2)*m-(pitch/2)+offs,0]) make_line_of(pitch, n) color("lightgreen") linear_extrude(2.6) + + offset_square(size=[pitch-2*offs,pitch*m+(pitch)-2*offs], delta = offs, chamfer=true); + + translate([-(pitch/2)*(n-1),-(pitch/2)*(m-1),0]) make_line_of(pitch, n) color("Silver") translate([0,0,-3+height/2]) cube([pin,pin,height], center = true); + + if (m>1) translate([-(pitch/2)*(n-1),+(pitch/2)*(m-1),0]) make_line_of(pitch, n) color("Silver") translate([0,0,-3+height/2]) cube([pin,pin,height], center = true); + + if (m>2) translate([-(pitch/2)*(n-1),0,0]) make_line_of(pitch, n) color("Silver") translate([0,0,-3+height/2]) cube([pin,pin,height], center = true); +} +; +module LSTB(n=20,m=1, mark=true) +{ + offs = 0.9; + height = 11.6; + pitch = 2.54; + pin = 0.6; + + if (mark) + { + translate([-(pitch/2)*n+offs,-(pitch/2)*m+offs,2.6]) color("Yellow") linear_extrude(0.01) + offset_square(size=[pitch-2*offs,pitch*m-2*offs], delta = offs, chamfer=true); + } + translate([-(pitch/2)*n+offs,-(pitch/2)*m+offs,0]) make_line_of(pitch, n) color("lightgreen") linear_extrude(2.6) offset_square(size=[pitch-2*offs,pitch*m-2*offs], delta = offs, chamfer=true); + + translate([-(pitch/2)*(n-1),-(pitch/2)*(m-1),8.7]) make_line_of(pitch, n) LOETPIN(height = height, dim = pin, rnd = false); + + if (m>1) translate([-(pitch/2)*(n-1),+(pitch/2)*(m-1),8.7]) make_line_of(pitch, n) LOETPIN(height = height, dim = pin, rnd = false); + + if (m>2) translate([-(pitch/2)*(n-1),0,8.7]) make_line_of(pitch, n) LOETPIN(height = height, dim = pin, rnd = false); +} + +module LSTBW(n=20) +{ + offs = 0.9; + height = 8.7; + pitch = 2.54; + pin = 0.6; + translate([0,pitch/2,0]) + { + translate([0,0,pitch/2]) rotate([-90,00,0]) + { + translate([-(pitch/2)*n+offs,-(pitch/2)+offs,0]) make_line_of(pitch, n) color("lightgreen") linear_extrude(2.6) offset_square(size=[pitch-2*offs,pitch-2*offs], delta = offs, chamfer=true); + + translate([-(pitch/2)*(n-1),0,0]) make_line_of(pitch, n) color("Silver") translate([0,0,8.7-height/2]) cube([pin,pin,height], center = true); + + } + translate([-(pitch/2)*(n-1),0,0]) make_line_of(pitch, n) color("Silver") translate([0,0,0]) BendedSquare(Dim=pin, r=pitch/2); + + translate([-(pitch/2)*(n-1),-pitch/2,0]) make_line_of(pitch, n) color("Silver") translate([0,0,-height/6]) cube([pin,pin,height/3], center = true); + } + +} + + +//SV_3_81(n=10, SK=true); +// Weidmüller +module SV_3_81(n=10, SK=true) +{ + length = (n-1) * 3.81 + 14.2; + color("LimeGreen") + { + translate([0,-0.635,0]) cubepart(size = [length,7.25,9.2], phase = 0); + translate([0,0.635,9.2]) cubepart(size = [(n) * 3.81,11.1,9.5], phase = 0); + } + + translate([-((n-1) * 3.81)/2,0,0]) make_line_of(3.81, n) LOETPIN(height = 4); +} + + +module SL_3_5(n=4, SK=true) { + translate([3.5*3/2,0,0]) rotate([0,0,180]) + { + translate([-(1+1.3),-10,0]) difference() + { + color("Orange") cube([1.3+n*3.5,11.1,7.5], center = false); + if (Detailgrad > 8) + { + translate([0.5,-0.5,1.25]) cube([-1+1.3+n*3.5,6,5], center = false); + } + } + + //BendedPIN(Diameter=0.5,l=2,l2=1); + + if (Detailgrad > 8) + { + color("Silver") translate([0,0,(6.4/2)-3.4]) make_line_of(3.5, n) cube([0.8,0.8,6.4], center = true); + color("Silver") translate([0,-4.5,3.6]) make_line_of(3.5, n) cube([0.8,8,0.8], center = true); + } + } + } + + + module SV_3_5(n=4, SK=true) { + w=0.5; + translate([(2*2.45+(n-1)*3.5)/2,0,0]) rotate([0,0,180]) + { + color("Orange") translate([0,-3.5,0]) + intersection(Name="",Value="",Library="") + { + cube([2*2.45+(n-1)*3.5,7.5,11.1], center = false); + union() + { + difference() + { + cube([2*2.45+(n-1)*3.5,7.5,11.1], center = false); + if (Detailgrad > 8) translate([w,w,4]) cube([2*(2.45-w)+(n-1)*3.5,7.5,11.1], center = false); + } + + + if (Detailgrad > 8) + { + translate([2.45,-0.5,0.1]) make_line_of(3.5, n) cylinder(11.1,1.6,1.6); + translate([2.45-3.5/2,7.5,0.1]) make_line_of(3.5, n+1) cylinder(11.1,1.2,1.2); + } + } + } + //BendedPIN(Diameter=0.5,l=2,l2=1); + + if (Detailgrad > 8) + { + translate([2.45,0,9.8]) make_line_of(3.5, n) LOETPIN(height = 13, dim = 1); + } + } +} + + +module AK500(n=4, Library="con-ptr500") +{ + if (Library=="con-ptr500") + { + difference() + { + union() + { + color("LimeGreen") translate([0,0.7,0]) cubepart([n*5,7.6,7.2]); + color("LimeGreen") translate([-n*5/2,-7.6/2+0.7+3,7.2]) linear_extrude(3.1, scale=[1,0.70]) translate([0,-3,0]) square([n*5,7.6]); + } + translate([-((n-1) * 5.00)/2,0,8]) make_line_of(5.00, n) cylinder(4,3.5/2,3.5/2); + translate([-((n-1) * 5.00)/2-2,-5,1]) make_line_of(5.00, n) cube([4,4,5]); + } + translate([-((n-1) * 5.00)/2,0,4]) make_line_of(5.00, n) LOETPIN(height = 4+3, dim = 1); + } +} + + +module MSTBV(n = 4, Library="") +{ + if (Library=="con-phoenix-508") + { + rotate([0,0,180]) union() + { + color("LimeGreen") + translate([-((n) * 5.08)/2,-3.8,0]) + { + translate([-1,-0.5,12-2]) cube([n*5.08+2,0.5,1]); + intersection() + { + translate([-1,0,-1]) cube([n*5.08+2,8.5,12]); + difference() + { + union() + { + translate([-1,0,0]) cube([n*5.08+2,6.0,12]); + translate([5.08/2,4,0.1]) make_line_of(5.08, n) cylinder(12,4,4); + } + translate([5.08/2,4,3]) make_line_of(5.08, n) cylinder(12.0,3,3); + translate([-5.08/2+2.125,1,3]) cube([(n)*5.08+0.75,4.5,12]); + } + } + } + translate([-((n-1) * 5.08)/2,0,12]) make_line_of(5.08, n) LOETPIN(height = 4+12, dim = 1); + } + MVSTBW508(n = n); + } + else + { // Weidmüller + // SL 5.08/n/180 + rotate([0,0,180]) union() + { + color("Orange") translate([-((n) * 5.08)/2,-3.8,0]) + intersection() + { + translate([0,0,-1]) cube([n*5.08,8.5,13]); + difference() + { + union() + { + cube([n*5.08,6.5,12]); + translate([5.08/2,4,0.1]) make_line_of(5.08, n) cylinder(12,4,4); + } + translate([5.08/2,4,3]) make_line_of(5.08, n) cylinder(12.0,3,3); + translate([-5.08/2,1,3]) cube([(1+n)*5.08,4.5,12]); + } + } + translate([-((n-1) * 5.08)/2,0,12]) make_line_of(5.08, n) LOETPIN(height = 4+12, dim = 1); + } + } +} + + +module MVSTBW508(n = 4) +{ + rotate([0,0,0]) union() + { + color("limegreen") translate([-((n) * 5.08)/2,-3.0,12-8.3]) + { + cube([n*5.08,6,8.3]); + translate([0,-12.6/2+3,7.4]) difference() + { + cube([n*5.08,12.6,29.5-12]); + translate([-1,-7.4,0])rotate([-15,0,0]) cube([n*5.08+2,4,29.5-12]); + if (Detailgrad > 15) + { + translate([5.08/2,-1,6.5]) make_line_of(5.08, n) mirror([0,1,0]) rotate([90,0,0]) linear_extrude(3.5, scale=[0.6,0.6]) translate([-2,-2]) square([4,7.8]); + } + else + { + translate([5.08/2,-1,6.5]) make_line_of(5.08, n) mirror([0,1,0]) rotate([90,0,0]) cube([4,7.8,3.5], center = true); + } + translate([5.08/2,12.6/2,29.5-12-2]) make_line_of(5.08, n) cylinder(3,1.75,1.75); + } + } + + } +} + + + + +module BL508(n = 4) +{ + union() + { + color("Orange") translate([-((n) * 5.08)/2,-3.0,3.4]) + { + cube([n*5.08,6,8.6]); + translate([0,-1,7.4]) difference() + { + cube([n*5.08,15.5,12]); + translate([5.08/2,3,12.1]) make_line_of(5.08, n) mirror([0,0,1]) linear_extrude(3.5, scale=[0.6,0.6]) translate([-2,-2]) square([4,7.8]); + translate([5.08/2,15.6,5]) make_line_of(5.08, n) rotate([90,0,0]) cylinder(3,1.75,1.75); + } + } + + } +} + +module BL350(n = 4) +{ + Raster = 3.5; + rotate([0,0,180]) union() + { + color("Orange") translate([-((n) * Raster)/2,-2.9,3.7]) + { + cube([n*Raster,5.8,8.6]); + translate([0,-6.1+1.5,7.4]) difference() + { + cube([n*Raster,13,12]); + translate([0.5+Raster/2,3,12.1]) make_line_of(Raster, n) mirror([0,0,1]) linear_extrude(3.5, scale=[0.6,0.6]) translate([-2,-2]) square([3,5.5]); + translate([Raster/2,15.6,5]) make_line_of(Raster, n) rotate([90,0,0]) cylinder(3,1.75,1.75); + } + } + + } + +} + + +// DIL Sockel +module DIL_SOCKEL(n=10,b=7.62) +{ + pitch = 2.54; + height = 4.45; + rotate([0,0,-90]) + { + make_line_of(b, 2) rotate([0,0,90]) + {difference() + { + color("DarkSlateGray") translate([0,b/2,height-3/2]) cube([(n* pitch)/2,3,3], center = true); + + translate([-((n-2)*pitch)/4,b/2,1]) make_line_of(2.54, n/2) cylinder(4.1,0.8,0.8, $fn=Detailgrad); + } + translate([-((n-2)*pitch)/4,b/2,0]) make_line_of(2.54, n/2) ROUND_DIL_SOCKET(); + } + color("DarkSlateGray") translate([0,((n-2)* pitch)/4,height-4/2]) cube([b,pitch,2], center = true); + + color("DarkSlateGray") translate([0,-((n-2)* pitch)/4,height-4/2]) + difference() { cube([b,pitch,2], center = true); translate([0,-1.5,-2]) cylinder(4,1,1,$fn=Detailgrad);} + } + } +module DIL(n=10,b=7.62, frustum = 0, Text="") +{ + pitch = 2.54; + height = 3.5; + size = [(n* pitch)/2,b-1,height]; + if (EnableText && Text!="") + { + color("White") translate([-size[0]/2+1.2,-b/6,5.08-0.5]) linear_extrude(0.6) text(Text,size = b/3); + } + color("DarkSlateGray") difference() + { + translate([0,0,5.08-height]) cubepart(size = [size[0],size[1],size[2]], phase = 0, r = 0, frustum = frustum); + translate([-size[0]/2,0,5.08-1]) cylinder(2,1,1); + } + // make_line_of(2.54, n/2) + color("Silver") translate([-((n-2)*pitch)/4,b/2-0.75,6.08-height]) make_line_of(2.54, n/2) + { + rotate([0,0,180]) BendedRectangle(Dim=[0.5,1.4], r=0.75); + translate([-0.7,0.5,-2.2]) cube([1.4,0.5,2.2]); + translate([-0.3,0.5,-5]) cube([0.6,0.5,5]); + } + rotate([0,0,180]) color("Silver") translate([-((n-2)*pitch)/4,b/2-0.75,6.08-height]) make_line_of(2.54, n/2) + { + rotate([0,0,180]) BendedRectangle(Dim=[0.5,1.4], r=0.75); + translate([-0.7,0.5,-2.2]) cube([1.4,0.5,2.2]); + translate([-0.3,0.5,-5]) cube([0.6,0.5,5]); + } +} + + +module ROUND_DIL_SOCKET() +{ + height = 4.5; + color ("silver") translate([0,0,height]) rotate([180,0,0]) difference() { + union() + { cylinder(0.7,1,1, $fn=Detailgrad); + cylinder(4.1,0.8,0.8, $fn=Detailgrad); + translate([0,0,4.1]) cylinder(0.5,0.8,0.245, $fn=Detailgrad); + cylinder(7.155,0.245,0.245, $fn=Detailgrad); + translate([0,0,7.155]) sphere(0.245, $fn=Detailgrad); + } + translate([0,0,-0.1]) cylinder(0.5,0.8,0.49/2, $fn=Detailgrad); + } +} + +module LOETPIN(height = 6, dim = 0.6, rnd = false, displacement=0) +{ + color("Silver") + { + if (Detailgrad > 40) + { + if (rnd) + { + translate([0,0,-height+dim/2]) cylinder(height-dim,dim/2,dim/2, $fn = Detailgrad); + translate([0,0,-(dim/2)]) sphere(dim/2,$fn = Detailgrad); + translate([0,0,-(height-dim/2)]) sphere(dim/2,$fn = Detailgrad); + } + else + { + translate([0,0,-(height/2)]) cube([dim,dim,height-2*dim], center = true); + translate([0,0,-(dim)])linear_extrude(dim, scale=0.5) translate([-dim/2,-dim/2]) square([dim,dim]); + translate([0,0,-(height-dim)]) mirror([0,0,1]) linear_extrude(dim, scale=0.5) translate([-dim/2,-dim/2]) square([dim,dim]); + } + } + else + { + if (rnd) + { + translate([0,0,-height]) cylinder(height,dim/2,dim/2, $fn = 10); + } + else + { + if (displacement == 0) + { + translate([-dim/2,-dim/2,-height]) cube([dim,dim,height]); + } + else + { + dis = abs(displacement); + translate([-dim/2,-dim/2,-height]) cube([dim,dim,height/2-dis]); + translate([displacement-(dim/2),-dim/2,-height/2+dis]) cube([dim,dim,height/2-dis]); + translate([displacement,dim/2,-height/2+dis]) rotate([90,0,0]) cylinder(dim,dim/2,dim/2); + translate([0,dim/2,-height/2-dis]) rotate([90,0,0]) cylinder(dim,dim/2,dim/2); + translate([0,0,-height/2-dis ]) rotate([0,(dis/displacement)*atan(0.5),0]) translate([-dim/2,-dim/2,0]) cube([dim,dim,sqrt(5*dis*dis)]); // Hildeische Konstante war sin(30-3.435) = tan(30) + } + } + } + if ($children>0) + { + translate([0,0,-height]) children(0); + } + } +} + +function rotate_point (coord, angle, zero = [0,0]) = +[ + zero[0] + cos (-angle) * (coord[0]-zero[0]) + sin (-angle) * (coord[1]-zero[1]), + zero[1] + cos (-angle) * (coord[1]-zero[1]) - sin (-angle) * (coord[0]-zero[0]) +]; + +function rotate_poly(p, angle, zero = [0,0]) = [ + for (i=[0:len(p)-1]) + rotate_point(p[i], angle = angle, zero = zero) +]; + + +function pol_zu_kart(polvect) = [ + polvect[0]*cos(polvect[1]), + polvect[0]*sin(polvect[1]) +]; + + +module make_line_of(pitch, count, center = false) +{ + displacement = center ? ((count - 1) * pitch) / 2 : 0; + translate([-displacement,0,0]) for (a = [0 : count - 1]) { + pos = a*pitch; + translate([pos, 0, 0]) + children(); + } +} + +module make_ring_of(radius, count, pie = 360) +{ + for (a = [0 : floor(count) - 1]) { + angle = a * pie / floor(count); + translate(radius * [sin(angle), -cos(angle), 0]) + rotate([0, 0, angle]) + children(); + } +} + +module cubepart(size = [1,1,1], phase = 0, r = 0, frustum = 0) +{ + frust = (Detailgrad > 20) ? frustum : 0; + if (!phase && !frust && !r) + { + translate([-size[0]/2,-size[1]/2,0]) cube(size=[size[0],size[1],size[2]]); + } + else + { + linear_extrude(size[2], scale = 1-(frust/100)) offset_square(size=[size[0]-(2*phase+2*r),size[1]-(2*phase+2*r)], delta = phase, r=r, chamfer=true, center = true); + } +} + +module cylinderpart(size = [1,1]) +{ + cylinder(size[1],size[0]/2,size[0]/2, $fn = Detailgrad); +} + + + +module offset_square(size = [1,1], r = 0, delta = 0, chamfer=false, center = false, $fn = Detailgrad) +{ + num = round($fn/4); + plus = delta*0.41425; + function bogen(point=[0,0],aPhase = 0) = [for (i=[0:num], x=i*90/num) [point[0]+r*sin(x+aPhase),point[1]+r*cos(x+aPhase)]]; + function poli_round() = concat(bogen([0,0],180),bogen([0,size[1]],-90),bogen([size[0],size[1]],0),bogen([size[0],0],90)); + function poli_phase() = concat([[0-delta,0-plus],[0-delta,size[1]+plus],[0-plus,size[1]+delta],[size[0]+plus,size[1]+delta],[size[0]+delta,size[1]+plus],[size[0]+delta,0-plus],[size[0]+plus,-delta],[0-plus,-delta]]); + if (Detailgrad > 15) + { + if (r==0) + { + if (chamfer) + { + if (center) + translate([-size[0]/2,-size[1]/2]) polygon(poli_phase()); + else + polygon(poli_phase()); + } + else + { + if (center) square([size[0]+2*delta,size[1]+2*delta], center = center); + else + translate([-delta,-delta]) square([size[0]+2*delta,size[1]+2*delta], center = center); + } + } + else + { + if (center) + translate([-size[0]/2,-size[1]/2]) polygon(poli_round()); + else + polygon(poli_round()); + } + } else + { + if (center) square([size[0]+2*(delta+r),size[1]+2*(delta+r)], center = center); + else + translate([-(delta+r),-(delta+r)]) square([size[0]+2*(delta+r),size[1]+2*(delta+r)], center = center); + } + +} + +module offset_polygon(points , r = 0, delta = 0, chamfer=false, center = false, $fn = Detailgrad) +{ + function bogen(point=[0,0], r = 1 ,phase = 0, winkel = 90, $fn=$fn) = [let(num=abs($fn*winkel/360)) for (i=[0:num], x=i*winkel/num) [point[0]+r*cos(x+phase),point[1]+r*sin(x+phase)]]; + // (a[0] != 0) ? atan2(a[1],a[0]) : (a[1]>0) ? 90 : (a[1]<0) ? -90 : 0; + function winkel(a,b=[0,0]) = atan2(a[1]-b[1],a[0]-b[0]); + + function Startwinkel(ar,i) = let(k=(i==0) ? len(ar)-1 : i-1) winkel(ar[i],ar[k]); + function Endwinkel(ar,i) = let(j=(i<(len(ar)-1)) ? i+1 : 0) winkel(ar[j],ar[i]); + function Winkellaenge(ar,i) = let(w=Endwinkel(ar,i)-Startwinkel(ar,i)) (w<= -180) ? w+360 : (w>180)? w-360 : w; + + function AngleSum(array, i=0, sum=0) = (i==len(array)) ? sum : AngleSum(array, i=i+1, sum=sum) + Winkellaenge(array,i); + + n = AngleSum(points); + Winkeloffset = (n < 0) ? -90 : 90; + //echo(n); + + function flatten(array) = [ for (a = array) for (b = a) b ] ; + + function round_poly(arr) = !(len(arr)>0) ? [] : + flatten([for (i=[0:len(arr)-1]) concat(bogen(point=arr[i], r = r, phase = Startwinkel(arr,i)-Winkeloffset, winkel = Winkellaenge(arr,i),$fn=Detailgrad))]) ; + + polygon(round_poly(points)); +} + +module DGS_105C6(Name="",Value="",Library="OEM-Switch") +{ + difference() + { + translate([92.055/2, 73.013/2,0]) color("limegreen") cubepart(size = [92.055,73.013,1.6]); + translate([6.668,68.898,-1]) cylinder(3,1.7,1.7,$fn=$fn); //Hole + translate([6.668,23.178,-1]) cylinder(3,1.7,1.7,$fn=$fn); //Hole + translate([84.773,23.178,-1]) cylinder(3,1.7,1.7,$fn=$fn); //Hole + translate([84.773,68.898,-1]) cylinder(3,1.7,1.7,$fn=$fn); //Hole + } + translate([55.245,38.894,1.6])rotate([0,0,90])KK_172211(Name="U$1",Value="",Library="OEM-Switch"); + //translate([38.925,59.817,1.6])LDG_LG4801D(Name="L1",Value="LG-4801D",Library="OEM-Switch"); + //translate([68.341875,59.849,1.6])LDG_LG4801D(Name="L2",Value="LG-4801D",Library="OEM-Switch"); + //translate([14.446,59.690,1.6])PTG_1841(Name="L3",Value="PTG-1841",Library="OEM-Switch"); + //translate([66.6,14,1.6])ES_2_5(Name="C1",Value="",Library="HAutomation_6"); + //translate([54.4,13.3,1.6])L_THT_8_10(Name="C4",Value="",Library="HAutomation_6"); + //translate([48,13.3,1.6])ES_2_2(Name="C2",Value="",Library="HAutomation_6"); + //translate([38.2,13.5,1.6])L_THT_8_10(Name="C4",Value="",Library="HAutomation_6"); + //translate([35,19.5,1.6])ES_2_2(Name="C3",Value="",Library="HAutomation_6"); + translate([66.040,13.652,1.6])rotate([0,0,180])E3_5_8(Name="C1",Value="",Library="rcl"); + translate([49.054,14.446,1.6])ES_1_5(Name="C2",Value="",Library="HAutomation_6"); + translate([51.594,23.813,0])rotate([180,0,180])C0603(Name="C3",Value="",Library="rcl"); + translate([51.594,25.400,0])rotate([180,0,180])C0603(Name="C4",Value="",Library="rcl"); + translate([35.401,19.526,1.6])ES_1_5(Name="C5",Value="",Library="HAutomation_6"); + translate([38.925,59.817,1.6])LDG_LG4801D(Name="L1",Value="LG-4801D",Library="OEM-Switch"); + translate([68.342,59.849,1.6])LDG_LG4801D(Name="L2",Value="LG-4801D",Library="OEM-Switch"); + translate([14.446,59.690,1.6])PTG_1841(Name="L3",Value="PTG-1841",Library="OEM-Switch"); + translate([54.848,13.652,1.6])rotate([0,0,90])82114R(Name="L4",Value="82114R",Library="inductors"); + translate([38.418,14.208,1.6])rotate([0,0,90])82114R(Name="L5",Value="82114R",Library="inductors"); + + // SMD + //translate([54,34.7,-0.5]) rotate([0,0,90.000]) cube([26,18,1], center = true); + + translate([51.594,26.670,0])rotate([180,0,180])C0603(Name="C6",Value="",Library="rcl"); + translate([51.753,27.940,0])rotate([180,0,180])C0603(Name="C7",Value="",Library="rcl"); + translate([49.054,28.734,0])rotate([180,0,180])C0603(Name="C8",Value="",Library="rcl"); + translate([49.054,32.385,0])rotate([180,0,180])C0603(Name="C9",Value="",Library="rcl"); + translate([51.276,30.956,0])rotate([180,0,180])C0603(Name="C10",Value="",Library="rcl"); + translate([58.579,32.544,0])rotate([180,0,270])C0603(Name="C11",Value="",Library="rcl"); + translate([57.468,32.544,0])rotate([180,0,270])C0603(Name="C12",Value="",Library="rcl"); + translate([56.356,32.544,0])rotate([180,0,270])C0603(Name="C13",Value="",Library="rcl"); + translate([55.721,28.893,0])rotate([180,0,180])C0603(Name="C14",Value="",Library="rcl"); + translate([51.276,39.688,0])rotate([180,0,180])C0603(Name="C15",Value="",Library="rcl"); + translate([47.466,41.593,0])rotate([180,0,180])C0603(Name="C16",Value="",Library="rcl"); + translate([52.546,43.021,0])rotate([180,0,180])C0603(Name="C17",Value="",Library="rcl"); + translate([51.117,37.782,0])rotate([180,0,180])C0603(Name="C18",Value="",Library="rcl"); + translate([60.325,37.465,0])rotate([180,0,180])C0603(Name="C19",Value="",Library="rcl"); + translate([60.008,39.053,0])rotate([180,0,180])C0603(Name="C20",Value="",Library="rcl"); + translate([60.166,40.799,0])rotate([180,0,180])C0603(Name="C21",Value="",Library="rcl"); + translate([50.165,45.403,0])rotate([180,0,270])C0603(Name="C22",Value="",Library="rcl"); + translate([51.435,45.720,0])rotate([180,0,270])C0603(Name="C23",Value="",Library="rcl"); + translate([52.705,45.720,0])rotate([180,0,270])C0603(Name="C24",Value="",Library="rcl"); + translate([53.975,45.561,0])rotate([180,0,270])C0603(Name="C25",Value="",Library="rcl"); + translate([55.245,45.403,0])rotate([180,0,270])C0603(Name="C26",Value="",Library="rcl"); + translate([56.356,45.403,0])rotate([180,0,270])C0603(Name="C27",Value="",Library="rcl"); + translate([57.468,45.403,0])rotate([180,0,270])C0603(Name="C28",Value="",Library="rcl"); + + translate([4.842,62.151,0]) rotate([0,0,90.000]) cube([1.270,2.540,0.035], center = true); + translate([4.842,57.309,0]) rotate([0,0,90.000]) cube([1.270,2.540,0.035], center = true); + translate([25.162,62.548,0]) rotate([0,0,90.000]) cube([1.270,2.540,0.035], center = true); + translate([26.035,64.294,,0]) rotate([0,0,90.000]) cube([1.270,2.540,0.035], center = true); + translate([55.563,64.373,0]) rotate([0,0,90.000]) cube([1.270,2.540,0.035], center = true); + translate([54.610,62.548,0]) rotate([0,0,90.000]) cube([1.270,2.540,0.035], center = true); + translate([54.769,55.483,0]) rotate([0,0,90.000]) cube([1.270,2.540,0.035], center = true); + translate([55.563,57.309,0]) rotate([0,0,90.000]) cube([1.270,2.540,0.035], center = true); + translate([25.082,55.483,0]) rotate([0,0,90.000]) cube([1.270,2.540,0.035], center = true); + translate([25.956,57.229,0]) rotate([0,0,90.000]) cube([1.270,2.540,0.035], center = true); + + translate([35.0,55.483-4.2,0]) rotate([0,0,90.000]) cube([1.270,25,0.035], center = true); + translate([68.7,55.483-4.2,0]) rotate([0,0,90.000]) cube([1.270,21,0.035], center = true); + + translate([35.0,55.483-9,0]) rotate([0,0,90.000]) cube([1.270,25,0.035], center = true); + translate([68.7,55.483-8,0]) rotate([0,0,90.000]) cube([1.270,21,0.035], center = true); + + translate([35.0,55.483-13,0]) rotate([0,0,90.000]) cube([1.270,25,0.035], center = true); + translate([68.7,55.483-12,0]) rotate([0,0,90.000]) cube([1.270,21,0.035], center = true); + + translate([35.0,55.483-16.5,0]) rotate([0,0,90.000]) cube([1.270,25,0.035], center = true); + translate([68.7,55.483-16,0]) rotate([0,0,90.000]) cube([1.270,21,0.035], center = true); + + translate([35.0,55.483-21,0]) rotate([0,0,90.000]) cube([1.270,25,0.035], center = true); + translate([68.7,55.483-20,0]) rotate([0,0,90.000]) cube([1.270,21,0.035], center = true); + + translate([35.0,55.483-25,0]) rotate([0,0,90.000]) cube([1.270,25,0.035], center = true); + + translate([35.0,55.483-30,0]) rotate([0,0,90.000]) cube([1.270,25,0.035], center = true); + + translate([25,70,1.6]) rotate([0,0,90]) C1206(); + translate([50,70,1.6]) rotate([0,0,90]) C1206(); + translate([55,70,1.6]) rotate([0,0,90]) C1206(); + translate([75.5,70,1.6]) rotate([0,0,90]) C1206(); + translate([19.5,68.5,1.6]) rotate([0,0,90]) C1206(); + translate([1.5,63.2,1.6]) rotate([0,0,90]) C1206(); + translate([4,63.2,1.6]) rotate([0,0,90]) C1206(); + //translate([30.639,22.225,1.6])ES_2_2(Name="C5",Value="",Library="HAutomation_6"); + + + translate([43,8,1.6]) SO08(Name="",Value="",Library=""); + translate([59.5,8,1.6]) SO08(Name="",Value="",Library=""); + translate([81.8,43.5,1.6]) SO08(Name="",Value="",Library=""); + + translate([70.564,31.353,1.6])HC49_S(Name="Q2",Value="",Library="crystal"); + translate([76.517,9.207,1.6])rotate([0,0,90])SPC4077(Name="J1",Value="",Library="con-jack"); +} + +module SK96_84(Name="",Value="",Library="") +{ + SK96_polygon = [[0.0,16.5],[0.75,16.5],[1,16.75],[1.25,16.5],[1.5,16.5],[1.75,16.75],[2.0,16.5],[2.25,16.5],[2.5,16.75],[2.75,16.5],[3.0,16.5],[3.25,16.75],[3.5,16.5],[3.75,16.5],[4.0,16.75],[4.25,16.5],[7.0,16.5],[7.0,19.5],[4.25,19.5],[4.0,19.25],[3.75,19.5],[3.5,19.5],[3.25,19.25],[3.0,19.5],[2.75,19.5],[2.5,19.25],[2.25,19.5],[2.0,19.5],[1.75,19.25],[1.5,19.5],[1.25,19.5],[1.0,19.25],[0.75,19.5],[0.0,19.5],[0.0,27.0],[0.133972,27.5],[0.5,27.866025],[1.0,28.0],[1.5,27.866025],[1.866025,27.5],[2.0,27.0],[2.5,25.0],[2.633972,24.5],[3.0,24.133972],[3.5,24.0],[4.0,24.133972],[4.366025,24.5],[4.5,25.0],[5.0,27.0],[5.133972,27.5],[5.5,27.866025],[6.0,28.0],[6.5,27.866025],[6.866025,27.5],[7.0,27.0],[7.5,25.0],[7.633972,24.5],[8.0,24.133972],[8.5,24.0],[9.0,24.133972],[9.366025,24.5],[9.5,25.0],[10.0,27.0],[10.133972,27.5],[10.5,27.866025],[11.0,28.0],[11.5,27.866025],[11.866025,27.5],[12.0,27.0],[12.5,20.5],[12.633972,20.0],[13.0,19.633972],[13.5,19.5],[14.0,19.633972],[14.366025,20.0],[14.5,20.5],[15.0,27.0],[15.133972,27.5],[15.5,27.866025],[16.0,28.0],[16.5,27.866025],[16.866025,27.5],[17.0,27.0],[17.5,20.5],[17.633972,20.0],[18.0,19.633972],[18.5,19.5],[19.0,19.633972],[19.366025,20.0],[19.5,20.5],[20.0,27.0],[20.133972,27.5],[20.5,27.866025],[21.0,28.0],[21.5,27.866025],[21.866025,27.5],[22.0,27.0],[22.5,20.5],[22.633972,20.0],[23.0,19.633972],[23.5,19.5],[24.0,19.633972],[24.366025,20.0],[24.5,20.5],[25.0,27.0],[25.133972,27.5],[25.5,27.866025],[26.0,28.0],[26.5,27.866025],[26.866025,27.5],[27.0,27.0],[27.5,20.5],[27.633972,20.0],[28.0,19.633972],[28.5,19.5],[29.0,19.633972],[29.366025,20.0],[29.5,20.5],[30.0,27.0],[30.133972,27.5],[30.5,27.866025],[31.0,28.0],[31.5,27.866025],[31.866025,27.5],[32.0,27.0],[32.5,20.5],[32.633972,20.0],[33.0,19.633972],[33.5,19.5],[34.0,19.633972],[34.366025,20.0],[34.5,20.5],[35.0,27.0],[35.133972,27.5],[35.5,27.866025],[36.0,28.0],[36.5,27.866025],[36.866025,27.5],[37.0,27.0],[37.5,20.5],[37.633972,20.0],[38.0,19.633972],[38.5,19.5],[39.0,19.633972],[39.366025,20.0],[39.5,20.5],[40.0,27.0],[40.133972,27.5],[40.5,27.866025],[41.0,28.0],[41.5,27.866025],[41.866025,27.5],[42.0,27.0],[42.5,20.5],[42.633972,20.0],[43.0,19.633972],[43.5,19.5],[44.0,19.633972],[44.366025,20.0],[44.5,20.5],[45.0,27.0],[45.034072,27.258819],[45.133972,27.5],[45.292891,27.707106],[45.5,27.866025],[45.741178,27.965925],[46.0,28.0],[54.0,28.0],[54.5,27.866025],[54.866025,27.5],[55.0,27.0],[54.866025,26.5],[54.5,26.133972],[54.0,26.0],[48.5,26.0],[48.0,25.866025],[47.633972,25.5],[47.5,25.0],[47.633972,24.5],[48.0,24.133972],[48.5,24.0],[54.0,24.0],[54.5,23.866025],[54.866025,23.5],[55.0,23.0],[54.866025,22.5],[54.5,22.133972],[54.0,22.0],[48.5,22.0],[48.0,21.866025],[47.633972,21.5],[47.5,21.0],[47.633972,20.5],[48.0,20.133972],[48.5,20.0],[54.0,20.0],[54.5,19.866025],[54.866025,19.5],[55.0,19.0],[54.866025,18.5],[54.5,18.133972],[54.0,18.0],[48.5,18.0],[48.0,17.866025],[47.633972,17.5],[47.5,17.0],[47.633972,16.5],[48.0,16.133972],[48.5,16.0],[54.0,16.0],[54.5,15.866025],[54.866025,15.5],[55.0,15.0],[54.866025,14.5],[54.5,14.133972],[54.0,14.0],[8.0,14.0],[8.0,0.0],[5.5,0.0],[5.5,0.75],[5.25,1.0],[5.5,1.25],[5.5,1.5],[5.25,1.75],[5.5,2.0],[5.5,2.25],[5.25,2.5],[5.5,2.75],[5.5,3.0],[5.25,3.25],[5.5,3.5],[5.5,3.75],[5.25,4.0],[5.5,4.25],[5.5,7.0],[2.5,7.0],[2.5,4.25],[2.75,4.0],[2.5,3.75],[2.5,3.5],[2.75,3.25],[2.5,3.0],[2.5,2.75],[2.75,2.5],[2.5,2.25],[2.5,2.0],[2.75,1.75],[2.5,1.5],[2.5,1.25],[2.75,1.0],[2.5,0.75],[2.5,0.0],[0.0,0.0]]; + + color("DarkSlateGray") translate([-84/2,0,0]) rotate([90,0,90]) linear_extrude(84) polygon(SK96_polygon); +} + +module BendedPIN(Diameter=0.5,l=2,l2=1, cl="silver") +{ + if (Detailgrad > 19) + { + color(cl) + { + rotate([90,0,0]) translate([-2*Diameter,Diameter/4,0]) rotate_extrude(angle=90, $fn=2*Detailgrad) translate([2*Diameter, 0]) circle(Diameter/2,$fn=Detailgrad); + translate([0,0,-l]) cylinder(l+Diameter/4, Diameter/2,Diameter/2,$fn=Detailgrad); + translate([-2*Diameter,0,2*Diameter+Diameter/4]) rotate([90,0,-90]) cylinder(l2,Diameter/2, Diameter/2,$fn=Detailgrad); + } + } + else + { + color(cl) + { + translate([0,0,-l]) cylinder(l+Diameter/4+2*Diameter, Diameter/2,Diameter/2,$fn=Detailgrad); + translate([0,0,2*Diameter+Diameter/4]) rotate([90,0,-90]) cylinder(2*Diameter+l2,Diameter/2, Diameter/2,$fn=Detailgrad); + translate([0,0,2*Diameter+Diameter/4]) sphere(Diameter/2,$fn=Detailgrad); + } + } +} + + + +module BendedSquare(Dim=0.6, r=0.75) +{ + if (Detailgrad > 9) + { + color("silver") + { + rotate([90,0,-90]) translate([0,0,-Dim/2]) rotate_extrude(angle=90, convexity=10, $fn=20) + translate([r-(Dim/2), 0]) square([Dim,Dim]); + // translate([0,0,-l+Diameter/4]) cylinder(r=Diameter/2,h=l+Diameter/4,$fn=10); + //translate([-2*Diameter,0,2*Diameter+Diameter/4]) rotate([90,0,-90]) cylinder(r=Diameter/2,h=2* Diameter,$fn=10); + } + } else {InvisiblePart();} +} + +module BendedRectangle(Dim=[0.6,0.9], r=0.75) +{ + det = (($fn != undef) && ($fn != 0))? $fn : 20; + function bogen(point=[0,0], r = 1 ,phase = 0, winkel = 90, $fn=det) = [let(num=abs($fn*winkel/360)) for (i=[0:num], x=i*winkel/num) [point[0]+r*cos(x+phase),point[1]+r*sin(x+phase)]]; + + if (Detailgrad > 9) + { + rotate([180,-90,00 ])translate([0,0,-Dim[1]/2]) linear_extrude(Dim[1]) polygon(concat([[0,r+Dim[0]/2]], bogen([0,0],r=r-Dim[0]/2, phase = 90 ,winkel = -90), [[r-Dim[0]/2, 0]] ,bogen([0,0], r=r+Dim[0]/2))); + // rotate([90,0,-90]) translate([0,0,-Dim[1]/2]) rotate_extrude(angle=90, convexity=10, $fn=20) translate([r-(Dim[0]/2), 0]) square(Dim); + } else {InvisiblePart(); + } +} + +module pipe(matrix = [[0,0,0],[0,0,10]], r = 1, $fn = 20) +{ + // rotate_extrude(angle=90, convexity=10) translate([2, 0, 0]) circle(r = r); + + bendedpipe(); + +} + +module bendedpipe(start = [5,0,0], ziel = [0,0,10], alpha = 25, beta = 100, $fn = 50, r = 1) +{ + angle = (beta-alpha); + c = sqrt(pow((ziel[0]-start[0]),2) + pow((ziel[1]-start[1]),2) + pow((ziel[2]-start[2]),2)); + + h = (c/2) / sin(angle/2); + + //a = c * sin(beta-alpha); + //b = c * cos(beta-alpha); + + translate(start) + rotate([0,0,alpha]) translate([-h, 0, 0]) rotate_extrude(angle=angle, convexity=10, $fn = $fn) translate([h, 0, 0]) circle(r = r,$fn = $fn); +} + + + + +// EXTERN STL +module I6A4W(Name="",Value="",Library="") {translate([-0.7,0.5,2.3]) rotate([90,0,-90]) import(str(Package_path,"i6a_standard.stl"));} +module _614104150121(Name="",Value="",Library="") {translate([-3.5,-6,4]) rotate([180,0,180]) import(str(Package_path,"WE_61400416021.stl"));} +module _1728307(Name="",Value="",Library="") {translate([-5.73,5.70,0]) rotate([90,0,-90]) color("LimeGreen")import(str(Package_path,"PhoenixContact_1728307.stl"));} +module _1439890(Name="",Value="",Library="") { if (Detailgrad > 15) {translate([0,2.2,0]) rotate([90,0,0]) color("silver") import(str(Package_path,"PhoenixContact_1439890.stl"));} else {translate([0,-2.2,8.50]) rotate([90,00,0]) rotate([0,0,45]) M12_P_SINGLE();translate([0,-0.1,0]) color("DarkSlateGray") cubepart([15,12.5,14]);}} // A-Codiert 90 +module _1424180(Name="",Value="",Library="") {if (Detailgrad > 15) {translate([0,-6,8.50]) rotate([270,0,0]) color("DarkSlateGray") import(str(Package_path,"PhoenixContact_1424180.stl"));} else {translate([0,-4.6,8.50]) rotate([90,00,0]) M12_FEMALE_X_CODED_8_TB(); translate([0,-0.75,0]) color("DarkSlateGray") cubepart([15,12.5,14]);}} //X-Codiert 90 +module _1432363(Name="",Value="",Library="") {if (Detailgrad > 15) {translate([0,0,2.45]) rotate([90,0,0]) color("DarkSlateGray") import(str(Package_path,"PhoenixContact_1432363.stl"));} else{color("DarkSlateGray") cylinder(18.6,9/2,9/2); } M12_PHOENIX_HULL();} //A-Codiert 180 +module _1402457(Name="",Value="",Library="") {if (Detailgrad > 15) {translate([0,0,1.1]) rotate([180,0,0]) color("silver") import(str(Package_path,"PhoenixContact_1402457.stl"));} else{M12_FEMALE_X_CODED_8_TB();} color("silver") M12_PHOENIX_HULL();} //X-Codiert 180 +module _1432350(Name="",Value="",Library="") {translate([0,0,1.1]) rotate([90,0,0]) color("silver") import(str(Package_path,"PhoenixContact_1432350.stl"));} //A-Codiert 180 +module _1406409(Name="",Value="",Library="") {color("DarkSlateGray") translate([0,0,19.5]) rotate([00,0,0]) import(str(Package_path,"PhoenixContact_1406409.stl"));} // S codiert +module _1406411(Name="",Value="",Library="") {color("DarkSlateGray") translate([0,0,19.5]) rotate([00,0,0]) import(str(Package_path,"PhoenixContact_1406411.stl"));} // T Codiert +module MSTBV4(Name="",Value="",Library="") {color("LimeGreen") { translate([-11.15,-3.8,0.0]) rotate([90,00,270]) import(str(Package_path,"PhoenixContact_1755765.stl"));BL508(4);}} +module AK500_4(Name="",Value="",Library="") {AK500(4);} + +module BSH_060_01_F_D_A(Name="",Value="",Library="") { color("Gray") rotate([90,0,0]) import(str(Package_path,"SAMTEC_BSH_060_01_F_D_A.stl"));} + +module BTH_060_01_F_D_A(Name="",Value="",Library="") { color("Silver") rotate([90,0,0]) import(str(Package_path,"SAMTEC_BTH_060_01_F_D_A.stl"));} + + + +module MC_5H_38(Name="",Value="",Library="") {color("LimeGreen") { translate([-2*3.81,-3,0.0]) rotate([90,00,270]) import(str(Package_path,"PhoenixContact_1803455.stl")); + translate([-2.6*3.81,-6.4,10.5]) rotate([00,-90,0]) import(str(Package_path,"PhoenixContact_1803604.stl")); }} + +module SV_3_5_2(Name="",Value="",Library="") {color("orange") { translate([3.5,3.5,0]) rotate([0,0,180]) import(str(Package_path,"Weidmueller_BL2_SL35.stl"));translate([-3.5,7,21.5]) rotate([0,180,180]) import(str(Package_path,"Weidmueller_BL2_SK35.stl"));}} + +module MSTBV2(Name="",Value="",Library="") +{ + if (Library=="con-phoenix-508") + { + MSTBV(2,Library); + } + else + { + color("orange") + { translate([5.5,-4.1,20]) rotate([0,180,0]) import(str(Package_path,"Weidmueller_BL2_SK508.stl")); + } + MSTBV(2,Library); + } +} + +module LPHT_04_24_X_RTX_ALIGNT(Name="",Value="",Library="") //U3 LPHT-04-24-X-RTXLPHT-04-24 + { + translate([0.15,16.03,4.070]) rotate([00,180,180]) color("DarkSlateGray") import(str(Package_path,"LPHT_04_24_L_RT1_GP.stl")); + } +module LPHS_04_24_X_VP1_GP(Name="",Value="",Library="") // 70_2990() +{ + translate([18.96,00,0]) rotate([90,0,00]) color("DarkSlateGray") import(str(Package_path,"LPHS_04_24_L_VP1_GP.stl")); +} + + +//module SL_3_5_4(Name="",Value="",Library="") { +//translate([7,-1,0]) rotate([90,00,180]) color("Orange") import("Weidmueller_SL3,5_4.stl")); +//} + +module AK300_2(Name="",Value="",Library=""){translate([0.02,4.13,13.7]) rotate([32.65,0,180]) import(str(Package_path,"AK3002.stl"));} +module HFLEX_P10_2(Name="",Value="",Library="") {translate([0,0,1.6]) rotate([0,0,-90]) import(str(Package_path,"HFLEX_P10.stl"));} +module HFLEX_S10_2(Name="",Value="",Library="") {translate([2.5,17,-8.1]) rotate([90,0,0]) import(str(Package_path,"HFLEX_S10.stl"));} +module WLD3343(Name="",Value="",Library="") {translate([-20.7,16.2,-4.9]) rotate([90,0,0]) import(str(Package_path,"WLD3343.stl"));} + +module _7499111447(Name="",Value="",Library="") {translate([0,0.2,6.7]) rotate([180,0,0]) import(str(Package_path,"WE_7499111447.stl"));} // RJ45 +module 43045_0812(Name="",Value="",Library="") {translate([0,1.5,4.7]) import(str(Package_path,"Molex_43045_0813.stl"));} +module MICROFITS4(Name="",Value="",Library="") {translate([0,0,4.7]) import(str(Package_path,"Molex_43045_0412.stl"));} +module _1437012(Name="",Value="",Library="") {translate([0,-6.3,8.5]) rotate([180,0,0]) import(str(Package_path,"PhoenixContact_1437012.stl"));} +module _693072010801(Name="",Value="",Library="") {translate([4.5,2.8,0]) rotate([0,0,180]) import(str(Package_path,"WE_693072010801a.stl")); + translate([-2.1,-3.95,0]) cube([13.2,13.5,1]);} +module _629722000214(Name="",Value="",Library="") {translate([0.0,2.15,1.55]) import(str(Package_path,"629722000214.stl"));} +module JLEAD(Name="",Value="",Library="") {color("DarkSlateGray") + { + //rotate([90,0,0]) import("/bcm_jlead.stl")); + cubepart(size = [22,32.5,6.73]); + + }} + +// COLOR TOOL +function LEDCOLOR(string) = + !is_string(string)? + undef + : (contains(string , "red",true) || contains(string , "rd",true) || contains(string , "rot",true) || contains(string , "rt",true)) ? + "#FF2000" + : (contains(string , "black",true) || contains(string , "bk",true) || contains(string , "sw",true)|| contains(string , "gelb",true)) ? + "DarkSlateGray" + : (contains(string , "blue",true) || contains(string , "bl",true) || contains(string , "bu",true)|| contains(string , "blau",true)) ? + "Blue" + : (contains(string , "yellow",true) || contains(string , "ye",true) || contains(string , "ge",true)|| contains(string , "gelb",true)) ? + "Yellow" + : (contains(string , "white",true) || contains(string , "wh",true) || contains(string , "ws",true)|| contains(string , "wei",true)) ? + "MintCream" + : (contains(string , "or",true)) ? + "#FF8000" + : "Lime"; + +// MM TOOL +function StrToMMdef(string, def = 10) = + !is_string(string)? + def + : !contains(string, "mm", ignore_case=true)? + def + : parse_int(substring(string, 0, index_of(string,"mm",0,ignore_case=true)[0]), base=10, i=0, nb=def) ; + +// STRING TOOLS +_ASCII_SPACE = 32; +_ASCII_LOWER_A = 97; +_ASCII_LOWER_Z = _ASCII_LOWER_A + 25; +_ASCII = "\t\n\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; +_ASCII_CODE = concat(9,10,13, [for(i=[_ASCII_SPACE : _ASCII_LOWER_Z+4]) i]); + + +function ascii_code(string) = + !is_string(string)? + undef + : + [for (result = search(string, _ASCII, 0)) + result == undef? + undef + : + _ASCII_CODE[result[0]] + ] + ; + +function join(strings, delimeter="") = + strings == undef? + undef + : strings == []? + "" + : _join(strings, len(strings)-1, delimeter); + +function _join(strings, index, delimeter) = + index==0 ? + strings[index] + : str(_join(strings, index-1, delimeter), delimeter, strings[index]) ; + + +function lower(string) = + let(code = ascii_code(string)) + join([for (i = [0:len(string)-1]) + code[i] >= 65 && code[i] <= 90? + chr(code[i]+97-65) + : + string[i] + ]); + +function contains(string, substring, ignore_case=false) = + index_of(string, substring, ignore_case=ignore_case) != undef + ; + + +function index_of(string, pattern, pos=0, ignore_case=false) = + pos == undef? + undef + : pos >= len(string)? + undef + : _coalesce_on([pos, _match(string, pattern, pos, ignore_case=ignore_case)], + [pos, undef], + index_of(string, pattern, pos+1, ignore_case=ignore_case)) + ; + +function _coalesce_on(value, error, fallback) = + value == error? + fallback + : + value + ; + +function _match(string, pattern, pos, ignore_case=false) = +starts_with(string, pattern, pos, ignore_case=ignore_case)? + pos+len(pattern) : undef; + +function starts_with(string, start, pos=0, ignore_case=false) = + equals( substring(string, pos, len(start)), + start, + ignore_case=ignore_case); + +function equals(this, that, ignore_case=false) = + ignore_case? + lower(this) == lower(that) + : + this==that + ; + +function substring(string, start, length=undef) = + length == undef? + between(string, start, len(string)) + : + between(string, start, length+start) + ; + +function between(string, start, end) = + string == undef? + undef + : start == undef? + undef + : start > len(string)? + undef + : start < 0? + before(string, end) + : end == undef? + undef + : end < 0? + undef + : end > len(string)? + after(string, start-1) + : start > end? + undef + : start == end ? + "" + : + join([for (i=[start:end-1]) string[i]]) + ; + +function after(string, index=0) = + string == undef? + undef + : index == undef? + undef + : index < 0? + string + : index >= len(string)-1? + "" + : + join([for (i=[index+1:len(string)-1]) string[i]]) + ; + +function parse_int(string, base=10, i=0, nb=0) = + string[0] == "-" ? + -1*_parse_int(string, base, 1) + : + _parse_int(string, base); + +function _parse_int(string, base, i=0, nb=0) = + i == len(string) ? + nb + : + nb + _parse_int(string, base, i+1, + search(string[i],"0123456789ABCDEF")[0]*pow(base,len(string)-i-1)); + diff --git a/pictures/NodeMCU_Lua_Amica.png b/pictures/NodeMCU_Lua_Amica.png new file mode 100755 index 0000000..f89eb19 Binary files /dev/null and b/pictures/NodeMCU_Lua_Amica.png differ diff --git a/pictures/Pi-Zero-W.png b/pictures/Pi-Zero-W.png new file mode 100755 index 0000000..1a1f4d1 Binary files /dev/null and b/pictures/Pi-Zero-W.png differ diff --git a/ulp/generate-scad.ulp b/ulp/generate-scad.ulp new file mode 100755 index 0000000..68bba9f --- /dev/null +++ b/ulp/generate-scad.ulp @@ -0,0 +1,2258 @@ +// Copyright 2013 J.Lamy, Steve Kelly. All rights reserved. Based on EagleUp. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL J.Lamy OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + +#usage "Exports a board to OpenSCAD\n" +"

Generates a 3D model of the board and components." +"

Documentation avaliable at http://github.com/sjkelly/EagleToOpenSCAD" +"

Author: sjkelly@wpi.edu" +"

Author: mhilde@gmx.de" + + +#require 5.0900 // functions netget, cfgget and cfgset only available on versions 5.9 and newer +// another version is available for older Eagle installations + + +// you can adjust board colors below +// can use any string in w3C SVG color list +// https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#color + +int CONSTANT_MAX = 2147483647; +int fn = 8; +int debug = 0; +string board_colors[] = {"green" , "red" , "DarkRed", "blue" , "DarkSlateGray" , "white" , "#265004", "yellow"}; +string wire_colors[] = {"Goldenrod" , "#7C770F"}; +string pad_colors[] = {"Goldenrod" , "#DFDDE0"}; + +// gloabal variables +string mkdir_cmd, export_path, package_path, cmd; + +int WIREcheklist[]; +int Polystarts[]; +int Polystarts_count; +int PointlistX[]; +int PointlistY[]; +int Pointlist_count; + +string str_debug; // used to buffer the decimal values + +string package_names[]; +int package_angles[]; +int found_Wire = 0; +int found_Round_PAD = 0; + + +void debugout(string s) +{ + if (debug) + { + output("debug.txt" , "atD") + { + printf("%s\n",s); + } + } +} + +real RotateX(real x,real y, real a) +{ + return x*cos(a) - y*sin(a); +} + +real RotateY(real x,real y, real a) +{ + return x*sin(a) + y*cos(a); +} + +// find string s2 in s1, and replace with s3 +string replace_string(string s1, string s2, string s3) { + int i, pos = 0; + string a = s1; + while (pos >= 0) { + pos = strstr(a, s2); + if (pos < 0) + break; + string st1 = strsub(a, 0, pos); + string st2 = strsub(a, pos + strlen(s2)); + a = st1+s3+st2; + } + return a; +} + +string cut_at(string s1, string s2) +{ + return strsub(s1, 0, strstr(s1, s2)); +} + +string FixName(string aInput) +{ + string aOutput; + aOutput = aInput; + aOutput = replace_string( aOutput , "/" , "_" ); + aOutput = replace_string( aOutput , "," , "_" ); + aOutput = replace_string( aOutput , "-" , "_" ); + aOutput = replace_string( aOutput , "." , "_" ); + aOutput = replace_string( aOutput , ">" , "D" ); + aOutput = replace_string( aOutput , "<" , "C" ); + aOutput = replace_string( aOutput , "Ö" , "OE" ); + aOutput = replace_string( aOutput , "ö" , "oe" ); + aOutput = replace_string( aOutput , "Ä" , "AE" ); + aOutput = replace_string( aOutput , "ä" , "ae" ); + aOutput = replace_string( aOutput , "Ü" , "UE" ); + aOutput = replace_string( aOutput , "ü" , "ue" ); + aOutput = replace_string( aOutput , "³" , "3" ); + aOutput = replace_string( aOutput , "²" , "2" ); + aOutput = replace_string( aOutput , "°" , "deg" ); + aOutput = replace_string( aOutput , "$" , "S" ); + aOutput = cut_at(aOutput , "@"); + aOutput = cut_at(aOutput , "("); + return aOutput; +} + +string ExtractFilePath(string Filename) { + int i, pos = 0, lastpos = -1; + string a = Filename; + while (pos >= 0) { + pos = strstr(strsub(a,lastpos+1), "\\"); + if (pos < 0) + break; + lastpos = lastpos + pos+1; + } + if (lastpos >=0 ) { + a = strsub(a, 0, lastpos+1); + } + return replace_string(a, "\\", "/"); +} + +string ExtractFileName(string Filename) { + int i, pos = 0, lastpos = -1; + string a = Filename; + while (pos >= 0) { + pos = strstr(strsub(a,lastpos+1), "\\"); + if (pos < 0) + break; + lastpos = lastpos + pos+1; + } + if (lastpos >=0 ) { + a = strsub(a, lastpos+1); + } + return replace_string(a, "\\", "/"); +} + + +int is_number(string s){ + for(int i = 0; s[i]; i++) + if(!isdigit(s[i])) + return 0; + return 1; +} + + + + + +/* OS detection function suggested by Andreas Weidner +http://www.eaglecentral.ca/forums/index.php?t=msg&goto=139751 */ +int is_windows() +{ + //Returns 1, if EAGLE is running under Windows (0 for Linux/Mac) + if ((strsub(argv[0],0,1)=="/") && (strsub(argv[0],0,2)!="//")) + return 0; + return 1; +} + +/* functions below are used to check and correct the curved edges of the board */ + +real deg_to_rad(real deg){ + return (deg/360)*(2*PI); +} + +/* +real xy2Winkel(real x, real y) +{ + if (x == 0) + { + if (y == 0) return 0; + else if (y > 0) return 90; + else return -90; + } + else + return arctan2(y,x); +} +*/ + +real get_arc_mid_x(UL_ARC arc) +{ + // Get an angle at the midpoint + int x1i, y1i; + real da = deg_to_rad((arc.angle1 - arc.angle2)/2); + if(da > 0) + { + x1i = arc.x1; + y1i = arc.y1; + } + else + { + x1i = arc.x2; + y1i = arc.y2; + } + // rotate point + return ((x1i-arc.xc) * cos(da) - (y1i-arc.yc) * sin(da)) + arc.xc; +} + +real get_arc_mid_y(UL_ARC arc) +{ + // Get an angle at the midpoint + int x1i, y1i; + real da = deg_to_rad((arc.angle1 - arc.angle2)/2); + + if(da > 0) { + x1i = arc.x1; + y1i = arc.y1; + } + else { + x1i = arc.x2; + y1i = arc.y2; + } + // rotate point + return ((x1i-arc.xc) * sin(da) + (y1i-arc.yc) * cos(da)) + arc.yc; +} + +void ScadArc(UL_WIRE Wire) +{ + int i; + real d,x1,y1,x2,y2, da1, da2; + + da1 = deg_to_rad(Wire.arc.angle1); + da2 = deg_to_rad(Wire.arc.angle2); + + d = sqrt(pow(Wire.arc.x1-Wire.arc.xc,2)+pow(Wire.arc.y1-Wire.arc.yc,2)); + for (i = 1; i <= fn; i++) + { + x1 = Wire.arc.xc+d * cos(da1+((i-1)*(da2-da1)/fn)); + y1 = Wire.arc.yc+d * sin(da1+((i-1)*(da2-da1)/fn)); + x2 = Wire.arc.xc+d * cos(da1+(i*(da2-da1)/fn)); + y2 = Wire.arc.yc+d * sin(da1+(i*(da2-da1)/fn)); + printf("\t\t\EagleWire([%.3f,%.3f],[%.3f,%.3f],startdot=1,enddot=1,width=%.3f,$fn=9);\n",u2mm(int(x1)) , u2mm(int(y1)), u2mm(int(x2)) , u2mm(int(y2)) , u2mm(Wire.width)); + } +} + + +real get_wire_max_v(UL_WIRE wire) +{ + if(wire.arc) + return max(wire.y1, max(wire.y2, get_arc_mid_y(wire.arc))); + else + return max(wire.y1, wire.y2); +} + +real get_wire_max_h(UL_WIRE wire) +{ + if(wire.arc) + return max(wire.x1, max(wire.x2, get_arc_mid_x(wire.arc))); + else + return max(wire.x1, wire.x2); +} + +real get_wire_min_v(UL_WIRE wire) +{ + if(wire.arc) + return min(wire.y1, min(wire.y2, get_arc_mid_y(wire.arc))); + else + return min(wire.y1, wire.y2); +} + +real get_wire_min_h(UL_WIRE wire) +{ + if(wire.arc) + return min(wire.x1, min(wire.x2, get_arc_mid_x(wire.arc))); + else + return min(wire.x1, wire.x2); +} + +// list all visible layers in a string with space separation between numbers +string list_active_layers( void ) +{ + string active_layers; + board (B) + { + B.layers(L) + { + if(L.visible == 1) + sprintf( active_layers , "%s %d" , active_layers , L.number ); + } + } + return (active_layers + ";\n"); +} + +void help_box(void) +{ + dlgMessageBox("This is the first time you ran generate-scad.ulp The next \ +window will help you configure your local settings. All your preferences \ +are saved and will be restored when you run generate-scad.ulp the next time."); +} + +void PointlistClear() +{ + Pointlist_count=0; +} + +int PointlistIndexOf(int x, int y) +{ + int exists = 0; + if (Pointlist_count > 0) for (int j = 0; j < Pointlist_count; j++) + { + if ((x == PointlistX[j]) && (y == PointlistY[j])) + { + exists = j+1; + } + } + return exists; +} + + +void InsertPointlistPoint(int x, int y, int pos) +{ + if ((pos <= Pointlist_count) && (pos >= 0)) + { + if (Pointlist_count > 0) for (int j = Pointlist_count-1; j >= pos; j--) + { + PointlistX[j+1] = PointlistX[j]; + PointlistY[j+1] = PointlistY[j]; + } + PointlistX[pos] = x; + PointlistY[pos] = y; + Pointlist_count++; + } +} + +void InsertPointlistArc(UL_WIRE Wire, int Use_Start, int Last, int Position) +{ + int i; + real d,x,y, da1, da2; + + if ((Wire.x1 != Wire.arc.x1) || (Wire.y1 != Wire.arc.y1)) + Use_Start = !Use_Start; + + //return ((x1i-arc.xc) * sin(da) + (y1i-arc.yc) * cos(da)) + arc.yc; + da1 = deg_to_rad(Wire.arc.angle1); + da2 = deg_to_rad(Wire.arc.angle2); + if (!Use_Start) + { + d = sqrt(pow(Wire.arc.x1-Wire.arc.xc,2)+pow(Wire.arc.y1-Wire.arc.yc,2)); } + else + { + d = sqrt(pow(Wire.arc.x2-Wire.arc.xc,2)+pow(Wire.arc.y2-Wire.arc.yc,2)); + } + + if (!Use_Start) + { + for (i = 1; i < fn; i++) + { + x = Wire.arc.xc+d * cos(da1+(i*(da2-da1)/fn)); + y = Wire.arc.yc+d * sin(da1+(i*(da2-da1)/fn)); + InsertPointlistPoint(x, y, Position); + } + if (!Last) + InsertPointlistPoint(Wire.arc.x2, Wire.arc.y2, Position); + } + else + { + for (i = 1; i < fn; i++) + { + x = Wire.arc.xc+d * cos(da2+(i*(da1-da2)/fn)); + y = Wire.arc.yc+d * sin(da2+(i*(da1-da2)/fn)); + InsertPointlistPoint(x, y, Position); + } + if (!Last) + InsertPointlistPoint(Wire.arc.x1, Wire.arc.y1, Position); + } +} + +int PolygonClosed(int x, int y) +{ + // (Pointlist_count > 2) Haut nicht hin wenn das erste ein Arc ist. Also habe ich noch WIREcheklist eingefügt + return ((Pointlist_count > 2) && (PointlistX[Pointlist_count-1] == x) && (PointlistY[Pointlist_count-1] == y)); +} + +int PolygonSCAD(string Name, int zerox, int zeroy, int polyholes) +{ + int starts = 0; + string polygonname = FixName(Name); + if (Pointlist_count > 0) + { + starts = 1; + if (polyholes) // usefull in SCAD but not in Freecad + { + printf("\t%s = [", polygonname); + for (int j = 0; j < Pointlist_count; j++) + { + printf("[%.3f,%.3f]",u2mm(PointlistX[j]-zerox), u2mm(PointlistY[j]-zeroy)); + if (j0 && ((found && !last) || ones)) // !last) + { + found = 0; + Windex = 0; // don't use the first Wire twice + B.wires(W) + { + if( W.layer == layer) + { + // printf("// wire [%.3f,%.3f] [%.3f,%.3f] \n",u2mm(W.x1), u2mm(W.y1),u2mm(W.x2), u2mm(W.y2)); + if (!WIREcheklist[Windex] && ones) + { + Polystarts[Polystarts_count] = Pointlist_count; + Polystarts_count++; + if (!W.arc) + { + InsertPointlistPoint(W.x1, W.y1,Polystarts[Polystarts_count-1] ); + sprintf(str_debug,"Start Wire %d: [%.3f,%.3f] nr %d", Windex, u2mm(W.x1), u2mm(W.y1), Polystarts_count); + } + else + { + InsertPointlistArc(W, 0,0, Polystarts[Polystarts_count-1]); + sprintf(str_debug,"Start Arc %d : [%.3f,%.3f]", Windex, u2mm(W.x1), u2mm(W.y1)); + } + ones = 0; + last = 0; + found = 1; + WIREcheklist[Windex] = 1; + // printf("Arc: (%.3f %.3f), (%.3f %.3f), (%.3f %.3f)\n", + // u2mm(W.arc.x1), u2mm(W.arc.y1), u2mm(W.arc.x2), u2mm(W.arc.y2), u2mm(W.arc.xc), u2mm(W.arc.yc)); + debugout(str_debug); + } + + if (!ones) + { + if (!WIREcheklist[Windex] && (W.x1 == PointlistX[Polystarts[Polystarts_count-1]]) && (W.y1 == PointlistY[Polystarts[Polystarts_count-1]])) + { + if ( !PointlistIndexOf(W.x2, W.y2) || (last = PolygonClosed(W.x2, W.y2))) + { + if (!W.arc) + { + if(!last) + { + InsertPointlistPoint(W.x2, W.y2, Polystarts[Polystarts_count-1]); + sprintf(str_debug,"Next wire %d: from 1[%.3f,%.3f] to 2[%.3f,%.3f]", Windex, u2mm(W.x1), u2mm(W.y1), u2mm(W.x2), u2mm(W.y2)); + } + else + str_debug = "last point!"; + } + else + { + if(!last) + { + InsertPointlistArc(W, 0, last, Polystarts[Polystarts_count-1]); + sprintf(str_debug,"Next arc %d: from 1[%.3f,%.3f] to 2[%.3f,%.3f]", Windex, u2mm(W.x1), u2mm(W.y1), u2mm(W.x2), u2mm(W.y2)); + } + else + str_debug = "last point is arc!"; + // printf("// wire [%.3f,%.3f] [%.3f,%.3f] \n",u2mm(W.x1), u2mm(W.y1),u2mm(W.x2), u2mm(W.y2)); + // printf("// Arc [%.3f,%.3f] [%.3f,%.3f] [%.3f,%.3f]\n",u2mm(W.arc.x1), u2mm(W.arc.y1),u2mm(W.arc.x2), u2mm(W.arc.y2),u2mm(W.arc.xc), u2mm(W.arc.yc)); + } + found = 1; + WIREcheklist[Windex] = 1; + } + } + if (!WIREcheklist[Windex] && (W.x2 == PointlistX[Polystarts[Polystarts_count-1]]) && (W.y2 == PointlistY[Polystarts[Polystarts_count-1]])) + { + if (!PointlistIndexOf(W.x1, W.y1) || (last = PolygonClosed(W.x1, W.y1))) + { + if (!W.arc) + { + if (!last) + { + InsertPointlistPoint(W.x1, W.y1, Polystarts[Polystarts_count-1]); + sprintf(str_debug,"Next wire %d : from 2[%.3f,%.3f] to 1[%.3f,%.3f]", Windex, u2mm(W.x2), u2mm(W.y2), u2mm(W.x1), u2mm(W.y1)); + } + else + str_debug = "last point!"; + } + else + { + if (!last) + { + InsertPointlistArc(W, 1, last, Polystarts[Polystarts_count-1]); + sprintf(str_debug,"Next arc %d: from 2[%.3f,%.3f] to 1[%.3f,%.3f] (Arc:2[%.3f,%.3f] to 1[%.3f,%.3f])",Windex, u2mm(W.x2), u2mm(W.y2), u2mm(W.x1), u2mm(W.y1), u2mm(W.arc.x2), u2mm(W.arc.y2), u2mm(W.arc.x1), u2mm(W.arc.y1)); + } + else + str_debug = "last point is arc!"; + //printf("// wire [%.3f,%.3f] [%.3f,%.3f] \n",u2mm(W.x1), u2mm(W.y1),u2mm(W.x2), u2mm(W.y2)); + //printf("// Arc [%.3f,%.3f] [%.3f,%.3f] [%.3f,%.3f]\n",u2mm(W.arc.x1), u2mm(W.arc.y1),u2mm(W.arc.x2), u2mm(W.arc.y2),u2mm(W.arc.xc), u2mm(W.arc.yc)); + } + found = 1; + WIREcheklist[Windex] = 1; + } + } + } + Windex++; + } + + } + + if (!found || last) + { + debugout("Next Poly"); + for (int idx = 0; idx < Windex; idx++) + { + if (WIREcheklist[idx] == 0) // Wenn naoch was übrig ist + ones = 1; + } + + } + + debugout(str_debug); + str_debug = ""; + for (int idx = 0; idx < Windex; idx++) + { + sprintf(str_debug,"WIREcheklist %d %d", idx, WIREcheklist[idx]); + debugout(str_debug); + str_debug = ""; + } + for ( idx = 0; idx < Polystarts_count; idx++) + { + sprintf(str_debug,"Starts %d %d", idx, Polystarts[idx]); + debugout(str_debug); + str_debug = ""; + } + + } +} + +void PolygonFromPolygon(UL_POLYGON P, int layer) +{ + Pointlist_count = 0; + Polystarts_count = 0; + int found=1; + int ones=1; + int last=0; + int Windex=0; + + P.wires(W) { + if(W.layer == layer) + WIREcheklist[Windex++] = 0; + } + sprintf(str_debug,"Found %d Wires", Windex); + debugout(str_debug); + while (Windex>0 && ((found && !last) || ones)) // !last) + { + found = 0; + Windex = 0; // don't use the first Wire twice + P.wires(W) + { + if( W.layer == layer) + { + // printf("// wire [%.3f,%.3f] [%.3f,%.3f] \n",u2mm(W.x1), u2mm(W.y1),u2mm(W.x2), u2mm(W.y2)); + if (!WIREcheklist[Windex] && ones) + { + Polystarts[Polystarts_count] = Pointlist_count; + Polystarts_count++; + if (!W.arc) + { + InsertPointlistPoint(W.x1, W.y1,Polystarts[Polystarts_count-1] ); + sprintf(str_debug,"Start Wire %d: [%.3f,%.3f] nr %d", Windex, u2mm(W.x1), u2mm(W.y1), Polystarts_count); + } + else + { + InsertPointlistArc(W, 0,0, Polystarts[Polystarts_count-1]); + sprintf(str_debug,"Start Arc %d : [%.3f,%.3f]", Windex, u2mm(W.x1), u2mm(W.y1)); + } + ones = 0; + last = 0; + found = 1; + WIREcheklist[Windex] = 1; + // printf("Arc: (%.3f %.3f), (%.3f %.3f), (%.3f %.3f)\n", + // u2mm(W.arc.x1), u2mm(W.arc.y1), u2mm(W.arc.x2), u2mm(W.arc.y2), u2mm(W.arc.xc), u2mm(W.arc.yc)); + debugout(str_debug); + } + + if (!ones) + { + if (!WIREcheklist[Windex] && (W.x1 == PointlistX[Polystarts[Polystarts_count-1]]) && (W.y1 == PointlistY[Polystarts[Polystarts_count-1]])) + { + if ( !PointlistIndexOf(W.x2, W.y2) || (last = PolygonClosed(W.x2, W.y2))) + { + if (!W.arc) + { + if(!last) + { + InsertPointlistPoint(W.x2, W.y2, Polystarts[Polystarts_count-1]); + sprintf(str_debug,"Next wire %d: from 1[%.3f,%.3f] to 2[%.3f,%.3f]", Windex, u2mm(W.x1), u2mm(W.y1), u2mm(W.x2), u2mm(W.y2)); + } + else + str_debug = "last point!"; + } + else + { + if(!last) + { + InsertPointlistArc(W, 0, last, Polystarts[Polystarts_count-1]); + sprintf(str_debug,"Next arc %d: from 1[%.3f,%.3f] to 2[%.3f,%.3f]", Windex, u2mm(W.x1), u2mm(W.y1), u2mm(W.x2), u2mm(W.y2)); + } + else + str_debug = "last point is arc!"; + // printf("// wire [%.3f,%.3f] [%.3f,%.3f] \n",u2mm(W.x1), u2mm(W.y1),u2mm(W.x2), u2mm(W.y2)); + // printf("// Arc [%.3f,%.3f] [%.3f,%.3f] [%.3f,%.3f]\n",u2mm(W.arc.x1), u2mm(W.arc.y1),u2mm(W.arc.x2), u2mm(W.arc.y2),u2mm(W.arc.xc), u2mm(W.arc.yc)); + } + found = 1; + WIREcheklist[Windex] = 1; + } + } + if (!WIREcheklist[Windex] && (W.x2 == PointlistX[Polystarts[Polystarts_count-1]]) && (W.y2 == PointlistY[Polystarts[Polystarts_count-1]])) + { + if (!PointlistIndexOf(W.x1, W.y1) || (last = PolygonClosed(W.x1, W.y1))) + { + if (!W.arc) + { + if (!last) + { + InsertPointlistPoint(W.x1, W.y1, Polystarts[Polystarts_count-1]); + sprintf(str_debug,"Next wire %d : from 2[%.3f,%.3f] to 1[%.3f,%.3f]", Windex, u2mm(W.x2), u2mm(W.y2), u2mm(W.x1), u2mm(W.y1)); + } + else + str_debug = "last point!"; + } + else + { + if (!last) + { + InsertPointlistArc(W, 1, last, Polystarts[Polystarts_count-1]); + sprintf(str_debug,"Next arc %d: from 2[%.3f,%.3f] to 1[%.3f,%.3f] (Arc:2[%.3f,%.3f] to 1[%.3f,%.3f])",Windex, u2mm(W.x2), u2mm(W.y2), u2mm(W.x1), u2mm(W.y1), u2mm(W.arc.x2), u2mm(W.arc.y2), u2mm(W.arc.x1), u2mm(W.arc.y1)); + } + else + str_debug = "last point is arc!"; + //printf("// wire [%.3f,%.3f] [%.3f,%.3f] \n",u2mm(W.x1), u2mm(W.y1),u2mm(W.x2), u2mm(W.y2)); + //printf("// Arc [%.3f,%.3f] [%.3f,%.3f] [%.3f,%.3f]\n",u2mm(W.arc.x1), u2mm(W.arc.y1),u2mm(W.arc.x2), u2mm(W.arc.y2),u2mm(W.arc.xc), u2mm(W.arc.yc)); + } + found = 1; + WIREcheklist[Windex] = 1; + } + } + } + Windex++; + } + + } + + if (!found || last) + { + debugout("Next Poly"); + for (int idx = 0; idx < Windex; idx++) + { + if (WIREcheklist[idx] == 0) // Wenn naoch was übrig ist + ones = 1; + } + + } + + debugout(str_debug); + str_debug = ""; + for (int idx = 0; idx < Windex; idx++) + { + sprintf(str_debug,"WIREcheklist %d %d", idx, WIREcheklist[idx]); + debugout(str_debug); + str_debug = ""; + } + for ( idx = 0; idx < Polystarts_count; idx++) + { + sprintf(str_debug,"Starts %d %d", idx, Polystarts[idx]); + debugout(str_debug); + str_debug = ""; + } + + } +} + +void PolygonFromPolygonContours(UL_POLYGON P, int layer) +{ + Pointlist_count = 0; + Polystarts_count = 0; + int found=1; + int ones=1; + int last=0; + int Windex=0; + + P.contours(W) { + if(W.layer == layer) + WIREcheklist[Windex++] = 0; + } + sprintf(str_debug,"Found %d Wires", Windex); + debugout(str_debug); + while (Windex>0 && ((found && !last) || ones)) // !last) + { + found = 0; + Windex = 0; // don't use the first Wire twice + P.contours(W) + { + if( W.layer == layer) + { + // printf("// wire [%.3f,%.3f] [%.3f,%.3f] \n",u2mm(W.x1), u2mm(W.y1),u2mm(W.x2), u2mm(W.y2)); + if (!WIREcheklist[Windex] && ones) + { + Polystarts[Polystarts_count] = Pointlist_count; + Polystarts_count++; + if (!W.arc) + { + InsertPointlistPoint(W.x1, W.y1,Polystarts[Polystarts_count-1] ); + sprintf(str_debug,"Start Wire %d: [%.3f,%.3f] nr %d", Windex, u2mm(W.x1), u2mm(W.y1), Polystarts_count); + } + else + { + InsertPointlistArc(W, 0,0, Polystarts[Polystarts_count-1]); + sprintf(str_debug,"Start Arc %d : [%.3f,%.3f]", Windex, u2mm(W.x1), u2mm(W.y1)); + } + ones = 0; + last = 0; + found = 1; + WIREcheklist[Windex] = 1; + // printf("Arc: (%.3f %.3f), (%.3f %.3f), (%.3f %.3f)\n", + // u2mm(W.arc.x1), u2mm(W.arc.y1), u2mm(W.arc.x2), u2mm(W.arc.y2), u2mm(W.arc.xc), u2mm(W.arc.yc)); + debugout(str_debug); + } + + if (!ones) + { + if (!WIREcheklist[Windex] && (W.x1 == PointlistX[Polystarts[Polystarts_count-1]]) && (W.y1 == PointlistY[Polystarts[Polystarts_count-1]])) + { + if ( !PointlistIndexOf(W.x2, W.y2) || (last = PolygonClosed(W.x2, W.y2))) + { + if (!W.arc) + { + if(!last) + { + InsertPointlistPoint(W.x2, W.y2, Polystarts[Polystarts_count-1]); + sprintf(str_debug,"Next wire %d: from 1[%.3f,%.3f] to 2[%.3f,%.3f]", Windex, u2mm(W.x1), u2mm(W.y1), u2mm(W.x2), u2mm(W.y2)); + } + else + str_debug = "last point!"; + } + else + { + if(!last) + { + InsertPointlistArc(W, 0, last, Polystarts[Polystarts_count-1]); + sprintf(str_debug,"Next arc %d: from 1[%.3f,%.3f] to 2[%.3f,%.3f]", Windex, u2mm(W.x1), u2mm(W.y1), u2mm(W.x2), u2mm(W.y2)); + } + else + str_debug = "last point is arc!"; + // printf("// wire [%.3f,%.3f] [%.3f,%.3f] \n",u2mm(W.x1), u2mm(W.y1),u2mm(W.x2), u2mm(W.y2)); + // printf("// Arc [%.3f,%.3f] [%.3f,%.3f] [%.3f,%.3f]\n",u2mm(W.arc.x1), u2mm(W.arc.y1),u2mm(W.arc.x2), u2mm(W.arc.y2),u2mm(W.arc.xc), u2mm(W.arc.yc)); + } + found = 1; + WIREcheklist[Windex] = 1; + } + } + if (!WIREcheklist[Windex] && (W.x2 == PointlistX[Polystarts[Polystarts_count-1]]) && (W.y2 == PointlistY[Polystarts[Polystarts_count-1]])) + { + if (!PointlistIndexOf(W.x1, W.y1) || (last = PolygonClosed(W.x1, W.y1))) + { + if (!W.arc) + { + if (!last) + { + InsertPointlistPoint(W.x1, W.y1, Polystarts[Polystarts_count-1]); + sprintf(str_debug,"Next wire %d : from 2[%.3f,%.3f] to 1[%.3f,%.3f]", Windex, u2mm(W.x2), u2mm(W.y2), u2mm(W.x1), u2mm(W.y1)); + } + else + str_debug = "last point!"; + } + else + { + if (!last) + { + InsertPointlistArc(W, 1, last, Polystarts[Polystarts_count-1]); + sprintf(str_debug,"Next arc %d: from 2[%.3f,%.3f] to 1[%.3f,%.3f] (Arc:2[%.3f,%.3f] to 1[%.3f,%.3f])",Windex, u2mm(W.x2), u2mm(W.y2), u2mm(W.x1), u2mm(W.y1), u2mm(W.arc.x2), u2mm(W.arc.y2), u2mm(W.arc.x1), u2mm(W.arc.y1)); + } + else + str_debug = "last point is arc!"; + //printf("// wire [%.3f,%.3f] [%.3f,%.3f] \n",u2mm(W.x1), u2mm(W.y1),u2mm(W.x2), u2mm(W.y2)); + //printf("// Arc [%.3f,%.3f] [%.3f,%.3f] [%.3f,%.3f]\n",u2mm(W.arc.x1), u2mm(W.arc.y1),u2mm(W.arc.x2), u2mm(W.arc.y2),u2mm(W.arc.xc), u2mm(W.arc.yc)); + } + found = 1; + WIREcheklist[Windex] = 1; + } + } + } + Windex++; + } + + } + + if (!found || last) + { + debugout("Next Poly"); + for (int idx = 0; idx < Windex; idx++) + { + if (WIREcheklist[idx] == 0) // Wenn naoch was übrig ist + ones = 1; + } + + } + + debugout(str_debug); + str_debug = ""; + for (int idx = 0; idx < Windex; idx++) + { + sprintf(str_debug,"WIREcheklist %d %d", idx, WIREcheklist[idx]); + debugout(str_debug); + str_debug = ""; + } + for ( idx = 0; idx < Polystarts_count; idx++) + { + sprintf(str_debug,"Starts %d %d", idx, Polystarts[idx]); + debugout(str_debug); + str_debug = ""; + } + + } +} + + +int Already_exist(string package_name, int n) +{ + int found = 0; + for (int j = 0; j < n; j++) + { + if (package_names[j] == package_name) + found = 1; + } + return found; +} + + +// only runs in the board, not schematic or library +if (board) board(B) + { + int major_version = 1; + int minor_version = 6; + + // Version Number + string genscad_version; + sprintf( genscad_version , "%d.%d" , major_version , minor_version); + + //Options + real board_thickness; + int show_dialog; + int use_relative_coordinates; + int board_color_selected; + int hideautoparts; + int wire_color_selected; + int pad_color_selected; + int outline_layer; + int solder_mask; + int board_only; + int import_partpolygones; + int skip_vias; + int process_polygones; + int print_wires; + int print_text; + int print_measures; + int polygon_with_holdes = 0; + + string active_layers = list_active_layers(); + + // read parameters from user's eaglerc file, if first run => use default values + //***5.9 + // Beim Aufruf über Python kann es sein, dass die „eaglerc.usr“ im „user Verzeichnis“ benötigt + // wird. Das passt gut, wir kopieren sie von C:\Users\\AppData\Roaming\CadSoft\EAGLE\eaglerc.usr + // Neu in C:\Users\\AppData\Roaming\Eagle\settings\9.6.2\eaglerc + // cfgget("EAGLE:Option.SignalNamesOnPads", "0"); + + board_thickness = strtod(cfgget("genscad.board_thickness" , "1.6")); + fn = strtol(cfgget( "genscad.detail" , "20")); // default => 20 + show_dialog = strtol(cfgget("genscad.show_dialog" , "1")); // default => true + hideautoparts = strtol(cfgget("genscad.hideautoparts" , "1")); // default => true + use_relative_coordinates = strtol(cfgget("genscad.use_relative_coordinates" , "1")); // default => true + board_color_selected = strtol(cfgget("genscad.board_color_selected" , "1")); // default => red + wire_color_selected = strtol(cfgget("genscad.wire_color_selected" , "0")); // default => Goldenrod + pad_color_selected = strtol(cfgget("genscad.pad_color_selected" , "0")); // default => Goldenrod + outline_layer = strtol(cfgget( "genscad.outline_layer" , "0")); // default => dimension + solder_mask = strtol(cfgget( "genscad.solder_mask" , "0")); // default => dimension + board_only = strtol(cfgget( "genscad.board_only" , "0")); // default => disabled + import_partpolygones = strtol(cfgget( "genscad.import_partpolygones" , "0")); // default => disabled + export_path = cfgget("genscad.export_path" , ""); + package_path = cfgget("genscad.package_path" , "../packages/packages.scad"); + skip_vias = strtol(cfgget( "genscad.skip_vias" , "1")); // default => disabled + process_polygones = strtol(cfgget( "genscad.process_polygones" , "0")); // default => disabled + print_wires = strtol(cfgget( "genscad.print_wires" , "0")); // default => disabled + print_text = strtol(cfgget( "genscad.print_text" , "0")); // default => disabled + print_measures = strtol(cfgget( "genscad.print_measures" , "0")); // default => disabled + string board_thickness_unit[] = {"mm","mils","inch"}; + int board_thickness_unit_selected = 0; // mm selected by default + + // automatic OS detection for OS specific commands + if( is_windows() ) + { + mkdir_cmd = "cmd.exe /c mkdir"; // include system call + } + else + { + mkdir_cmd = "mkdir"; // on linux and mac OS, no need to call terminal + } + int previous_unit = board_thickness_unit_selected; + + if (show_dialog && ((argc == 0) || (argv[1] != "silent"))) + { + int dlg_accepted = dlgDialog("Generate-OpenSCAD " + genscad_version + " Parameters") + { + dlgHBoxLayout + { + dlgStretch(1); + dlgVBoxLayout + { + dlgStretch(1); + dlgGroup("Preferences​") + { + dlgHBoxLayout + { + dlgCheckBox("Show this dialog!", show_dialog); + } + }; + dlgGroup("Position") + { + dlgHBoxLayout + { + dlgCheckBox("Relative Coordinates", use_relative_coordinates); + } + }; + dlgGroup("Outline layer") + { + dlgHBoxLayout + { + dlgRadioButton("(20) Dimension", outline_layer); + dlgRadioButton("(46) Milling", outline_layer); + } + }; + dlgGroup("Solder Mask") + { + dlgHBoxLayout + { + dlgRadioButton("simple", solder_mask); + dlgRadioButton("polygones (experimantal)", solder_mask); + } + }; + dlgGroup("Parts") + { + dlgHBoxLayout + { + dlgCheckBox("Board only (no parts)", board_only); + dlgCheckBox("Hide autoparts", hideautoparts); + dlgCheckBox("tPlace & bPlace polygones", import_partpolygones); + } + }; + dlgGroup("Wire") + { + dlgHBoxLayout + { + dlgCheckBox("print wires (slower)", print_wires); + dlgCheckBox("process polygones", process_polygones); + } + }; + dlgGroup("Misc") + { + dlgHBoxLayout + { + dlgCheckBox("skip vias (quicker)", skip_vias); + dlgCheckBox("print text (slower)", print_text); + dlgCheckBox("print measures",print_measures); + } + }; + dlgGridLayout { + dlgCell( 1 , 0 ) dlgLabel("Board thickness"); + dlgCell( 1 , 1 ) dlgHBoxLayout { + dlgRealEdit(board_thickness, 0.0, 500.0); + dlgComboBox(board_thickness_unit, board_thickness_unit_selected) + { + if ( previous_unit==0 && board_thickness_unit_selected==1) + board_thickness /= 0.0254; + else if ( previous_unit==0 && board_thickness_unit_selected==2) + board_thickness /= 25.4; + else if ( previous_unit==1 && board_thickness_unit_selected==0) + board_thickness *= 0.0254; + else if ( previous_unit==1 && board_thickness_unit_selected==2) + board_thickness /= 1000; + else if ( previous_unit==2 && board_thickness_unit_selected==0) + board_thickness *= 25.4; + else if ( previous_unit==2 && board_thickness_unit_selected==1) + board_thickness *= 1000; + previous_unit = board_thickness_unit_selected; + }; + } + dlgCell( 2 , 0 ) dlgLabel("$fn"); + dlgCell( 2 , 1 ) dlgIntEdit(fn, 1, 200); + dlgCell( 3 , 0 ) dlgLabel("Solder mask color"); + dlgCell( 3 , 1 ) dlgComboBox(board_colors, board_color_selected); + dlgCell( 4 , 0 ) dlgLabel("Wire color"); + dlgCell( 4 , 1 ) dlgComboBox(wire_colors, wire_color_selected); + dlgCell( 5 , 0 ) dlgLabel("Pad color"); + dlgCell( 5 , 1 ) dlgComboBox(pad_colors, pad_color_selected); + dlgCell( 6 , 0 ) dlgLabel("Export subfolder"); + dlgCell( 6 , 1 ) dlgStringEdit(export_path); + dlgCell( 7 , 0 ) dlgLabel("Package Library"); + dlgCell( 8 , 1 ) dlgStringEdit(package_path); + } + dlgHBoxLayout { + dlgStretch(1); + dlgPushButton("+OK") dlgAccept(1); + dlgPushButton("Cancel") dlgReject(-1); + dlgPushButton("Help") help_box(); + dlgStretch(1); + } + dlgStretch(1); + } + dlgStretch(1); + } + }; + + if( dlg_accepted == -1) + exit(-1); + } + // adjust board thickness in case of units != mm + if( board_thickness_unit_selected == 1) + board_thickness *= 0.0254; + else if( board_thickness_unit_selected == 2) + board_thickness *= 25.4; + + /* save in user's eaglerc file the settings */ + string str_setting; // used to buffer the decimal values + + sprintf(str_setting, "%.2f", board_thickness); + cfgset("genscad.board_thickness", str_setting); + sprintf(str_setting, "%d", fn); + cfgset("genscad.detail", str_setting); + sprintf(str_setting, "%d", show_dialog); + cfgset("genscad.show_dialog", str_setting); + sprintf(str_setting, "%d", hideautoparts); + cfgset("genscad.hideautoparts", str_setting); + sprintf(str_setting, "%d", use_relative_coordinates); + cfgset("genscad.use_relative_coordinates", str_setting); + sprintf(str_setting, "%d", board_color_selected); + cfgset("genscad.board_color_selected", str_setting); + sprintf(str_setting, "%d", wire_color_selected); + cfgset("genscad.wire_color_selected", str_setting); + sprintf(str_setting, "%d", pad_color_selected); + cfgset("genscad.pad_color_selected", str_setting); + sprintf(str_setting, "%d", outline_layer); + cfgset("genscad.outline_layer", str_setting); + sprintf(str_setting, "%d", solder_mask); + cfgset("genscad.solder_mask", str_setting); + sprintf(str_setting, "%d", board_only); + cfgset("genscad.board_only", str_setting); + sprintf(str_setting, "%d", import_partpolygones); + cfgset("genscad.import_partpolygones", str_setting); + cfgset("genscad.export_path", export_path); + cfgset("genscad.package_path", package_path); + sprintf(str_setting, "%d", skip_vias); + cfgset("genscad.skip_vias", str_setting); + sprintf(str_setting, "%d", process_polygones); + cfgset("genscad.process_polygones", str_setting); + sprintf(str_setting, "%d", print_wires); + cfgset("genscad.print_wires", str_setting); + sprintf(str_setting, "%d", print_text); + cfgset("genscad.print_text", str_setting); + sprintf(str_setting, "%d", print_measures); + cfgset("genscad.print_measures", str_setting); + +// if subfolder defined, and does not exist, create it automatically +// unfortunately this uses a system() call and a popup for the user in versions < 5.11 + if( export_path != "" ) + { + string a[]; + int folder_found =0; + int nglob = fileglob(a, filedir(B.name) + "*"); + for( int i=0 ; i 1) + { + printf("\t\t\t\ttranslate(board_origin) for (a = [1 : len(board_polygons)-1]) polygon(board_polygons[a]);\n"); + } + } + + + // list the holes of the board hole, x, y, radius, + + B.holes(H) + { + printf("\t\t\t\ttranslate([%.3f,%.3f]) circle(r=%.3f,$fn=$fn); \/\/Hole\n", u2mm(H.x) , u2mm(H.y) , u2mm(H.drill)/2); + } + + printf("\t\t\t\tif (Detailgrad > 9) // Drill part holes \n"); + printf("\t\t\t\t{\n"); + B.elements(E) + { + E.package.holes(H) + { + printf("\t\t\t\t\ttranslate([%.3f,%.3f])circle(r=%.3f,$fn=$fn); \/\/hole\n", + u2mm(H.x) , u2mm(H.y) , u2mm(H.drill)/2); + } + } + + + B.elements(E) + { + E.package.contacts(C) + { + if (C.pad) + { + printf("\t\t\t\t\ttranslate([%.3f,%.3f])circle(r=%.3f,$fn=$fn); \/\/%s %s\n", + u2mm(C.x) , u2mm(C.y) , u2mm(C.pad.drill)/2, E.package.name, C.name); + } + } + } + + int holes=0; + if( skip_vias == 0 ) //vias are slow to process in Sketchup so this can save a lot of time + { + holes = 0; + B.signals(S) S.vias(V) holes++; + if (holes > 0) + { + if(!skip_vias) + { + printf("\t\t\t\t\tif (EnableVias && (Detailgrad > 12)) \n \t\t\t\t\tunion() // Vias \n\t\t\t\t\t{\n"); + } + B.signals(S) + { + S.vias(V) + { + printf("\t\t\t\t\t\ttranslate([%.3f,%.3f])circle(r=%.3f,$fn=$fn); \/\/via\n", + u2mm(V.x) , u2mm(V.y) , u2mm(V.drill)/2); + } + } + printf("\t\t\t\t\t} // End Vias\n"); + } + } + + printf("\t\t\t\t} // end Drill part holes\n"); + //brace to end the differenc eof the board and holes + printf("\t\t\t} //end difference() PCB and holes \n"); + + printf("\t\t\tif (holewithorigin) \n"); + printf("\t\t\t{\n"); + printf("\t\t\t\t//Print a little cross in the PCB holes \n"); + B.holes(H) + { + printf("\t\t\t\t\ttranslate([%.3f,%.3f]) { polygon([[0,0],[%.2f,%.2f],[%.2f,%.2f]]); polygon([[0,0],[%.2f,%.2f],[%.2f,%.2f]]);} \/\/Hole\n", + u2mm(H.x) , u2mm(H.y), -u2mm(H.drill)/8, -u2mm(H.drill)/8, -u2mm(H.drill)/8, u2mm(H.drill)/8, u2mm(H.drill)/8, u2mm(H.drill)/8, u2mm(H.drill)/8, -u2mm(H.drill)/8); + } + printf("\t\t\t}\n"); + printf("\t\t} //end union() // PCB \n"); + + // Soldermask + if (solder_mask == 0) + { + PolygonFromBoard(B, 29); // >Tstop + starts; + Pindex = Pindex + 1; + string PolyName; + printf("\t\t\t\t"); + sprintf(PolyName,"L22_polygons%d", Pindex); + if (use_relative_coordinates) + starts = PolygonSCAD(PolyName, min_h, min_v, polygon_with_holdes); + else + starts = PolygonSCAD(PolyName, 0, 0, polygon_with_holdes); + if (starts>0) + printf("\t\t\t\ttranslate(board_origin) color(\"Khaki\",0.7) translate([0,0,board_thickness-0.009]) linear_extrude(height=0.035,center=false, convexity=10) for (a = [0 : len(%s)-1]) polygon(%s[a]);\n", PolyName, PolyName); + } + + + /* END PCB */ + + /* Generate Layout + * =============== + */ + // TOPLAYER + // PADS + printf("\t\tif (Detailgrad > 10) color(\"%s\",1) translate([0,0,board_thickness-0.017]) linear_extrude(height=0.040,center=false, convexity=10) difference() { \n\t union() { \n\t\t", pad_colors[pad_color_selected]); // Toplayer + B.elements(E) + { + E.package.contacts(C) + { + if (C.smd) + { + if (C.smd.layer == LAYER_TOP) + { + if (C.smd.roundness == 0) + { + if (C.smd.angle) + printf("\t\t\ttranslate([%.3f,%.3f]) rotate([0,0,%.3f]) square([%.3f,%.3f], center = true); \/\/%s %s\n", + u2mm(C.x) , u2mm(C.y) , C.smd.angle, u2mm(C.smd.dx), u2mm(C.smd.dy), E.package.name, C.name); + else + printf("\t\t\ttranslate([%.3f,%.3f]) square([%.3f,%.3f], center = true); \/\/%s %s\n", + u2mm(C.x) , u2mm(C.y) , u2mm(C.smd.dx), u2mm(C.smd.dy), E.package.name, C.name); + } + else + { + printf("\t\t\ttranslate([%.3f,%.3f]) rotate([0,0,%.3f]) EaglePad([%.3f,%.3f], %d); \/\/%s %s\n", + u2mm(C.x) , u2mm(C.y) , C.smd.angle, u2mm(C.smd.dx), u2mm(C.smd.dy), C.smd.roundness, E.package.name, C.name); + found_Round_PAD = 1; + } + } + } + else if (C.pad) + { + if (C.pad.shape[LAYER_TOP] == PAD_SHAPE_SQUARE) + printf("\t\t\ttranslate([%.3f,%.3f]) rotate([0,0,%.3f]) square(%.3f, center = true, $fn=$fn);\n",u2mm(C.x) , u2mm(C.y), C.pad.angle, u2mm(C.pad.diameter[LAYER_TOP])); + else if (C.pad.shape[LAYER_TOP] == PAD_SHAPE_OCTAGON) + printf("\t\t\ttranslate([%.3f,%.3f]) rotate([0,0,%.3f]) circle(r=%.3f,$fn=8);\n",u2mm(C.x) , u2mm(C.y), C.pad.angle + 22.5 , u2mm(C.pad.diameter[LAYER_TOP])/(2*cos(deg_to_rad(22.5)))); + else if (C.pad.shape[LAYER_TOP] == PAD_SHAPE_LONG) + { + found_Round_PAD = 1; + printf("\t\t\ttranslate([%.3f,%.3f]) rotate([0,0,%.3f]) EaglePad([%.3f,%.3f], 100); \/\/%s %s\n", + u2mm(C.x) , u2mm(C.y) , C.pad.angle + 90, u2mm(C.pad.diameter[LAYER_TOP]), u2mm(C.pad.diameter[LAYER_TOP]*(1+C.pad.elongation/100)), E.package.name, C.name); + } + else if (C.pad.shape[LAYER_TOP] == PAD_SHAPE_OFFSET) + { + found_Round_PAD = 1; + printf("\t\t\ttranslate([%.3f,%.3f]) rotate([0,0,%.3f]) translate([0,%.3f]) EaglePad([%.3f,%.3f], 100); \/\/%s %s\n", + u2mm(C.x) , u2mm(C.y) , C.pad.angle + 90, u2mm(0-C.pad.diameter[LAYER_TOP]/2), u2mm(C.pad.diameter[LAYER_TOP]), u2mm(C.pad.diameter[LAYER_TOP]*(1+C.pad.elongation/100)), E.package.name, C.name); + } + else + printf("\t\t\ttranslate([%.3f,%.3f]) circle(r=%.3f,$fn=$fn);\n",u2mm(C.x) , u2mm(C.y) , u2mm(C.pad.diameter[LAYER_TOP])/2); + } + } + } + printf("\t\t}\n"); + // pad drill + B.elements(E) + { + E.package.contacts(C) + { + if (C.pad) + { + printf("\t\t\ttranslate([%.3f,%.3f]) circle(r=%.3f,$fn=$fn);\n",u2mm(C.x) , u2mm(C.y) , u2mm(C.pad.drill)/2); + } + } + } + + printf("\n\t\t}\n"); + + if( print_wires) // TOP + { + printf("\t\tif (EnableWires && (Detailgrad > 12)) color(\"%s\",1) translate([0,0,board_thickness-0.017]) linear_extrude(height=0.035,center=false, convexity=10) difference() { \n\t union() { \n\t\t",wire_colors[wire_color_selected]); // Toplayer + + // wires + PointlistClear(); + B.signals(S) S.wires(W) + { + if ((W.layer == LAYER_TOP)) + { + //printf("\t\t\ hull(){"); + // printf("\t\t\ttranslate([%.3f,%.3f]) circle(r=%.3f,$fn=$fn);\n",u2mm(W.x1) , u2mm(W.y1) , u2mm(W.width)/2); + // printf("\t\t\ttranslate([%.3f,%.3f]) circle(r=%.3f,$fn=$fn);\n",u2mm(W.x2) , u2mm(W.y2) , u2mm(W.width)/2); + // printf("\t\t}\n"); + + if (W.arc) + { + ScadArc(W); + } + else + { + if (PointlistIndexOf(W.x1, W.y1)) + { + if (PointlistIndexOf(W.x2, W.y2)) + printf("\t\t\EagleWire([%.3f,%.3f],[%.3f,%.3f],startdot=0,enddot=0,width=%.3f,$fn=9);\n",u2mm(W.x1) , u2mm(W.y1), u2mm(W.x2) , u2mm(W.y2) , u2mm(W.width)); + else + printf("\t\t\EagleWire([%.3f,%.3f],[%.3f,%.3f],startdot=0,enddot=1,width=%.3f,$fn=9);\n",u2mm(W.x1) , u2mm(W.y1), u2mm(W.x2) , u2mm(W.y2) , u2mm(W.width)); + } + else + { + + if (PointlistIndexOf(W.x2, W.y2)) + printf("\t\t\EagleWire([%.3f,%.3f],[%.3f,%.3f],startdot=1,enddot=0,width=%.3f,$fn=9);\n",u2mm(W.x1) , u2mm(W.y1), u2mm(W.x2) , u2mm(W.y2) , u2mm(W.width)); + else + printf("\t\t\EagleWire([%.3f,%.3f],[%.3f,%.3f],startdot=1,enddot=1,width=%.3f,$fn=9);\n",u2mm(W.x1) , u2mm(W.y1), u2mm(W.x2) , u2mm(W.y2) , u2mm(W.width)); + } + } + if (!PointlistIndexOf(W.x1, W.y1)) InsertPointlistPoint(W.x1, W.y1,0); + if (!PointlistIndexOf(W.x2, W.y2)) InsertPointlistPoint(W.x2, W.y2,0); + found_Wire = 1; + } + } + // Signal Polygon + if (process_polygones) + { + Pindex = 0; + B.signals(S) S.polygons(P) + { + PolygonFromPolygonContours(P, LAYER_TOP); + int starts; + Pindex = Pindex + 1; + string PolyName; + sprintf(PolyName,"TOP_polygons%d", Pindex); + printf("\t\t\t\t"); + if (use_relative_coordinates) + starts = PolygonSCAD(PolyName, min_h, min_v, polygon_with_holdes); + else + starts = PolygonSCAD(PolyName, 0, 0, polygon_with_holdes); + if (starts>0) + printf("\t\t\t\ttranslate(board_origin) for (a = [0 : len(%s)-1]) polygon(%s[a]);\n", PolyName, PolyName); + } + } + // vias + + B.signals(S) S.vias(V) + { + if ((V.start == LAYER_TOP)) + { + printf("\t\t\ttranslate([%.3f,%.3f]) circle(r=%.3f,$fn=$fn);\n",u2mm(V.x) , u2mm(V.y) , u2mm(V.diameter[V.start])/2); + } + + } + + printf("\t\t}\n"); // End Union of Wires and PADS + + if(!skip_vias) + { + holes = 0; + B.signals(S) S.vias(V) + { + if (V.start == LAYER_TOP) + holes++; + } + if (holes > 0) + { + printf("\t\t\t\t\tif (EnableVias && (Detailgrad > 12)) \n \t\t\t\t\tunion() // Vias \n\t\t\t\t\t{\n"); + + // vias drill + B.signals(S) S.vias(V) + { + if ((V.start == LAYER_TOP)) + { + if( skip_vias == 0 ) + printf("\t\t\t\ttranslate([%.3f,%.3f]) circle(r=%.3f,$fn=$fn);\n",u2mm(V.x) , u2mm(V.y) , u2mm(V.drill)/2); + } + + } + printf("\t\t}\n"); + } + } + + printf("\n\t\t}\n"); + } + + + Pindex = 0; + if (import_partpolygones) + { + printf("\t\t\tif (EnablePolygones) {\n"); + B.polygons(P) + { + PolygonFromPolygon(P, 21); // >TPlace + int starts; + Pindex = Pindex + 1; + string PolyName; + sprintf(PolyName,"L21_polygons%d", Pindex); + printf("\t\t\t\t"); + starts = PolygonSCAD(PolyName, 0, 0, polygon_with_holdes); + if (starts>0) + printf("\t\t\t\ttranslate(board_origin) color(\"white\",0.7) translate([0,0,board_thickness-0.017]) linear_extrude(height=0.035,center=false, convexity=10) for (a = [0 : len(%s)-1]) polygon(%s[a]);\n", PolyName, PolyName); + } + printf("\t\t\t}\n"); + } + // LAYER_BOTTOM + // PADS + printf("\t\tif (Detailgrad > 10) color(\"%s\",1) translate([0,0,-0.022]) linear_extrude(height=0.040,center=false, convexity=10) difference() { \n\t union() { \n\t\t", pad_colors[pad_color_selected]); // Toplayer + B.elements(E) + { + E.package.contacts(C) + { + if (C.smd) + { + if (C.smd.layer == LAYER_BOTTOM) + { + if (C.smd.roundness == 0) + { + if (C.smd.angle) + printf("\t\t\ttranslate([%.3f,%.3f]) rotate([0,0,%.3f]) square([%.3f,%.3f], center = true); \/\/%s %s\n", + u2mm(C.x) , u2mm(C.y) , C.smd.angle, u2mm(C.smd.dx), u2mm(C.smd.dy), E.package.name, C.name); + else + printf("\t\t\ttranslate([%.3f,%.3f]) square([%.3f,%.3f], center = true); \/\/%s %s\n", + u2mm(C.x) , u2mm(C.y) , u2mm(C.smd.dx), u2mm(C.smd.dy), E.package.name, C.name); + } + else + { + printf("\t\t\ttranslate([%.3f,%.3f]) rotate([0,0,%.3f]) EaglePad([%.3f,%.3f], %d); \/\/%s %s\n", + u2mm(C.x) , u2mm(C.y) , C.smd.angle, u2mm(C.smd.dx), u2mm(C.smd.dy), C.smd.roundness, E.package.name, C.name); + found_Round_PAD = 1; + } + + + } + } + else if (C.pad) + { + if (C.pad.shape[LAYER_BOTTOM] == PAD_SHAPE_SQUARE) + printf("\t\t\ttranslate([%.3f,%.3f]) rotate([0,0,%.3f]) square(%.3f, center = true, $fn=$fn);\n",u2mm(C.x) , u2mm(C.y), C.pad.angle, u2mm(C.pad.diameter[LAYER_BOTTOM])); + else if (C.pad.shape[LAYER_BOTTOM] == PAD_SHAPE_OCTAGON) + printf("\t\t\ttranslate([%.3f,%.3f]) rotate([0,0,%.3f]) circle(r=%.3f,$fn=8);\n",u2mm(C.x) , u2mm(C.y), C.pad.angle + 22.5 , u2mm(C.pad.diameter[LAYER_BOTTOM])/(2*cos(deg_to_rad(22.5)))); + else if (C.pad.shape[LAYER_BOTTOM] == PAD_SHAPE_LONG) + { + found_Round_PAD = 1; + printf("\t\t\ttranslate([%.3f,%.3f]) rotate([0,0,%.3f]) EaglePad([%.3f,%.3f], 100); \/\/%s %s\n", + u2mm(C.x) , u2mm(C.y) , C.pad.angle + 90, u2mm(C.pad.diameter[LAYER_BOTTOM]), u2mm(C.pad.diameter[LAYER_BOTTOM]*(1+C.pad.elongation/100)), E.package.name, C.name); + } + else if (C.pad.shape[LAYER_BOTTOM] == PAD_SHAPE_OFFSET) + { + found_Round_PAD = 1; + printf("\t\t\ttranslate([%.3f,%.3f]) rotate([0,0,%.3f]) translate([0,%.3f]) EaglePad([%.3f,%.3f], 100); \/\/%s %s\n", + u2mm(C.x) , u2mm(C.y) , C.pad.angle + 90, u2mm(0-C.pad.diameter[LAYER_BOTTOM]/2), u2mm(C.pad.diameter[LAYER_BOTTOM]), u2mm(C.pad.diameter[LAYER_BOTTOM]*(1+C.pad.elongation/100)), E.package.name, C.name); + } + else + printf("\t\t\ttranslate([%.3f,%.3f]) circle(r=%.3f,$fn=$fn);\n",u2mm(C.x) , u2mm(C.y) , u2mm(C.pad.diameter[LAYER_BOTTOM])/2); + + } + } + + } + printf("\t\t}\n"); + // pad drill + B.elements(E) + { + E.package.contacts(C) + { + if (C.pad) + { + printf("\t\t\ttranslate([%.3f,%.3f]) circle(r=%.3f,$fn=$fn);\n",u2mm(C.x) , u2mm(C.y) , u2mm(C.pad.drill)/2); + } + } + } + printf("\n\t\t}\n"); + + if( print_wires) // BOTTOM + { + // wires + printf("\t\tif (EnableWires && (Detailgrad > 12)) color(\"%s\",1) translate([0,0,-0.017]) linear_extrude(height=0.035,center=false, convexity=10) difference() { \n\t union() { \n\t\t",wire_colors[wire_color_selected]); // Botomlayer + PointlistClear(); + B.signals(S) S.wires(W) + { + if ((W.layer == LAYER_BOTTOM)) + { + //printf("\t\t\ hull(){"); + //printf("\t\t\ttranslate([%.3f,%.3f]) circle(r=%.3f,$fn=$fn);\n",u2mm(W.x1) , u2mm(W.y1) , u2mm(W.width)/2); + //printf("\t\t\ttranslate([%.3f,%.3f]) circle(r=%.3f,$fn=$fn);\n",u2mm(W.x2) , u2mm(W.y2) , u2mm(W.width)/2); + //printf("\t\t}\n"); + if (W.arc) + { + ScadArc(W); + } + else + { + if (PointlistIndexOf(W.x1, W.y1)) + { + if (PointlistIndexOf(W.x2, W.y2)) + printf("\t\t\EagleWire([%.3f,%.3f],[%.3f,%.3f],startdot=0,enddot=0,width=%.3f,$fn=9);\n",u2mm(W.x1) , u2mm(W.y1), u2mm(W.x2) , u2mm(W.y2) , u2mm(W.width)); + else + printf("\t\t\EagleWire([%.3f,%.3f],[%.3f,%.3f],startdot=0,enddot=1,width=%.3f,$fn=9);\n",u2mm(W.x1) , u2mm(W.y1), u2mm(W.x2) , u2mm(W.y2) , u2mm(W.width)); + } + else + { + + if (PointlistIndexOf(W.x2, W.y2)) + printf("\t\t\EagleWire([%.3f,%.3f],[%.3f,%.3f],startdot=1,enddot=0,width=%.3f,$fn=9);\n",u2mm(W.x1) , u2mm(W.y1), u2mm(W.x2) , u2mm(W.y2) , u2mm(W.width)); + else + printf("\t\t\EagleWire([%.3f,%.3f],[%.3f,%.3f],startdot=1,enddot=1,width=%.3f,$fn=9);\n",u2mm(W.x1) , u2mm(W.y1), u2mm(W.x2) , u2mm(W.y2) , u2mm(W.width)); + } + } + if (!PointlistIndexOf(W.x1, W.y1)) InsertPointlistPoint(W.x1, W.y1,0); + if (!PointlistIndexOf(W.x2, W.y2)) InsertPointlistPoint(W.x2, W.y2,0); + + found_Wire = 1; + } + } + // Signal Polygon + if (process_polygones) + { + Pindex = 0; + B.signals(S) S.polygons(P) + { + PolygonFromPolygonContours(P, LAYER_BOTTOM); + int starts; + Pindex = Pindex + 1; + string PolyName; + sprintf(PolyName,"BOTTOM_polygons%d", Pindex); + printf("\t\t\t\t"); + if (use_relative_coordinates) + starts = PolygonSCAD(PolyName, min_h, min_v, polygon_with_holdes); + else + starts = PolygonSCAD(PolyName, 0, 0, polygon_with_holdes); + if (starts>0) + printf("\t\t\t\ttranslate(board_origin) for (a = [0 : len(%s)-1]) polygon(%s[a]);\n", PolyName, PolyName); + } + } + // vias drill + B.signals(S) S.vias(V) + { + if ((V.end == LAYER_BOTTOM)) + { + printf("\t\t\ttranslate([%.3f,%.3f]) circle(r=%.3f,$fn=$fn);\n",u2mm(V.x) , u2mm(V.y) , u2mm(V.diameter[V.end])/2); + } + + } + printf("\t\t}\n"); + + // vias drill + if(!skip_vias) + { + holes = 0; + B.signals(S) S.vias(V) + { + if (V.end == LAYER_BOTTOM) + holes++; + } + if (holes > 0) + { + printf("\t\t\t\t\tif (EnableVias && (Detailgrad > 12)) \n \t\t\t\t\tunion() // Vias \n\t\t\t\t\t{\n"); + B.signals(S) S.vias(V) + { + if ((V.end == LAYER_BOTTOM)) + { + printf("\t\t\t\ttranslate([%.3f,%.3f]) circle(r=%.3f,$fn=$fn);\n",u2mm(V.x) , u2mm(V.y) , u2mm(V.drill)/2); + } + } + printf("\n\t\t\t}\n"); + } + } + printf("\n\t\t}\n"); + } + + if (import_partpolygones) + { + printf("\t\t\tif (EnablePolygones) {\n"); + B.polygons(P) + { + PolygonFromPolygon(P, 22); // >BPlace + int starts; + Pindex = Pindex + 1; + string PolyName; + printf("\t\t\t\t"); + sprintf(PolyName,"L22_polygons%d", Pindex); + if (use_relative_coordinates) + starts = PolygonSCAD(PolyName, min_h, min_v, polygon_with_holdes); + else + starts = PolygonSCAD(PolyName, 0, 0, polygon_with_holdes); + if (starts>0) + printf("\t\t\t\ttranslate(board_origin) color(\"white\",0.7) translate([0,0,-0.017]) linear_extrude(height=0.035,center=false, convexity=10) for (a = [0 : len(%s)-1]) polygon(%s[a]);\n", PolyName, PolyName); + } + printf("\t\t\t}\n"); + } + + if (print_text == 1) // TOP & BOTTOM + { + real angle; + printf("\t\tif (EnableText) color(\"white\",0.7) union() { \n"); + B.texts(T) + { + + if( T.mirror ) + { + angle = (( T.angle + 180.0)>=360.0) ? (T.angle - 180.0) : ( T.angle + 180.0); // modulus + angle = -angle; + while (angle >= 360) angle -= 360; + while (angle < 0) angle += 360; + } + else + { + angle = T.angle; + } + if( T.mirror ) + printf("\t\t\ttranslate([%.3f,%.3f,0+0.025])", u2mm(T.x), u2mm(T.y)); + else + printf("\t\t\ttranslate([%.3f,%.3f,board_thickness-0.025])", u2mm(T.x), u2mm(T.y)); + if( T.mirror ) + printf("rotate([180,0,%.0f])", angle); + if(angle && !T.mirror ) + printf("rotate([0,0,%.0f])", angle); + printf("linear_extrude(0.05) text(\"%s\", font = \"Liberation Sans\", size = %.3f); \n", T.value, u2mm(T.size)*1.02); + } + printf("\t\t} //end text union() \n"); + + } + + // if EnableMeasures + if (print_measures) + { + printf("\t\tif(EnableMeasures) union() // parts \n"); + printf("\t\t{\n"); + string MeasuresText; + B.dimensions(D) { + D.texts(T) MeasuresText = T.value; + printf("\t\t\tMeasure(Pos1=[%.3f,%.3f],Pos2=[%.3f,%.3f],Pos3=[%.3f,%.3f], dtype = %d, atext = \"%s\");\n",u2mm(D.x1), u2mm(D.y1), u2mm(D.x2), u2mm(D.y2), u2mm(D.x3), u2mm(D.y3), D.dtype, MeasuresText ); + // printf("Dimension: (%f %f), (%f %f), (%f %f)\n", u2mm(D.x1), u2mm(D.y1), u2mm(D.x2), u2mm(D.y2), u2mm(D.x3), u2mm(D.y3)); + } + printf("\t\t}\n"); + } + + if( board_only == 0) + { + printf("\t\tif(EnableParts) union() // parts \n"); + printf("\t\t{\n"); + // add components coordinates + real angle, angle2, z2; + int skip; + string package_name; + string attr_str; + string temp_str[]; + int nb_fields_attr, offset; + + int element_nr = 0; + B.elements(E) + { + + + skip = 0; + //***5.9 + if( EAGLE_VERSION >= 5 ) + { + E.attributes(A) + { + if( A.name == "NO_BOM" ) + skip = 1; + } + } + //*** + if( !skip ) + { + real z; + if( E.mirror ) + { + z=board_thickness/-2; + angle = (( E.angle + 180.0)>=360.0) ? ( E.angle - 180.0) : ( E.angle + 180.0); // modulus + angle = -angle; + while (angle >= 360) angle -= 360; + while (angle < 0) angle += 360; + + } + else + { + z=board_thickness/2; + angle = E.angle; + } + + // Cleanup package name for OpenSCAD + package_name = E.package.name; + package_name = replace_string( package_name , "/" , "_" ); + package_name = replace_string( package_name , "," , "_" ); + package_name = replace_string( package_name , "-" , "_" ); + package_name = replace_string( package_name , "." , "_" ); + package_name = replace_string( package_name , ">" , "D" ); + package_name = replace_string( package_name , "<" , "C" ); + package_name = replace_string( package_name , "Ö" , "OE" ); + package_name = replace_string( package_name , "ö" , "oe" ); + package_name = replace_string( package_name , "Ä" , "AE" ); + package_name = replace_string( package_name , "ä" , "ae" ); + package_name = replace_string( package_name , "Ü" , "UE" ); + package_name = replace_string( package_name , "ü" , "ue" ); + package_name = replace_string( package_name , "³" , "3" ); + package_name = replace_string( package_name , "²" , "2" ); + package_name = replace_string( package_name , "°" , "deg" ); + + + package_name = cut_at(package_name , "@"); + package_name = cut_at(package_name , "("); + if(is_number(package_name)) + sprintf(package_name, "_%s", package_name); + package_names[element_nr] = package_name; + + + + + //***5.9 + if( EAGLE_VERSION >= 5 ) + { + // it is possible to specify a different model name than the footprint name, also in the schematics and board, possible to overide the attribute + E.attributes(A) + { + if( A.name == "EAGLEUP" ) + if( A.value != "" ) + { + attr_str = A.value; + nb_fields_attr = strsplit( temp_str , attr_str , ';' ); // name and arguments are ; separated + + while( strsub( temp_str[0] , 0 , 1) == " " ) // remove all spaces at beginning and end of temp_str[0] + temp_str[0] = strsub( temp_str[0] , 1); + while( strsub( temp_str[0] , strlen(temp_str[0])-1) == " " ) + temp_str[0] = strsub( temp_str[0] , 0 , strlen(temp_str[0])-1); + + if( temp_str[0] != "") + package_name = temp_str[0]; // name of part is first + if( nb_fields_attr > 1) + { + while( strsub( temp_str[1] , 0 , 1) == " " ) // remove all spaces at beginning and end of temp_str[1] + temp_str[1] = strsub( temp_str[1] , 1); + while( strsub( temp_str[1] , strlen(temp_str[1])-1) == " " ) + temp_str[1] = strsub( temp_str[1] , 0 , strlen(temp_str[1])-1); + + if( nb_fields_attr > 2) + { + + while( strsub( temp_str[2] , 0 , 1) == " " ) // remove all spaces at beginning and end of temp_str[2] + temp_str[2] = strsub( temp_str[2] , 1); + while( strsub( temp_str[2] , strlen(temp_str[1])-1) == " " ) + temp_str[2] = strsub( temp_str[2] , 0 , strlen(temp_str[2])-1); + + string z_unit = "mm"; // default unit + if( strlwr( strsub( temp_str[2] , strlen(temp_str[2])-3) ) == "mm" ) + { + z_unit = "mm"; + temp_str[2] = strsub( temp_str[2] , 0 , strlen(temp_str[2])-2); + } + else if( strlwr( strsub( temp_str[2] , strlen(temp_str[2])-3) ) == "in" ) + { + z_unit = "in"; + temp_str[2] = strsub( temp_str[2] , 0 , strlen(temp_str[2])-2); + } + else if( strlwr( strsub( temp_str[2] , strlen(temp_str[2])-4) ) == "mil" ) + { + z_unit = "mil"; + temp_str[2] = strsub( temp_str[2] , 0 , strlen(temp_str[2])-3); + } + else if( strlwr( strsub( temp_str[2] , strlen(temp_str[2])-5) ) == "mils" ) + { + z_unit = "mils"; + temp_str[2] = strsub( temp_str[2] , 0 , strlen(temp_str[2])-4); + } + + while( strsub( temp_str[2] , strlen(temp_str[2])-1) == " " ) // clean ending + temp_str[2] = strsub( temp_str[2] , 0 , strlen(temp_str[2])-1); + + // replace any comma by a dot + string z_array[]; + strsplit(z_array, temp_str[2], ','); + temp_str[2] = strjoin(z_array, '.'); + + real z_offset = strtod( temp_str[2] ); // conversion to decimal + if( z_unit == "mm" ) + z += z_offset; + if( z_unit == "in" ) + z += z_offset * 25.4; // unit conversion + if( z_unit == "mil" ) + z += z_offset * 25.4 / 1000; + if( z_unit == "mils" ) + z += z_offset * 25.4 / 1000; + + } + + z2=z; + angle2=angle; + offset=0; + if( strsub( temp_str[1] , offset , 1) == "M" ) // mirror + { + offset ++; + z2 *= -1.0; + angle2 += 180; + } + if( strsub( temp_str[1] , offset , 1) == "R" ) // rotation + { + offset ++; + angle2 += strtod( strsub( temp_str[1] , offset )); // angle + } + angle2 = (angle2>=360.0) ? ( angle2 - 360.0) : ( angle2); // modulus + angle2 = (angle2>=360.0) ? ( angle2 - 360.0) : ( angle2); // modulus + angle = angle2; + z= z2; + + + } + } + } + package_name = replace_string( package_name , ".scad" , "" ); // Warum ist doch kein .scad drinnen + } + // angle = E.angle; + package_angles[element_nr] = angle; + //*** + if( E.mirror ) + printf("\t\t\ttranslate([%.3f,%.3f,0])", u2mm(E.x), u2mm(E.y)); + else + printf("\t\t\ttranslate([%.3f,%.3f,board_thickness])", u2mm(E.x), u2mm(E.y)); + if( E.mirror ) + printf("rotate([180,0,%.0f])", angle); + if(angle && !E.mirror ) + printf("rotate([0,0,%.0f])", angle); + //if(angle ) + // printf("rotate([0,0,%.0f])", angle); + //if( E.mirror ) + // printf("mirror([0,0,1])"); + + printf("%s(Name=\"%s\",Value=\"%s\",Library=\"%s\"); \n", package_name, E.name, E.value, E.package.library); + } + element_nr++; + } + //printf("\t\t}\n"); + printf("\t\t} //endunion() \n"); + printf("\t} // // PCB whith parts and text \n"); + + // Generate Parts + element_nr = 0; + B.elements(E) + { + if (!Already_exist(package_names[element_nr], element_nr)) + { + printf("\tmodule %s(Name=\"\",Value=\"\",Library=\"%s\")\n", package_names[element_nr], E.package.library ); + printf("\t{\n"); + + + int x1 = CONSTANT_MAX; + int x2 = -1 * CONSTANT_MAX; + int y1 = CONSTANT_MAX; + int y2 = -1 * CONSTANT_MAX; + int tempx; + + E.package.wires(W) + { + x1 = min( x1, get_wire_min_h(W)); + y1 = min( y1, get_wire_min_v(W)); + x2 = max( x2, get_wire_max_h(W)); + y2 = max( y2, get_wire_max_v(W)); + } + x1 = x1 - E.x; x2 = x2 - E.x; y1 = y1 - E.y; y2 = y2 - E.y; + printf("\t\t// X1=%.3f, Y1=%.3f, X2=%.3f, Y2=%.3f, Ex=%.3f, Ey=%.3f, a=%.0d\n", u2mm(x1), u2mm(y1), u2mm(x2), u2mm(y2), u2mm(E.x), u2mm(E.y), package_angles[element_nr]); + int PackageAngle; + if (E.mirror) + { + PackageAngle = 180 + package_angles[element_nr] ; + tempx = x2; + x2 = -x1; + x1 = -tempx; + } + else + { + PackageAngle = - package_angles[element_nr] ; + } + + while (PackageAngle >= 360) PackageAngle -= 360; + while (PackageAngle < 0) PackageAngle += 360; + printf("\t\t"); + if ((u2mm(abs(x2-x1)) > 0.001) && (u2mm(abs(y2-y1)) > 0.001)) + { + printf("if (HideAutogeneratedParts) {\n\t\t\tInvisiblePart(); } \n\t\telse {\n\t\t\t"); + + if(PackageAngle) + printf("rotate([0,0,%.0d]) ", PackageAngle); + + printf("translate([%.3f,%.3f,0]) linear_extrude(10) ", u2mm(x1), u2mm(y1)); + printf("square([%.3f,%.3f]); \/\/Dummy Package\n", u2mm(x2-x1),u2mm(y2-y1) ); + printf("\t\t}\n"); + + } + else // Keine Dimension + { + printf("InvisiblePart(); \/\/No Dimension\n"); + } + // printf("translate([%.3f,%.3f,0]) linear_extrude(10) square([%.3f,%.3f]); \/\/Board\n",u2mm(E.package.area.x1-E.x), u2mm(E.package.area.y1-E.y), u2mm(E.package.area.x2-E.package.area.x1),u2mm(E.package.area.y2-E.package.area.y1) ); + // printf("linear_extrude(10) square([%.3f,%.3f]); \/\/Board\n", u2mm(E.package.area.x2-E.package.area.x1),u2mm(E.package.area.y2-E.package.area.y1) ); + + + printf("\t}\n"); + } + element_nr++; + } + + + // Details about the file format + printf("\tinclude <%s>;\n\n", package_path); + printf("\tinclude ;\n\n"); + } + else + { + printf("\t} // // PCB whith parts and text \n"); + } + + + printf("} // end module\n\n"); + + printf("module InvisiblePart() { rotate([0,0,0]);}\n\n "); + if (found_Wire) + { + printf("module EagleWire(start,end,width=0.4,poly=true,startdot=true,enddot=true,$fn=9) // hull() n.a. in FreeCAD\n{\n "); + printf("\tfunction bogen(point=[0,0], r = 1 ,phase = 0, winkel = 90, $fn=$fn) = [let(num=abs($fn*winkel/360)) for (i=[0:num], x=i*winkel/num) [point[0]+r*cos(x+phase),point[1]+r*sin(x+phase)]]; \n"); + printf("\tfunction winkel(a,b=[0,0]) = atan2(a[1]-b[1],a[0]-b[0]);\n"); + printf("\tif (poly)\n\t{\n"); + printf("\t\tfns = (startdot) ? $fn : 2;\n\t\tfne = (enddot) ? $fn : 2;\n"); + printf("\t\tpolygon(concat(bogen(point=start, r=width/2 ,phase = winkel(start,end)-90, winkel = 180, $fn=fns), bogen(point=end, r=width/2 ,phase = winkel(end,start)-90, winkel = 180, $fn=fne)));\n"); + printf("\t}\n\telse\n\t{\n"); + printf("\t\tlength = sqrt(pow(start[0]-end[0],2)+pow(start[1]-end[1],2));\n\t\tif (startdot) {translate(start) circle(width/2,$fn=$fn);}\n"); + printf("\t\tif (length > 0)\n\t\t{\n\t\t\tif (enddot) {translate(end) circle(width/2,$fn=$fn);}\n\t\t\ttranslate(end) rotate([0,0,winkel(start,end)]) translate([0,-width/2]) square([length , width]);\n\t\t}\n"); + printf("\t}\n"); + printf("}\n"); + } + //if (found_Round_PAD) + { + printf("\n"); + printf("module EaglePad(size,roundness,$fn=$fn) \n{\n "); + printf("\tfunction bogen(point=[0,0], r = 1 ,phase = 0, winkel = 90, $fn=$fn) = [let(num=abs($fn*winkel/360)) for (i=[0:num], x=i*winkel/num) [point[0]+r*cos(x+phase),point[1]+r*sin(x+phase)]]; \n"); + printf("\tr = ((size[0] < size[1]) ? size[0] / 2: size[1] / 2) * roundness / 100;\n"); + printf("\tdim = [size[0] / 2 - r, size[1] / 2 - r];\n"); + printf("\tif ((size[0] == size[1]) && (roundness == 100))\n"); + printf("\t{\n"); + printf("\t\tcircle(r);\n"); + printf("\t}\n\telse\n"); + printf("\t{\n"); + printf("\t\tpolygon(concat(bogen(point=[-dim[0],-dim[1]], r = r, phase = 180, $fn=$fn ), bogen(point=[dim[0],-dim[1]], r = r, phase = 270, $fn=$fn ), bogen(point=[dim[0],dim[1]], r = r, phase = 0, $fn=$fn ), bogen(point=[-dim[0],dim[1]], r = r, phase = 90, $fn=$fn )));\n"); + printf("\t}\n}\n"); + } + if (print_measures) + { + printf("\n"); + printf("module Measure(Pos1,Pos2,Pos3, dtype, atext) \n{\n "); + printf("\t\n"); + printf("\tRotation = [0,0,0];\n"); + printf("\tMirroring = [0,0,0];\n"); + printf("\tfunction RotateX(x,y, x0, y0, a) = let (r = (x - x0)*cos(a) - (y - y0)*sin(a) + x0) r;\n"); + printf("\tfunction RotateY(x,y, x0, y0, a) = let (r = (x - x0)*sin(a) + (y - y0)*cos(a) + y0) r;\n"); + printf("\tcolor(\"Black\") {\n"); + printf("\tif ((dtype > 0) && (dtype < 3))\n"); + printf("\t{\n"); + printf("\t\tif (((dtype == 1) && (Pos1[0] != Pos2[0])) || (Pos1[1] == Pos2[1])) // Horrizontal \n"); + printf("\t\t{\n"); + printf("\t\t angle = (Pos1[1] > Pos3[1]) ? -90 : 90;\n"); + printf("\t\t signum = (Pos1[0] < Pos2[0]) ? 1 : -1;\n"); + printf("\t\t height1 = abs(Pos3[1]-Pos1[1]);\n"); + printf("\t\t height2 = abs(Pos3[1]-Pos2[1]);\n"); + printf("\t\t translate([Pos1[0],Pos1[1],0]) rotate([0,90,angle]) cylinder(height1+1.2,0.1,0.1);\n"); + printf("\t\t translate([Pos2[0],Pos2[1],0]) rotate([0,90,angle]) cylinder(height2+1.2,0.1,0.1);\n"); + printf("\t\t Pos1Arrow = [Pos1[0], Pos3[1]];\n"); + printf("\t\t Pos2Arrow = [Pos2[0], Pos3[1]];\n"); + printf("\t\t lenght = abs(Pos2[0] - Pos1[0]);\n"); + printf("\t\t InvertArrow = (lenght > 12) ? signum : -signum;\n"); + printf("\t\t translate(Pos1Arrow) rotate([0,90,angle+InvertArrow*90]) cylinder(2.5,0,0.5);\n"); + printf("\t\t translate(Pos2Arrow) rotate([0,90,angle-InvertArrow*90]) cylinder(2.5,0,0.5);\n"); + printf("\t\t translate(Pos1Arrow) rotate([0,90,angle+signum*90]) cylinder(lenght ,0.1,0.1);\n"); + printf("\t\t if (InvertArrow==signum)\n"); + printf("\t\t {\n"); + printf("\t\t translate([Pos3[0],Pos3[1],0]) rotate([Rotation[0],Rotation[1],Rotation[2]-abs(angle)+90]) linear_extrude(0.05) mirror([Mirroring[0],Mirroring[1],Mirroring[2]]) translate([0,0.3]) text(atext, font = \"Liberation Sans\", halign = \"center\" , size = 2);\n"); + printf("\t\t }\n"); + printf("\t\t else\n"); + printf("\t\t { \n"); + printf("\t\t displacement = (signum >=0) ? 7 : lenght+7;\n"); + printf("\t\t translate([Pos1[0],Pos3[1],0]) rotate([Rotation[0],Rotation[1],Rotation[2]+(angle-90)]) linear_extrude(0.05) mirror([Mirroring[0],Mirroring[1],Mirroring[2]]) translate([displacement,0.3]) text(atext, font = \"Liberation Sans\", halign = \"center\", size = 2);\n"); + printf("\t\t if (signum>=0)\n"); + printf("\t\t {\n"); + printf("\t\t translate(Pos1Arrow) rotate([0,90,angle-signum*90]) cylinder(12 ,0.1,0.1);\n"); + printf("\t\t }\n"); + printf("\t\t else \n"); + printf("\t\t {\n"); + printf("\t\t translate(Pos2Arrow) rotate([0,90,180+angle-signum*90]) cylinder(12 ,0.1,0.1);\n"); + printf("\t\t }\n"); + printf("\t\t }\n"); + printf("\t\t} \n"); + printf("\t\telse if ((dtype == 2) || (Pos1[0] == Pos2[0])) // Vertikal \n"); + printf("\t\t{\n"); + printf("\t\t angle = (Pos1[0] > Pos3[0]) ? 180 : 0;\n"); + printf("\t\t signum = (Pos1[0] > Pos2[0]) ? 1 : -1;\n"); + printf("\t\t height1 = abs(Pos3[0]-Pos1[0]);\n"); + printf("\t\t height2 = abs(Pos3[0]-Pos2[0]);\n"); + printf("\t\t translate([Pos1[0],Pos1[1],0]) rotate([0,90,angle]) cylinder(height1+1.2,0.1,0.1);\n"); + printf("\t\t translate([Pos2[0],Pos2[1],0]) rotate([0,90,angle]) cylinder(height2+1.2,0.1,0.1);\n"); + printf("\t\t Pos1Arrow = [Pos3[0], Pos1[1]];\n"); + printf("\t\t Pos2Arrow = [Pos3[0], Pos2[1]];\n"); + printf("\t\t lenght = abs(Pos2[1] -Pos1[1]);\n"); + printf("\t\t InvertArrow = (lenght > 12) ? signum : -signum;\n"); + printf("\t\t translate(Pos1Arrow) rotate([0,90,angle+InvertArrow*90]) cylinder(2.5,0,0.5);\n"); + printf("\t\t translate(Pos2Arrow) rotate([0,90,angle-InvertArrow*90]) cylinder(2.5,0,0.5);\n"); + printf("\t\t translate(Pos1Arrow) rotate([0,90,angle+signum*90]) cylinder(lenght ,0.1,0.1);\n"); + printf("\t\t if (InvertArrow==signum)\n"); + printf("\t\t {\n"); + printf("\t\t translate([Pos3[0],Pos3[1],0]) rotate([Rotation[0],Rotation[1],Rotation[2]+abs(angle-90)]) linear_extrude(0.05) mirror([Mirroring[0],Mirroring[1],Mirroring[2]]) translate([0,0.3]) text(atext, font = \"Liberation Sans\", halign = \"center\" , size = 2);\n"); + printf("\t\t }\n"); + printf("\t\t else\n"); + printf("\t\t { \n"); + printf("\t\t displacement = (signum >=0) ? 7 : lenght+7;\n"); + printf("\t\t translate([Pos3[0],Pos1[1],0]) rotate([Rotation[0],Rotation[1],Rotation[2]+(angle-90)]) linear_extrude(0.05) mirror([Mirroring[0],Mirroring[1],Mirroring[2]]) translate([displacement,0.3]) text(atext, font = \"Liberation Sans\", halign = \"center\", size = 2);\n"); + printf("\t\t if (signum>=0)\n"); + printf("\t\t {\n"); + printf("\t\t translate(Pos1Arrow) rotate([0,90,angle-signum*90]) cylinder(12 ,0.1,0.1);\n"); + printf("\t\t }\n"); + printf("\t\t else \n"); + printf("\t\t {\n"); + printf("\t\t translate(Pos2Arrow) rotate([0,90,180+angle-signum*90]) cylinder(12 ,0.1,0.1);\n"); + printf("\t\t }\n"); + printf("\t\t }\n"); + printf("\t\t}\n"); + printf("\t}\n"); + printf("\telse // dtype 0 parallel\n"); + printf("\t{\n"); + printf("\t\tPos4 = [Pos1[0]+(Pos2[0] - Pos1[0])/2, Pos1[1]+(Pos2[1]-Pos1[1])/2]; // Lot\n"); + printf("\t\tangle = atan2(Pos3[1]-Pos4[1],Pos3[0]-Pos4[0]);\n"); + printf("\t\tangle2 = atan2(Pos1[1]-Pos2[1],Pos1[0]-Pos2[0]);\n"); + printf("\t\tsignum = sign(RotateY(Pos3[0], Pos3[1], Pos1[0], Pos1[1], -angle2) - Pos1[1]);\n"); + printf("\t\theight = sqrt(pow(Pos3[0]-Pos4[0],2)+pow(Pos3[1]-Pos4[1],2));\n"); + printf("\t\ttranslate([Pos1[0],Pos1[1],0]) rotate([0,90,angle]) cylinder(height+1.2,0.1,0.1);\n"); + printf("\t\ttranslate([Pos2[0],Pos2[1],0]) rotate([0,90,angle]) cylinder(height+1.2,0.1,0.1);\n"); + printf("\t\tPos1Arrow = [Pos1[0] + (Pos3[0]-Pos4[0]), Pos1[1] + (Pos3[1]-Pos4[1])];\n"); + printf("\t\tPos2Arrow = [Pos2[0] + (Pos3[0]-Pos4[0]), Pos2[1] + (Pos3[1]-Pos4[1])];\n"); + printf("\t\tlenght = sqrt(pow(Pos1Arrow[0]-Pos2Arrow[0],2)+pow(Pos1Arrow[1]-Pos2Arrow[1],2));\n"); + printf("\t\tInvertArrow = (lenght > 12) ? signum : -signum;\n"); + printf("\t\ttranslate(Pos1Arrow) rotate([0,90,angle+InvertArrow*90]) cylinder(2.5,0,0.5);\n"); + printf("\t\ttranslate(Pos2Arrow) rotate([0,90,angle-InvertArrow*90]) cylinder(2.5,0,0.5);\n"); + printf("\t\ttranslate(Pos1Arrow) rotate([0,90,angle+signum*90]) cylinder(lenght ,0.1,0.1);\n"); + printf("\t\tif (InvertArrow==signum)\n"); + printf("\t\t{\n"); + printf("\t\t\ttranslate([Pos3[0],Pos3[1],0]) rotate([Rotation[0],Rotation[1],Rotation[2]+(angle-90)]) linear_extrude(0.05) mirror([Mirroring[0],Mirroring[1],Mirroring[2]]) translate([0,0.3]) text(atext, font = \"Liberation Sans\", halign = \"center\", size = 2);\n"); + printf("\t\t}\n"); + printf("\t\telse\n"); + printf("\t\t{\n"); + printf("\t\t\tdisplacement = (signum >=0) ? 7 : lenght+7;\n"); + printf("\t\t\ttranslate([Pos1[0]+Pos3[0]-Pos4[0],Pos1[1]+Pos3[1]-Pos4[1],0]) rotate([Rotation[0],Rotation[1],Rotation[2]+(angle-90)]) linear_extrude(0.05) mirror([Mirroring[0],Mirroring[1],Mirroring[2]]) translate([displacement,0.3]) text(atext, font = \"Liberation Sans\", halign = \"center\", size = 2);\n"); + printf("\t\t\tif (signum>=0)\n"); + printf("\t\t\t{\n"); + printf("\t\t\t\ttranslate(Pos1Arrow) rotate([0,90,angle-signum*90]) cylinder(12 ,0.1,0.1);\n"); + printf("\t\t\t}\n"); + printf("\t\t\telse \n"); + printf("\t\t\t{\n"); + printf("\t\t\t\ttranslate(Pos2Arrow) rotate([0,90,180+angle-signum*90]) cylinder(12 ,0.1,0.1);\n"); + printf("\t\t\t}\n"); + printf("\t\t}\n"); + printf("\t}\n"); + printf("\t}\n"); + //printf("\tvektor = [Pos1[0]- Pos2[0], Pos1[1]-Pos2[1]];\n "); + //angle = + //printf("\ttranslate([Pos1[0],Pos1[1],0]) rotate([0,90,0]) cylinder(10,0.1,0.1);\n "); + printf("}\n"); + } + + printf("%s(); //Show module\n", module_name); + + printf("//Created by generate-scad.ulp version %d.%d\n", major_version , minor_version); + + } + + + // dlgMessageBox( "generate-scad.ulp " + genscad_version + " : export completed" ); + exit (0); + } +else // if not launched from a board + { + dlgMessageBox("\n Please launch this ULP in a Board \n"); + exit (0); + } +/* end of file */ +