diff options
Diffstat (limited to 'box')
-rw-r--r-- | box/Makefile | 2 | ||||
-rw-r--r-- | box/Polarity_marking_center_positive.svg | 153 | ||||
-rw-r--r-- | box/YAPPgenerator_v14.scad | 2282 | ||||
-rw-r--r-- | box/box.scad | 179 | ||||
-rw-r--r-- | box/plug.svg | 78 | ||||
-rw-r--r-- | box/poe.wrl | 66700 |
6 files changed, 69394 insertions, 0 deletions
diff --git a/box/Makefile b/box/Makefile new file mode 100644 index 0000000..f1d8e0f --- /dev/null +++ b/box/Makefile @@ -0,0 +1,2 @@ +poe.stl: poe.wrl + meshlabserver -i $< -o $@ diff --git a/box/Polarity_marking_center_positive.svg b/box/Polarity_marking_center_positive.svg new file mode 100644 index 0000000..73853e7 --- /dev/null +++ b/box/Polarity_marking_center_positive.svg @@ -0,0 +1,153 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:ooo="http://xml.openoffice.org/svg/export" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.2" + width="120.03001mm" + height="30.020002mm" + viewBox="0 0 12003.001 3002.0003" + preserveAspectRatio="xMidYMid" + xml:space="preserve" + id="svg2" + inkscape:version="1.0.2 (e86c870879, 2021-01-15)" + sodipodi:docname="Polarity_marking_center_positive.svg" + inkscape:export-filename="/home/thomas/Downloads/kicad_logos/polarity_marking_center_positive.svg.png" + inkscape:export-xdpi="406" + inkscape:export-ydpi="406" + style="fill-rule:evenodd;stroke-width:28.22200012;stroke-linejoin:round"><path + id="path75" + style="fill:#000000;stroke:none;stroke-width:1.06666" + d="M 56.693359 0 C 24.567377 0 0 24.567377 0 56.693359 C 0 88.819342 24.567377 113.38672 56.693359 113.38672 C 86.900811 113.38672 110.41913 91.662824 113.12109 62.361328 L 141.73242 62.361328 L 170.39648 62.361328 L 170.75977 65.044922 L 171.21289 67.804688 L 171.85547 70.564453 L 172.61133 73.248047 L 173.48047 75.96875 L 174.5 78.576172 L 175.67188 81.146484 L 176.95703 83.640625 L 178.31836 86.097656 L 179.83008 88.441406 L 181.45508 90.746094 L 183.19336 92.939453 L 185.04492 95.054688 L 187.01172 97.095703 L 189.05273 98.986328 L 191.20703 100.83789 L 193.43555 102.53906 L 195.74219 104.12695 L 198.12305 105.59961 L 200.61719 106.96094 L 203.11133 108.20703 L 205.71875 109.30469 L 208.32812 110.28711 L 211.01172 111.15625 L 213.73242 111.87305 L 216.49219 112.44141 L 219.28906 112.89453 L 222.04688 113.19727 L 224.88281 113.34766 L 227.67969 113.38672 L 230.47461 113.27148 L 233.27148 113.00781 L 236.06836 112.5918 L 238.82812 112.0625 L 241.54883 111.41992 L 244.27148 110.62695 L 246.91602 109.71875 L 249.52344 108.66211 L 252.05664 107.45117 L 254.55078 106.12891 L 256.93164 104.69336 L 259.27539 103.14258 L 261.54297 101.48047 L 263.73633 99.666016 L 265.81445 97.814453 L 267.7793 95.810547 L 269.66992 93.732422 L 271.44531 91.541016 L 273.14648 89.271484 L 263.13086 82.28125 L 261.76953 84.019531 L 260.37109 85.757812 L 258.89844 87.382812 L 257.34766 88.931641 L 255.72266 90.40625 L 254.02148 91.804688 L 252.24609 93.126953 L 250.43164 94.337891 L 248.50391 95.470703 L 246.57617 96.529297 L 244.57227 97.398438 L 242.5332 98.267578 L 240.45312 98.986328 L 238.33789 99.628906 L 236.2207 100.1582 L 234.06641 100.57227 L 231.87305 100.875 L 229.68164 101.06445 L 227.49023 101.17773 L 225.25977 101.14062 L 223.06836 101.02734 L 220.875 100.80078 L 218.68359 100.45898 L 216.5293 100.00586 L 214.41211 99.439453 L 212.29688 98.796875 L 210.25586 98.003906 L 208.21484 97.095703 L 206.24805 96.150391 L 204.32031 95.09375 L 202.43164 93.921875 L 200.61719 92.673828 L 198.87891 91.351562 L 197.17773 89.914062 L 195.58984 88.402344 L 194.04102 86.816406 L 192.60547 85.152344 L 191.24414 83.451172 L 189.95898 81.638672 L 188.78711 79.785156 L 187.69141 77.896484 L 186.66992 75.931641 L 185.80078 73.927734 L 184.9707 71.849609 L 184.28906 69.769531 L 183.68555 67.654297 L 183.19336 65.5 L 182.81641 63.345703 L 182.55078 61.152344 L 182.36133 58.960938 L 182.32422 56.730469 L 182.36133 54.539062 L 182.55078 52.345703 L 182.81641 50.154297 L 183.19336 48 L 183.68555 45.845703 L 184.28906 43.728516 L 184.9707 41.613281 L 185.76367 39.572266 L 186.66992 37.568359 L 187.69141 35.603516 L 188.78711 33.675781 L 189.95898 31.824219 L 191.24414 30.046875 L 192.64258 28.308594 L 194.11719 26.646484 L 195.62891 25.058594 L 197.25391 23.546875 L 198.91602 22.148438 L 200.6543 20.787109 L 202.46875 19.541016 L 204.35938 18.40625 L 206.28711 17.310547 L 208.28906 16.365234 L 210.29297 15.533203 L 212.37109 14.777344 L 214.45117 14.097656 L 216.60547 13.53125 L 218.75977 13.078125 L 220.91406 12.736328 L 223.10547 12.509766 L 225.33594 12.396484 L 227.52734 12.359375 L 229.71875 12.472656 L 231.91211 12.662109 L 234.10352 12.962891 L 236.25781 13.378906 L 238.41211 13.908203 L 240.5293 14.550781 L 242.60742 15.269531 L 244.64844 16.101562 L 246.61328 17.083984 L 248.58008 18.103516 L 250.46875 19.238281 L 252.2832 20.484375 L 254.06055 21.769531 L 255.75977 23.167969 L 257.42383 24.642578 L 258.97266 26.230469 L 260.44727 27.855469 L 261.8457 29.556641 L 263.09375 31.332031 L 273.22266 24.263672 L 271.55859 21.996094 L 269.7832 19.841797 L 267.89258 17.763672 L 265.89062 15.759766 L 263.81055 13.871094 L 261.65625 12.09375 L 259.38867 10.431641 L 257.04492 8.84375 L 254.62695 7.4082031 L 252.16992 6.0859375 L 249.59961 4.9140625 L 246.99219 3.8554688 L 244.3457 2.8730469 L 241.66211 2.0410156 L 238.94141 1.3984375 L 236.18359 0.86914062 L 233.38672 0.453125 L 230.58984 0.18945312 L 227.79297 0.076171875 L 224.99609 0.11328125 L 222.16016 0.26367188 L 219.36328 0.56640625 L 216.60547 1.0195312 L 213.8457 1.5878906 L 211.125 2.3046875 L 208.44141 3.0996094 L 205.79492 4.0820312 L 203.22461 5.1777344 L 200.69336 6.4257812 L 198.23633 7.7851562 L 195.85547 9.2597656 L 193.54883 10.847656 L 191.28125 12.548828 L 189.16602 14.361328 L 187.08594 16.289062 L 185.1582 18.292969 L 183.30664 20.410156 L 181.53125 22.601562 L 179.90625 24.90625 L 178.39453 27.289062 L 176.95703 29.707031 L 175.67188 32.201172 L 174.53906 34.771484 L 173.51758 37.378906 L 172.61133 40.025391 L 171.85547 42.746094 L 171.25 45.466797 L 170.75977 48.226562 L 170.38086 51.023438 L 113.12109 51.023438 C 110.41913 21.721942 86.900811 -4.7369516e-15 56.693359 0 z M 56.654297 12.435547 C 81.712564 12.435547 100.875 31.59603 100.875 56.654297 C 100.875 81.712564 81.712564 100.875 56.654297 100.875 C 31.59603 100.875 12.435547 81.712564 12.435547 56.654297 C 12.435547 31.59603 31.59603 12.435547 56.654297 12.435547 z " + transform="scale(26.458334)" /><path + id="path68" + style="fill:#000000;stroke:none;stroke-width:1.06666" + d="M 396.84961 0 C 366.64216 0 343.12383 21.721942 340.42188 51.023438 L 252.62305 51.023438 C 250.14478 38.909844 239.75844 30.236328 226.73438 30.236328 C 211.76745 30.236328 200.31445 41.687368 200.31445 56.654297 C 200.31445 71.621225 211.76745 83.111328 226.73438 83.111328 C 239.73237 83.111328 250.10253 74.444412 252.60742 62.361328 L 292.91406 62.361328 L 340.42188 62.361328 C 343.12383 91.662824 366.64216 113.38672 396.84961 113.38672 C 428.97559 113.38672 453.54297 88.819342 453.54297 56.693359 C 453.54297 24.567377 428.97559 0 396.84961 0 z M 396.8125 12.435547 C 421.87077 12.435547 441.0332 31.59603 441.0332 56.654297 C 441.0332 81.712564 421.87077 100.875 396.8125 100.875 C 371.75423 100.875 352.5918 81.712564 352.5918 56.654297 C 352.5918 31.59603 371.75423 12.435547 396.8125 12.435547 z " + transform="scale(26.458334)" /><path + id="path117" + style="fill:#000000;stroke:none;stroke-width:1.06666" + d="M 391.18164 28.345703 L 391.18164 51.023438 L 368.50391 51.023438 L 368.50391 62.361328 L 391.18164 62.361328 L 391.18164 85.039062 L 396.84961 85.039062 L 402.51953 85.039062 L 402.51953 62.361328 L 425.19727 62.361328 L 425.19727 51.023438 L 402.51953 51.023438 L 402.51953 28.345703 L 391.18164 28.345703 z " + transform="scale(26.458334)" /><metadata + id="metadata135"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1920" + inkscape:window-height="1029" + id="namedview133" + showgrid="false" + inkscape:zoom="2.35" + inkscape:cx="207.73109" + inkscape:cy="13.972322" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg2" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" + inkscape:document-rotation="0" /><defs + class="ClipPathGroup" + id="defs4"><clipPath + id="presentation_clip_path" + clipPathUnits="userSpaceOnUse"><rect + x="0" + y="0" + width="21590" + height="27940" + id="rect7" /></clipPath><clipPath + id="presentation_clip_path_shrink" + clipPathUnits="userSpaceOnUse"><rect + x="21" + y="27" + width="21547" + height="27885" + id="rect10" /></clipPath></defs><defs + class="TextShapeIndex" + id="defs12"><g + ooo:slide="id1" + ooo:id-list="id3 id4 id5 id6 id7 id8 id9 id10 id11 id12" + id="g14" /></defs><defs + class="EmbeddedBulletChars" + id="defs16"><g + id="bullet-char-template(57356)" + transform="scale(4.8828125e-4,-4.8828125e-4)"><path + d="M 580,1141 1163,571 580,0 -4,571 580,1141 Z" + id="path19" + inkscape:connector-curvature="0" /></g><g + id="bullet-char-template(57354)" + transform="scale(4.8828125e-4,-4.8828125e-4)"><path + d="m 8,1128 1129,0 L 1137,0 8,0 8,1128 Z" + id="path22" + inkscape:connector-curvature="0" /></g><g + id="bullet-char-template(10146)" + transform="scale(4.8828125e-4,-4.8828125e-4)"><path + d="M 174,0 602,739 174,1481 1456,739 174,0 Z m 1184,739 -1049,607 350,-607 699,0 z" + id="path25" + inkscape:connector-curvature="0" /></g><g + id="bullet-char-template(10132)" + transform="scale(4.8828125e-4,-4.8828125e-4)"><path + d="M 2015,739 1276,0 717,0 l 543,543 -1086,0 0,393 1086,0 -543,545 557,0 741,-742 z" + id="path28" + inkscape:connector-curvature="0" /></g><g + id="bullet-char-template(10007)" + transform="scale(4.8828125e-4,-4.8828125e-4)"><path + d="m 0,-2 c -7,16 -16,29 -25,39 l 381,530 c -94,256 -141,385 -141,387 0,25 13,38 40,38 9,0 21,-2 34,-5 21,4 42,12 65,25 l 27,-13 111,-251 280,301 64,-25 24,25 c 21,-10 41,-24 62,-43 C 886,937 835,863 770,784 769,783 710,716 594,584 L 774,223 c 0,-27 -21,-55 -63,-84 l 16,-20 C 717,90 699,76 672,76 641,76 570,178 457,381 L 164,-76 c -22,-34 -53,-51 -92,-51 -42,0 -63,17 -64,51 -7,9 -10,24 -10,44 0,9 1,19 2,30 z" + id="path31" + inkscape:connector-curvature="0" /></g><g + id="bullet-char-template(10004)" + transform="scale(4.8828125e-4,-4.8828125e-4)"><path + d="M 285,-33 C 182,-33 111,30 74,156 52,228 41,333 41,471 c 0,78 14,145 41,201 34,71 87,106 158,106 53,0 88,-31 106,-94 l 23,-176 c 8,-64 28,-97 59,-98 l 735,706 c 11,11 33,17 66,17 42,0 63,-15 63,-46 l 0,-122 c 0,-36 -10,-64 -30,-84 L 442,47 C 390,-6 338,-33 285,-33 Z" + id="path34" + inkscape:connector-curvature="0" /></g><g + id="bullet-char-template(9679)" + transform="scale(4.8828125e-4,-4.8828125e-4)"><path + d="M 813,0 C 632,0 489,54 383,161 276,268 223,411 223,592 c 0,181 53,324 160,431 106,107 249,161 430,161 179,0 323,-54 432,-161 108,-107 162,-251 162,-431 0,-180 -54,-324 -162,-431 C 1136,54 992,0 813,0 Z" + id="path37" + inkscape:connector-curvature="0" /></g><g + id="bullet-char-template(8226)" + transform="scale(4.8828125e-4,-4.8828125e-4)"><path + d="m 346,457 c -73,0 -137,26 -191,78 -54,51 -81,114 -81,188 0,73 27,136 81,188 54,52 118,78 191,78 73,0 134,-26 185,-79 51,-51 77,-114 77,-187 0,-75 -25,-137 -76,-188 -50,-52 -112,-78 -186,-78 z" + id="path40" + inkscape:connector-curvature="0" /></g><g + id="bullet-char-template(8211)" + transform="scale(4.8828125e-4,-4.8828125e-4)"><path + d="m -4,459 1139,0 0,147 -1139,0 0,-147 z" + id="path43" + inkscape:connector-curvature="0" /></g><g + id="bullet-char-template(61548)" + transform="scale(4.8828125e-4,-4.8828125e-4)"><path + d="m 173,740 c 0,163 58,303 173,419 116,115 255,173 419,173 163,0 302,-58 418,-173 116,-116 174,-256 174,-419 0,-163 -58,-303 -174,-418 C 1067,206 928,148 765,148 601,148 462,206 346,322 231,437 173,577 173,740 Z" + id="path46" + inkscape:connector-curvature="0" /></g></defs><defs + class="TextEmbeddedBitmaps" + id="defs48" /><path + style="fill:#000000;stroke:none" + d="M 12001,3001 Z" + id="path258" /><path + style="fill:#000000;stroke:none" + d="M 9000,0 Z" + id="path256" /><path + style="fill:#000000;stroke:none" + d="M 3001,3001 Z" + id="path268" /><path + style="fill:#000000;stroke:none" + d="M 0,0 Z" + id="path266" /><path + style="fill:#000000;stroke:none" + inkscape:connector-curvature="0" + id="path110" + d="M 1500,1650 H 750 v -300 h 1500 v 300 z" /></svg> diff --git a/box/YAPPgenerator_v14.scad b/box/YAPPgenerator_v14.scad new file mode 100644 index 0000000..23fa79f --- /dev/null +++ b/box/YAPPgenerator_v14.scad @@ -0,0 +1,2282 @@ +/* +*************************************************************************** +** Yet Another Parameterised Projectbox generator +** +*/ +Version="v1.4 (14-03-2022) (amatus's mods)"; +/* +** +** Copyright (c) 2021, 2022 Willem Aandewiel +** +** TERMS OF USE: MIT License. See base offile. +*************************************************************************** +*/ +//--------------------------------------------------------- +// This design is parameterized based on the size of a PCB. +//--------------------------------------------------------- +// Note: length/lengte refers to X axis, +// width/breedte to Y, +// height/hoogte to Z + +/* + padding-back|<------pcb length --->|<padding-front + RIGHT + 0 X-as ---> + +----------------------------------------+ --- + | | ^ + | | padding-right + | | v + | -5,y +----------------------+ | --- + B Y | | 0,y x,y | | ^ F + A - | | | | | R + C a | | | | | pcb width O + K s | | | | | N + | | 0,0 x,0 | | v T + ^ | -5,0 +----------------------+ | --- + | | | padding-left + 0 +----------------------------------------+ --- + 0 X-as ---> + LEFT +*/ + +//-- which half do you want to print? +printBaseShell = true; +printLidShell = true; + +//-- Edit these parameters for your own board dimensions +wallThickness = 1.2; +basePlaneThickness = 1.0; +lidPlaneThickness = 1.0; + +//-- Label depths +baseLabelDepth = 0.4; +lidLabelDepth = 0.4; +leftLabelDepth = 0.4; +rightLabelDepth = 0.4; +frontLabelDepth = 0.4; +backLabelDepth = 0.4; + +//-- Total height of box = basePlaneThickness + lidPlaneThickness +//-- + baseWallHeight + lidWallHeight +//-- space between pcb and lidPlane := +//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness) +baseWallHeight = 8; +lidWallHeight = 5; + +//-- ridge where base and lid off box can overlap +//-- Make sure this isn't less than lidWallHeight +ridgeHeight = 3.0; +ridgeSlack = 0.2; +roundRadius = 5.0; + +//-- pcb dimensions +pcbLength = 30; +pcbWidth = 15; +pcbThickness = 1.5; + +//-- How much the PCB needs to be raised from the base +//-- to leave room for solderings and whatnot +standoffHeight = 3.0; +pinDiameter = 2.0; +pinHoleSlack = 0.2; +standoffDiameter = 4; + +//-- padding between pcb and inside wall +paddingFront = 1; +paddingBack = 1; +paddingRight = 1; +paddingLeft = 1; + + +//-- D E B U G -----------------//-> Default --------- +showSideBySide = true; //-> true +onLidGap = 3; +shiftLid = 1; +hideLidWalls = false; //-> false +colorLid = "yellow"; +hideBaseWalls = false; //-> false +colorBase = "white"; +showPCB = false; //-> false +showMarkers = false; //-> false +inspectX = 0; //-> 0=none (>0 from front, <0 from back) +inspectY = 0; //-> 0=none (>0 from left, <0 from right) +//-- D E B U G --------------------------------------- + +/* +********* don't change anything below this line *************** +*/ + +//-- constants, do not change +yappRectangle = 0; +yappCircle = 1; +yappBoth = 2; +yappLidOnly = 3; +yappBaseOnly = 4; +yappHole = 5; +yappPin = 6; +yappLeft = 7; +yappRight = 8; +yappFront = 9; +yappBack = 10; +yappCenter = 11; +yappSymmetric = 12; +yappAllCorners = 13; + +//------------------------------------------------------------------- + +shellInsideWidth = pcbWidth+paddingLeft+paddingRight; +shellWidth = shellInsideWidth+(wallThickness*2)+0; +shellInsideLength = pcbLength+paddingFront+paddingBack; +shellLength = pcbLength+(wallThickness*2)+paddingFront+paddingBack; +shellInsideHeight = baseWallHeight+lidWallHeight; +shellHeight = basePlaneThickness+shellInsideHeight+lidPlaneThickness; +pcbX = wallThickness+paddingBack; +pcbY = wallThickness+paddingLeft; +pcbYlid = wallThickness+pcbWidth+paddingRight; +pcbZ = basePlaneThickness+standoffHeight+pcbThickness; +//pcbZlid = (baseWallHeight+lidWallHeight+basePlaneThickness)-(standoffHeight); +pcbZlid = (baseWallHeight+lidWallHeight+lidPlaneThickness) + -(standoffHeight+pcbThickness); + + +//-- pcb_standoffs -- origin is pcb[0,0,0] +// (0) = posx +// (1) = posy +// (2) = { yappBoth | yappLidOnly | yappBaseOnly } +// (3) = { yappHole, YappPin } +pcbStands = [ + // , [20, 20, yappBoth, yappPin] + // , [3, 3, yappBoth, yappPin] + // , [pcbLength-10, pcbWidth-3, yappBoth, yappPin] + ]; + +//-- Lid plane -- origin is pcb[0,0,0] +// (0) = posx +// (1) = posy +// (2) = width +// (3) = length +// (4) = angle +// (5) = { yappRectangle | yappCircle } +// (6) = { yappCenter } +cutoutsLid = [ + // [20, 0, 10, 24, 0, yappRectangle] + // , [pcbWidth-6, 40, 12, 4, 20, yappCircle] + // , [30, 25, 10, 14, 45, yappRectangle, yappCenter] + ]; + +//-- base plane -- origin is pcb[0,0,0] +// (0) = posx +// (1) = posy +// (2) = width +// (3) = length +// (4) = angle +// (5) = { yappRectangle | yappCircle } +// (6) = { yappCenter } +cutoutsBase = [ + // [30, 0, 10, 24, yappRectangle] + // , [pcbLength/2, pcbWidth/2, 12, 4, yappCircle] + // , [pcbLength-8, 25, 10, 14, yappRectangle, yappCenter] + ]; + +//-- front plane -- origin is pcb[0,0,0] +// (0) = posy +// (1) = posz +// (2) = width +// (3) = height +// (4) = angle +// (5) = { yappRectangle | yappCircle } +// (6) = { yappCenter } +cutoutsFront = [ + // [10, 5, 12, 15, 0, yappRectangle] + // , [30, 7.5, 15, 9, 0, yappRectangle, yappCenter] + // , [0, 2, 10, 0, 0, yappCircle] + ]; + +//-- back plane -- origin is pcb[0,0,0] +// (0) = posy +// (1) = posz +// (2) = width +// (3) = height +// (4) = angle +// (5) = { yappRectangle | yappCircle } +// (6) = { yappCenter } +cutoutsBack = [ + // [10, 0, 10, 18, 0, yappRectangle] + // , [30, 0, 10, 8, 0, yappRectangle, yappCenter] + // , [pcbWidth, 0, 8, 0, 0, yappCircle] + ]; + +//-- left plane -- origin is pcb[0,0,0] +// (0) = posx +// (1) = posz +// (2) = width +// (3) = height +// (4) = angle +// (5) = { yappRectangle | yappCircle } +// (6) = { yappCenter } +cutoutsLeft = [ + // , [0, 0, 15, 20, 0, yappRectangle] + // , [30, 5, 25, 10, 0, yappRectangle, yappCenter] + // , [pcbLength-10, 2, 10, 0, 0, yappCircle] + ]; + +//-- right plane -- origin is pcb[0,0,0] +// (0) = posx +// (1) = posz +// (2) = width +// (3) = height +// (4) = angle +// (5) = { yappRectangle | yappCircle } +// (6) = { yappCenter } +cutoutsRight = [ + // [0, 0, 15, 7, 0, yappRectangle] + // , [30, 10, 25, 15, 0, yappRectangle, yappCenter] + // , [pcbLength-10, 2, 10, 0, 0, yappCircle] + ]; + +//-- connectors -- origen = box[0,0,0] +// (0) = posx +// (1) = posy +// (2) = screwDiameter +// (3) = insertDiameter +// (4) = outsideDiameter +// (5) = { yappAllCorners } +connectors = [ + // [10, 10, 2, 3, 2] + // , [30, 20, 4, 6, 9] + // , [4, 3, 34, 3, yappFront] + // , [25, 3, 3, 3, yappBack] + ]; + +//-- base mounts -- origen = box[x0,y0] +// (0) = posx | posy +// (1) = screwDiameter +// (2) = width +// (3) = height +// (4..7) = yappLeft / yappRight / yappFront / yappBack (one or more) +// (5) = { yappCenter } +baseMounts = [ + // [-5, 3.3, 10, 3, yappLeft, yappRight, yappCenter] + // , [40, 3, 8, 3, yappBack, yappFront] + // , [4, 3, 34, 3, yappFront] + // , [25, 3, 3, 3, yappBack] + ]; + +//-- snap Joins -- origen = box[x0,y0] +// (0) = posx | posy +// (1) = width +// (2..5) = yappLeft / yappRight / yappFront / yappBack (one or more) +// (n) = { yappSymmetric } +snapJoins = [ + // [2, 5, yappLeft, yappRight, yappSymmetric] + // [5, 10, yappLeft] + // , [shellLength-2, 10, yappLeft] + // , [20, 10, yappFront, yappBack] + // , [2.5, 5, yappBack, yappFront, yappSymmetric] + ]; + +//-- origin of labels is box [0,0,0] +// (0) = posx +// (1) = posy/z +// (2) = orientation +// (3) = plane {lid | base | left | right | front | back } +// (4) = font +// (5) = size +// (6) = "label text" +labelsPlane = [ + [5, 5, 0, "lid", "Liberation Mono:style=bold", 5, "YAPP" ] + ]; + + +//=========================================================== +function getMinRad(p1, wall) = ((p1<(wall+0.001)) ? 1 : (p1 - wall)); +function isTrue(w, aw, from) = (( w==aw[from] + || w==aw[from+1] + || w==aw[from+2] + || w==aw[from+3] + || w==aw[from+4] + || w==aw[from+5] + || w==aw[from+6] ) ? 1 : 0); +function minOutside(o, d) = ((((d*2)+1)>=o) ? (d*2)+1 : o); +function newHeight(T, h, z, t) = (((h+z)>t)&&(T=="base")) ? t+standoffHeight : h; +//function lowestVal(v1, minV) = ((v1<minV) ? minV : v1); +//function highestVal(v1, maxV) = ((v1>maxV) ? maxV : v1); +//=========================================================== +module printBaseMounts() +{ + //echo("printBaseMounts()"); + + //------------------------------------------------------------------- + module roundedRect(size, radius) + { + x1 = size[0]; + x2 = size[1]; + y = size[2]; + l = size[3]; + h = size[4]; + + //echo("roundRect:", x1=x1, x2=x2, y=y, l=l); + //if (l>radius) + { + linear_extrude(h) + { + hull() + { + // place 4 circles in the corners, with the given radius + translate([(x1+radius), (y+radius), 0]) + circle(r=radius); + + translate([(x1+radius), (y+l)+radius, 0]) + circle(r=radius); + + translate([(x2+radius), (y+l)+radius, 0]) + circle(r=radius); + + translate([(x2+radius), (y+radius), 0]) + circle(r=radius); + } + } // extrude.. + } // translate + + } // roundRect() + //------------------------------------------------------------------- + + module oneMount(bm, scrwX1pos, scrwX2pos) + { + // [0]=pos, [1]=scrwDiameter, [2]=len + outRadius = bm[1]; // rad := diameter (r=6 := d=6) + bmX1pos = scrwX1pos-bm[1]; + bmX2pos = scrwX2pos-outRadius; + bmYpos = (bm[1]*-2); + bmLen = (bm[1]*4)+bmYpos; + + difference() + { + { + color("red") + //--roundedRect x1, x2, y , l, h + roundedRect([bmX1pos,bmX2pos,bmYpos,bmLen,bm[3]], outRadius); + } + + translate([0, (bm[1]*-1), -1]) + { + hull() + { + linear_extrude(bm[3]+2) + { + //===translate([scrwX1pos, (bm[1]*-1.3), 4]) + translate([scrwX1pos,0, 4]) + color("blue") + { + circle(bm[1]/2); + } + //===translate([scrwX2pos, (bm[1]*-1.3), -4]) + //==translate([scrwX2pos, sW+scrwYpos*-1, -4]) + translate([scrwX2pos, 0, -4]) + color("blue") + circle(bm[1]/2); + } // extrude + } // hull + } // translate + + } // difference.. + + } // oneMount() + + //-------------------------------------------------------------------- + function calcScrwPos(p, l, ax, c) = (c==1) ? (ax/2)-(l/2) : p; + function maxWidth(w, r, l) = (w>(l-(r*4))) ? l-(r*4) : w; + function minPos(p, r) = (p<(r*2)) ? r*2 : p; + function maxPos(p, w, r, mL) = ((p+w)>(mL-(r*2))) ? mL-(w+(r*2)) : p; + //-------------------------------------------------------------------- + + //-------------------------------------------------------- + //-- position is: [(shellLength/2), + //-- shellWidth/2, + //-- (baseWallHeight+basePlaneThickness)] + //-------------------------------------------------------- + //-- back to [0,0,0] + translate([(shellLength/2)*-1, + (shellWidth/2)*-1, + (baseWallHeight+basePlaneThickness)*-1]) + { + if (showMarkers) + { + color("red") translate([0,0,((shellHeight+onLidGap)/2)]) %cylinder(r=1,h=shellHeight+onLidGap+20, center=true); + } + + for (bm = baseMounts) + { + c = isTrue(yappCenter, bm, 5); + + // (0) = posx | posy + // (1) = screwDiameter + // (2) = width + // (3) = Height + // (4..7) = yappLeft / yappRight / yappFront / yappBack (one or more) + if (isTrue(yappLeft, bm, 4)) + { + newWidth = maxWidth(bm[2], bm[1], shellLength); + tmpPos = calcScrwPos(bm[0], newWidth, shellLength, c); + tmpMinPos = minPos(tmpPos, bm[1]); + scrwX1pos = maxPos(tmpMinPos, newWidth, bm[1], shellLength); + scrwX2pos = scrwX1pos + newWidth; + oneMount(bm, scrwX1pos, scrwX2pos); + + } // if yappLeft + + // (0) = posx | posy + // (1) = screwDiameter + // (2) = width + // (3) = Height + // (4..7) = yappLeft / yappRight / yappFront / yappBack (one or more) + if (isTrue(yappRight, bm, 4)) + { + rotate([0,0,180]) + { + mirror([1,0,0]) + { + translate([0,shellWidth*-1, 0]) + { + newWidth = maxWidth(bm[2], bm[1], shellLength); + tmpPos = calcScrwPos(bm[0], newWidth, shellLength, c); + tmpMinPos = minPos(tmpPos, bm[1]); + scrwX1pos = maxPos(tmpMinPos, newWidth, bm[1], shellLength); + scrwX2pos = scrwX1pos + newWidth; + oneMount(bm, scrwX1pos, scrwX2pos); + } + } // mirror() + } // rotate + + } // if yappRight + + // (0) = posx | posy + // (1) = screwDiameter + // (2) = width + // (3) = Height + // (4..7) = yappLeft / yappRight / yappFront / yappBack (one or more) + if (isTrue(yappFront, bm, 4)) + { + rotate([0,180,0]) + { + rotate([0,0,90]) + { + rotate([0,0,180]) + { + mirror([1,0,0]) + { + translate([0,shellLength*-1, (bm[3]*-1)]) + { + newWidth = maxWidth(bm[2], bm[1], shellWidth); + tmpPos = calcScrwPos(bm[0], newWidth, shellWidth, c); + tmpMinPos = minPos(tmpPos, bm[1]); + scrwX1pos = maxPos(tmpMinPos, newWidth, bm[1], shellWidth); + scrwX2pos = scrwX1pos + newWidth; + oneMount(bm, scrwX1pos, scrwX2pos); + } + } // mirror + } // rotate Z-ax + } // rotate Z-?? + } // rotate-Y + + } // if yappFront + + // (0) = posx | posy + // (1) = screwDiameter + // (2) = width + // (3) = Height + // (4..7) = yappLeft / yappRight / yappFront / yappBack (one or more) + if (isTrue(yappBack, bm, 4)) + { + //echo("printBaseMount: BACK!!"); + rotate([0,180,0]) + { + rotate([0,0,90]) + { + translate([0,0,(bm[3]*-1)]) + { + newWidth = maxWidth(bm[2], bm[1], shellWidth); + tmpPos = calcScrwPos(bm[0], newWidth, shellWidth, c); + tmpMinPos = minPos(tmpPos, bm[1]); + scrwX1pos = maxPos(tmpMinPos, newWidth, bm[1], shellWidth); + scrwX2pos = scrwX1pos + newWidth; + oneMount(bm, scrwX1pos, scrwX2pos); + } + } // rotate Z-ax + } // rotate Y-ax + + } // if yappFront + + } // for .. + + } // translate to [0,0,0] + +} // printBaseMounts() + + +//=========================================================== +//-- snapJoins -- origen = box[x0,y0] +// (0) = posx | posy +// (1) = width +// (2..5) = yappLeft / yappRight / yappFront / yappBack (one or more) +// (n) = { yappSymmetric } +module printBaseSnapJoins() +{ + snapHeight = 2; + snapDiam = 1.2; + + for (snj = snapJoins) + { + snapWidth = snj[1]; + snapZposLR = (basePlaneThickness+baseWallHeight)-((snapHeight/2)-0.2); + snapZposBF = (basePlaneThickness+baseWallHeight)-((snapHeight/2)-0.2); + tmpYmin = (roundRadius*2)+(snapWidth/2); + tmpYmax = shellWidth - tmpYmin; + //-aaw- tmpY = lowestVal(snj[0]+(snapWidth/2), tmpYmin); + tmpY = max(snj[0]+(snapWidth/2), tmpYmin); + //-aaw- snapYpos = highestVal(tmpY, tmpYmax); + snapYpos = min(tmpY, tmpYmax); + + tmpXmin = (roundRadius*2)+(snapWidth/2); + tmpXmax = shellLength - tmpXmin; + //-aaw- tmpX = lowestVal(snj[0]+(snapWidth/2), tmpXmin); + tmpX = max(snj[0]+(snapWidth/2), tmpXmin); + //-aaw- snapXpos = highestVal(tmpX, tmpXmax); + snapXpos = min(tmpX, tmpXmax); + + if (isTrue(yappLeft, snj, 2)) + { + translate([snapXpos-(snapWidth/2), + wallThickness/2, + snapZposLR]) + { + rotate([0,90,0]) + //color("blue") cylinder(d=wallThickness, h=snapWidth); + color("blue") cylinder(d=snapDiam, h=snapWidth); // 13-02-2022 + } + if (isTrue(yappSymmetric, snj, 3)) + { + translate([shellLength-(snapXpos+(snapWidth/2)), + wallThickness/2, + snapZposLR]) + { + rotate([0,90,0]) + color("blue") cylinder(d=snapDiam, h=snapWidth); + } + + } // yappCenter + } // yappLeft + + if (isTrue(yappRight, snj, 2)) + { + translate([snapXpos-(snapWidth/2), + shellWidth-(wallThickness/2), + snapZposLR]) + { + rotate([0,90,0]) + //color("blue") cylinder(d=wallThickness, h=snapWidth); + color("blue") cylinder(d=snapDiam, h=snapWidth); // 13-02-2022 + } + if (isTrue(yappSymmetric, snj, 3)) + { + translate([shellLength-(snapXpos+(snapWidth/2)), + shellWidth-(wallThickness/2), + snapZposLR]) + { + rotate([0,90,0]) + //color("blue") cylinder(d=wallThickness, h=snapWidth); + color("blue") cylinder(d=snapDiam, h=snapWidth); // 13-02-2022 + } + + } // yappCenter + } // yappRight + + if (isTrue(yappBack, snj, 2)) + { + translate([(wallThickness/2), + snapYpos-(snapWidth/2), + snapZposBF]) + { + rotate([270,0,0]) + //color("blue") cylinder(d=wallThickness, h=snapWidth); + color("blue") cylinder(d=snapDiam, h=snapWidth); // 13-02-2022 + } + if (isTrue(yappSymmetric, snj, 3)) + { + translate([(wallThickness/2), + shellWidth-(snapYpos+(snapWidth/2)), + snapZposBF]) + { + rotate([270,0,0]) + //color("blue") cylinder(d=wallThickness, h=snapWidth); + color("blue") cylinder(d=snapDiam, h=snapWidth); // 13-02-2022 + } + + } // yappCenter + } // yappBack + + if (isTrue(yappFront, snj, 2)) + { + translate([shellLength-(wallThickness/2), + snapYpos-(snapWidth/2), + snapZposBF]) + { + rotate([270,0,0]) + //color("blue") cylinder(d=wallThickness, h=snapWidth); + color("blue") cylinder(d=snapDiam, h=snapWidth); // 13-02-2022 + } + if (isTrue(yappSymmetric, snj, 3)) + { + translate([shellLength-(wallThickness/2), + shellWidth-(snapYpos+(snapWidth/2)), + snapZposBF]) + { + rotate([270,0,0]) + //color("blue") cylinder(d=wallThickness, h=snapWidth); + color("blue") cylinder(d=snapDiam, h=snapWidth); // 13-02-2022 + } + + } // yappCenter + } // yappFront + + + } // for snj .. + +} // printBaseSnapJoins() + + +//=========================================================== +//-- snapJoins -- origen = box[x0,y0] +// (0) = posx | posy +// (1) = width +// (2..5) = yappLeft / yappRight / yappFront / yappBack (one or more) +// (n) = { yappSymmetric } +module printLidSnapJoins() +{ + for (snj = snapJoins) + { + snapWidth = snj[1]+1; + snapHeight = 2; + snapDiam = 1.4; // fixed + + tmpYmin = (roundRadius*2)+(snapWidth/2); + tmpYmax = shellWidth - tmpYmin; + //-aaw- tmpY = lowestVal(snj[0]+(snapWidth/2), tmpYmin); + tmpY = max(snj[0]+(snapWidth/2), tmpYmin); + //-aaw- snapYpos = highestVal(tmpY, tmpYmax); + snapYpos = min(tmpY, tmpYmax); + + tmpXmin = (roundRadius*2)+(snapWidth/2); + tmpXmax = shellLength - tmpXmin; + //-aaw- tmpX = lowestVal(snj[0]+(snapWidth/2), tmpXmin); + tmpX = max(snj[0]+(snapWidth/2), tmpXmin); + //-aaw- snapXpos = highestVal(tmpX, tmpXmax); + snapXpos = min(tmpX, tmpXmax); + + snapZposLR = ((lidPlaneThickness+lidWallHeight)*-1)-(snapHeight/2)-0.5; + snapZposBF = ((lidPlaneThickness+lidWallHeight)*-1)-(snapHeight/2)-0.5; + + if (isTrue(yappLeft, snj, 2)) + { + translate([snapXpos-(snapWidth/2)-0.5, + -0.5, + snapZposLR]) + { + //color("red") cube([snapWidth, 5, wallThickness]); + color("red") cube([snapWidth, wallThickness+1, snapDiam]); // 13-02-2022 + } + if (isTrue(yappSymmetric, snj, 3)) + { + translate([shellLength-(snapXpos+(snapWidth/2))+0.5, + -0.5, + snapZposLR]) + { + //color("red") cube([snapWidth, 5, wallThickness]); + color("red") cube([snapWidth, wallThickness+1, snapDiam]); // 13-02-2022 + } + + } // yappSymmetric + } // yappLeft + + if (isTrue(yappRight, snj, 2)) + { + translate([snapXpos-(snapWidth/2)-0.5, + shellWidth-(wallThickness-0.5), + snapZposLR]) + { + //color("red") cube([snapWidth, 5, wallThickness]); + color("red") cube([snapWidth, wallThickness+1, snapDiam]); // 13-02-2022 + } + if (isTrue(yappSymmetric, snj, 3)) + { + translate([shellLength-(snapXpos+(snapWidth/2)-0.5), + shellWidth-(wallThickness-0.5), + snapZposLR]) + { + //color("red") cube([snapWidth, 5, wallThickness]); + color("green") cube([snapWidth, wallThickness+1, snapDiam]); // 13-02-2022 + } + + } // yappSymmetric + } // yappRight + + if (isTrue(yappBack, snj, 2)) + { + //translate([(wallThickness/2)+2, + translate([-0.5, + snapYpos-(snapWidth/2)-0.5, + snapZposBF]) + { + //color("red") cube([5, snapWidth, wallThickness] |