[
  {
    "path": ".gitignore",
    "content": ""
  },
  {
    "path": "CHANGELOG.md",
    "content": "# YAPP Change Log\n\n## Rev. v3.0.1 (2024-01-15)\n* Re-organzie Git repo to maintain only the latest version in the `main` branch.\n* The core files (`YAPP_Template_v3.scad`, `YAPPgenerator_v3.scad`) now keep only a major version in their filename, and live in the root of the repo.\n\n## Rev. 3.0.0  (2023-12-01)\n\nLead Developer for v3.0: <a href=\"https://github.com/rosenhauer\">Dave Rosenhauer</a>\nDave added new functionality, fixed many bugs, is the creator of the v3.0 API and did a lot of code cleanup.\nHe made more than 20 merge requests in three weeks.\n\n**New functionality**\n<pre>\nCutout Shapes\n\tCutouts now support more shapes.\n\t\tyappRectangle\t    : Rectangle with size 'width' x 'length' \n\t\tyappCircle\t    : Circle with radius of 'radius'\n\t\tyappRoundedRect\t    : Rectangle with size 'width' x 'length' and corner \n                                      radius of 'radius'\n\t\tyappPolygon\t    : User defined polygon. Three standard shapes are \n                                      included for use/reference - 'shapeIsoTriangle', \n                                      'shapeHexagon', 'shape6ptStar' \n\t\tyappCircleWithFlats : Circle with radius of 'radius' with the sides \n                                      clipped to width (length is not used)\n    \t\tyappCircleWithKey   : Circle with radius of 'radius' with a rectangular \n                                      key of width x length (length is key depth)\n\nCutout Masks\n\nFillets\n\tFillets are automatically added to all appropriate items.  \n\tThis can be overridden with the yappNoFillet option.  \n\tFillet radius can also be changed from default (same as connected wall thickness) \n\twith the filletRadius parameter.\n\nRidge Extension\n  Extension from the lid into the case for adding split opening at various heights\n\n//========= HOOK dummy functions ============================\n  \n// Hook functions allow you to add 3d objects to the case.\n// Lid/Base = Shell part to attach the object to.\n// Inside/Outside = Join the object from the midpoint of the shell to the inside/outside.\n\n//===========================================================\n// origin = box(0,0,0)\nmodule hookLidInside()\n{\n} // hookLidInside()\n  \n//===========================================================\n// origin = box(0,0,shellHeight)\nmodule hookLidOutside()\n{\n} // hookLidOutside()\n\n//===========================================================\n// origin = box(0,0,0)\nmodule hookBaseInside()\n{\n} // hookBaseInside()\n\n//===========================================================\n// origin = box(0,0,0)\nmodule hookBaseOutside()\n{\n} // hookBaseOutside()\n\n//===========================================================\n//===========================================================\n</pre>\n\n**Updated definition standards:**\n<pre>\n     Parameters:\n\tp(0,1 ...) = a 'p' with a number between parentheses indicates a \n\t                    'positional' parameter.\n\tn(a,b ...) = a 'n' with a letter between parentheses indicates an \n\t                    optional, 'non-positional' parameter must be after \n\t                    the required parameters.\n\t{ yappParameter }\n\t&lt;Default value&gt;\n\t| means one or more values from the list are allowed\n\t, means only one value from the list is allowed\n</pre>\n\n**This version breaks with the API for the following objects:**\n\n<pre>\n===================================================================\n  *** PCB Supports ***\n  Pin and Socket standoffs \n-------------------------------------------------------------------\nDefault origin =  yappCoordPCB : pcb[0,0,0]\n\nParameters:\n Required:\n  p(0) = posx\n  p(1) = posy\n Optional:\n  p(2) = Height to bottom of PCB : Default = defaultStandoffHeight\n  p(3) = standoffDiameter    = defaultStandoffDiameter;\n  p(4) = standoffPinDiameter = defaultStandoffPinDiameter;\n  p(5) = standoffHoleSlack   = defaultStandoffHoleSlack;\n  p(6) = filletRadius (0 = auto size)\n  n(a) = { &lt;yappBoth&gt; | yappLidOnly | yappBaseOnly }\n  n(b) = { &lt;yappPin&gt;, yappHole } : Baseplate support treatment\n  n(c) = { &lt;yappAllCorners&gt; | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n  n(d) = { &lt;yappCoordPCB&gt;, yappCoordBox }  \n  n(e) = { yappNoFillet }\n</pre>\n\n<pre>\n===================================================================\n  *** Connectors ***\n  Standoffs with hole through base and socket in lid for screw type connections.\n-------------------------------------------------------------------\nDefault origin = yappCoordBox: box[0,0,0]\n  \nParameters:\n Required:\n  p(0) = posx\n  p(1) = posy\n  p(2) = pcbStandHeight\n  p(3) = screwDiameter\n  p(4) = screwHeadDiameter : (don't forget to add extra for the fillet)\n  p(5) = insertDiameter\n  p(6) = outsideDiameter\n Optional:\n  p(7) = filletRadius : Default = 0/Auto(0 = auto size)\n  n(a) = { &lt;yappAllCorners&gt; | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n  n(b) = { &lt;yappCoordBox&gt;, yappCoordPCB }\n  n(c) = { yappNoFillet }\n</pre>\n\n<pre>\n===================================================================\n  *** Base Mounts ***\n  Mounting tabs on the outside of the box\n-------------------------------------------------------------------\nDefault origin = yappCoordBox: box[0,0,0]\n\nParameters:\n Required:\n  p(0) = pos\n  p(1) = screwDiameter\n  p(2) = width\n  p(3) = height\n Optional:\n  p(4) = filletRadius : Default = 0/Auto(0 = auto size)\n  n(a) = { yappLeft | yappRight | yappFront | yappBack } : (one or more)\n  n(b) = { yappNoFillet }\n</pre>\n\n<pre>\n===================================================================\n  *** Cutouts ***\n  There are 6 cutouts one for each surface:\n    cutoutsBase, cutoutsLid, cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n-------------------------------------------------------------------\nDefault origin = yappCoordBox: box[0,0,0]\n\n                      Required                Not Used        Note\n--------------------+-----------------------+---------------+------------------------------------\nyappRectangle       | width, length         | radius        |\nyappCircle          | radius                | width, length |\nyappRoundedRect     | width, length, radius |               |     \nyappCircleWithFlats | width, radius         | length        | length=distance between flats\nyappCircleWithKey   | width, length, radius |               | width = key width length=key depth\nyappPolygon         | width, length         | radius        | yappPolygonDef object must be provided\n--------------------+-----------------------+---------------+------------------------------------\n\nParameters:\n Required:\n  p(0) = from Back\n  p(1) = from Left\n  p(2) = width\n  p(3) = length\n  p(4) = radius\n  p(5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n\t         | yappCircleWithFlats | yappCircleWithKey}\n Optional:\n  p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n  p(7) = angle : Default = 0\n  n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n  n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.\n  n(c) = { &lt;yappCoordBox&gt;, yappCoordPCB }\n  n(d) = { &lt;yappOrigin&gt;, yappCenter }\n  n(e) = { &lt;yappGlobalOrigin&gt;, yappLeftOrigin } : Only affects Top, Back and Right Faces\n</pre>\n\n<pre>\n===================================================================\n  *** Snap Joins ***\n-------------------------------------------------------------------\nDefault origin = yappCoordBox: box[0,0,0]\n\nParameters:\n Required:\n  p(0) = posx | posy\n  p(1) = width\n  p(2) = { yappLeft | yappRight | yappFront | yappBack } : (one or more)\n Optional:\n  n(a) = { &lt;yappOrigin&gt;, yappCenter }\n  n(b) = { yappSymmetric }\n  n(c) = { yappRectangle } == Make a diamond shape snap\n</pre>\n\n<pre>\n===================================================================\n  *** Light Tubes ***\n-------------------------------------------------------------------\nDefault origin = yappCoordPCB: PCB[0,0,0]\n\nParameters:\n Required:\n  p(0) = posx\n  p(1) = posy\n  p(2) = tubeLength\n  p(3) = tubeWidth\n  p(4) = tubeWall\n  p(5) = gapAbovePcb\n  p(6) = { yappCircle|yappRectangle } : tubeType\n Optional:\n  p(7) = lensThickness : (how much to leave on the top of the lid for the light \n\t to shine through 0 for open hole, Default = 0/Open\n  p(8) = Height to top of PCB : Default = defaultStandoffHeight+pcbThickness\n  p(9) = filletRadius : Default = 0/Auto \n  n(a) = { &lt;yappCoordPCB&gt;, yappCoordBox }\n  n(b) = { yappNoFillet }\n</pre>\n\n<pre>\n===================================================================\n  *** Push Buttons ***\n-------------------------------------------------------------------\nDefault origin = yappCoordPCB: PCB[0,0,0]\n\nParameters:\n Required:\n  p(0) = posx\n  p(1) = posy\n  p(2) = capLength for yappRectangle, capDiameter for yappCircle\n  p(3) = capWidth for yappRectangle, not used for yappCircle\n  p(4) = capAboveLid\n  p(5) = switchHeight\n  p(6) = switchTravel\n  p(7) = poleDiameter\n Optional:\n  p(8) = Height to top of PCB : Default = defaultStandoffHeight + pcbThickness\n  p(9) = { &lt;yappRectangle&gt;, yappCircle } : buttonType, Default = yappRectangle\n  p(10) = filletRadius : Default = 0/Auto \n</pre>\n\n## Rev. 2.0  (21-05-2023)\n\n**New functionality *lightTubes* **\n\nWith the **lightTubes** array you can define where you want tubes for LED's and NeoPixles**\n\n<pre>\n//-- lightTubes  -- origin is pcb[0,0,0]\n// (0) = posx\n// (1) = posy\n// (2) = tubeLength\n// (3) = tubeWidth\n// (4) = tubeWall\n// (5) = abovePcb\n// (6) = tubeType  {yappCircle|yappRectangle}\nlightTubes = [\n              //--- 0,    1, 2, 3, 4, 5, 6\n                  [84.5, 21, 3, 6, 1, 4, yappRectangle]\n                , [30,   21, 5, 0, 1, 2, yappCircle]\n              ];     \n</pre>\n\n![lightTube_top](https://github.com/mrWheel/YAPP_Box/assets/5585427/fe4eba60-416b-4b35-b0f3-4e3df204a900)\n![lightTube_a](https://github.com/mrWheel/YAPP_Box/assets/5585427/6c79d4ff-faff-4e8d-8283-2d2a5d49d4d8)\n\n<pre>\nposx        - the position of the center of the led on the X-axes of the PCB\nposy        - the position of the center of the led on the Y-axes of the PCB\ntubeLength  - the length of the tube (if yappRectangle) or the diameter of the tube (if yappCircle)\ntubeWidth   - the width of the tube (not used if yappCircle)\ntubeWall    - the width of the wall around the led\nabovePcp    - how hight the tube will begin with respect to the top of the PCB\ntubeType    - whether the led shows as a circle (yappCircle) or a rectangle (yappRectangle)\n</pre>\n\n\n**New functionality *pushButtons* (experimental)**\n\nWith the **pushButtons** array you can define where you want button guides for tactile switches.</br>\n\n<pre>\n//-- pushButtons  -- origin is pcb[0,0,0]\n// (0) = posx\n// (1) = posy\n// (2) = capLength\n// (3) = capWidth\n// (4) = capAboveLid\n// (5) = switchHeight\n// (6) = switchTrafel\n// (7) = poleDiameter\n// (8) = buttonType  {yappCircle|yappRectangle}\npushButtons = [\n                 [15, 30, 8, 8, 0, 1,   1, 3.5, yappCircle]\n               , [15, 10, 8, 6, 2, 4.5, 1, 3.5, yappRectangle]\n              ];\n</pre>\n\n![buttonGuides](https://github.com/mrWheel/YAPP_Box/assets/5585427/7940ec0e-10a3-408b-8c11-4d811efb7720)\n\nThe \"Plate\" has to be glued to the \"Pole\".\n\n<pre>\nposx         - the position of the center of the tacktile switch on the PCB\nposy         - the position of the center of the tacktile switch on the PCB\ncapLength    - the length of the button (if yappRectangle) or the diameter (if yappCircle)\ncapWidth     - the width of the button (if yappRectangle, otherwise ignored)\ncapAboveLid  - how much the button cap is above the lid\nswitchHeight - the height of the tactile switch\nswitchTrafel - the distance the button has to trafel to activate the tacktile switch\npoleDiameter - the diameter of the pole that connects the button cap with the plate\nbuttonType   - either yappCircle or yappRectangle\n</pre>\n\n<hr>\n\n## Rev. 1.8  (22-02-2023)\n\n**This version breaks with the API for the following array's:**\n\n* pcbStand[..] (extra parameter for standoffHeight)\n* connectors[..] (extra parameter for baseConnector Height)\n\n<pre>\n//-- pcb_standoffs  -- origin is pcb[0,0,0]\n// (0) = posx\n// (1) = posy\n// (2) = standoffHeight\n// (3) = flangeHeight\n// (4) = flangeDiameter\n// (5) = { yappBoth | yappLidOnly | yappBaseOnly }\n// (6) = { yappHole, YappPin }\n// (7) = { yappAllCorners | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\npcbStands = [\n                [3,  3, 5, 3, 11, yappBoth, yappPin, yappAllCorners]\n               ,[5,  5, 5, 4, 10, yappBoth, yappPin, yappBackLeft, yappFrontRight]\n               ,[8,  8, 5, 4, 11, yappBoth, yappPin]\n               ,[pcbLength-15, pcbWidth-15, 8, 4, 12, yappBoth, yappPin]\n             ];\n</pre>\n<pre>\n//-- connectors\n//-- normal         : origen = box[0,0,0]\n//-- yappConnWithPCB: origen = pcb[0,0,0]\n// (0) = posx\n// (1) = posy\n// (2) = pcbStandHeight\n// (3) = screwDiameter\n// (4) = screwHeadDiameter\n// (5) = insertDiameter\n// (6) = outsideDiameter\n// (7) = flangeHeight\n// (8) = flangeDiam\n// (9) = { yappConnWithPCB }\n// (10) = { yappAllCorners | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\nconnectors   =  [\n                    [ 8,  8, 5, 2.5, 2.8, 3.8, 6, 6, 15, yappAllCorners]\n                  , [28, 58, 5, 2.5, 2.8, 3.8, 6, 6, 25, yappConnWithPCB]\n                ];\n\n</pre>\n\n<hr>\n\n## Rev. 1.7\n\n**This version breaks with the API for the following array's:**\n\n* pcbStand[..] (extra parameter for flange)\n* connectors[..] (huge change lots of extra parameters)\n* connectosPCB[..] (removed)\n\n<pre>\n//-- pcb_standoffs  -- origin is pcb[0,0,0]\n// (0) = posx\n// (1) = posy\n// (2) = flangeHeight\n// (3) = flangeDiameter\n// (4) = { yappBoth | yappLidOnly | yappBaseOnly }\n// (5) = { yappHole, YappPin }\n// (6) = { yappAllCorners | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\npcbStands = [\n                [3,  3, 3, 11, yappBoth, yappPin, yappAllCorners]\n               ,[5,  5, 4, 10, yappBoth, yappPin, yappBackLeft, yappFrontRight]\n               ,[8,  8, 4, 11, yappBoth, yappPin]\n               ,[pcbLength-15, pcbWidth-15, 4, 12, yappBoth, yappPin]\n             ];\n</pre>\n<pre>\n//-- connectors\n//-- normal         : origen = box[0,0,0]\n//-- yappConnWithPCB: origen = pcb[0,0,0]\n// (0) = posx\n// (1) = posy\n// (2) = screwDiameter\n// (3) = screwHeadDiameter\n// (4) = insertDiameter\n// (5) = outsideDiameter\n// (6) = flangeHeight\n// (7) = flangeDiam\n// (8) = { yappConnWithPCB }\n// (9) = { yappAllCorners | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\nconnectors   =  [\n                    [8, 8, 2.5, 2.8, 3.8, 6, 6, 15, yappAllCorners]\n                  , [28, 58, 2.5, 2.8, 3.8, 6, 6, 25, yappConnWithPCB]\n                ];\n\n</pre>\n\nThe depth of the screw in the connectors is now depending on the standoffHeight so the\nscrew size does not change anymore.\n![YAPP_connectorRevised](https://user-images.githubusercontent.com/5585427/220582716-41c8d56b-0782-42ce-937f-401495f3889b.png)\n\n\n<hr>\n\n## Rev. 1.6\n\n- new cutoutGrills array\n<pre>\n//-- cutoutGrills    -- origin is box[x0,y0]\n// (0) = xPos\n// (1) = yPos\n// (2) = grillWidth\n// (3) = grillLength\n// (4) = gWidth\n// (5) = gSpace\n// (6) = gAngle\n// (7) = plane [ \"base\" | \"lid\" ]\n// (8) = {polygon points} (optional)\n\n\ncutoutGrills = [\n                 [22, 22, 90, 90, 2, 3, 50, \"base\", [  [0,15],[20,15],[30,0],[40,15],[60,15]\n                                                      ,[50,30],[60,45], [40,45],[30,60]\n                                                      ,[20,45], [0,45],[10,30] ]\n                 ]\n                ,[15, 10, 50, 10, 2, 3, -20, \"base\"]\n                ,[15, 15, 10, 50, 2, 3, -45, \"lid\"]\n                ,[15, 85, 50, 10, 2, 3,  20, \"base\"]\n                ,[85, 15, 10, 50, 2, 3,  45, \"lid\"]\n               ];\n</pre>\n![cutoutGrills-v16](https://user-images.githubusercontent.com/5585427/192301088-056f7f9c-f89f-40a2-a7ba-f4496d4e722c.png)\n\n**Be aware**: this functionality needs a **huge** amount of rendering elements.\n\nYou can set this at `Preferences->Advanced->Turn of rendering at 100000 elements`\n<hr>\n\n## Rev. 1.5\n\n- Various bug-fixes\n- Connectors now have a flange at the basePlane and lidPlane for a better adhesion\n\n*This release breaks with previous releases in the extra parm \"**depth**\" in the labels array!!*\n\nThe labels now have this syntax:\n<pre>\n//-- origin of labels is box [0,0,0]\n// (0) = posx\n// (1) = posy/z\n// (2) = orientation\n// (3) = depth\n// (4) = plane {lid | base | left | right | front | back }\n// (5) = font\n// (6) = size\n// (7) = \"label text\"\n</pre>\n\nExample:\n<pre>\nlabelsPlane = [\n                [10,  10,   0, 0.6, \"lid\",   \"Liberation Mono:style=bold\", 15, \"YAPP\" ]\n               ,[100, 90, 180, 0.8, \"base\",  \"Liberation Mono:style=bold\", 11, \"Base\" ]\n               ,[8,    8,   0, 1.0, \"left\",  \"Liberation Mono:style=bold\",  7, \"Left\" ]\n               ,[10,   5,   0, 1.2, \"right\", \"Liberation Mono:style=bold\",  7, \"Right\" ]\n               ,[40,  23,   0, 1.5, \"front\", \"Liberation Mono:style=bold\",  7, \"Front\" ]\n               ,[5,    5,   0, 2.0, \"back\",  \"Liberation Mono:style=bold\",  8, \"Back\" ]\n              ];\n</pre>\n\nFor your box to work with this release as before you have to add this extra \nparm (as \"wallThickness/2\", \"basePlaneThickness/2\" or \"lidPlaneThickness/2\").\n\nThanks to *Keith Hadley*\n\nThere now is a new array for connectors that holds the PCB. This array is called \"**connectorsPCB**\".\n<pre>\n//-- connectorsPCB -- origin = pcb[0,0,0]\n// (0) = posx\n// (1) = posy\n// (2) = screwDiameter\n// (3) = insertDiameter\n// (4) = outsideDiameter\n// (5) = { yappAllCorners }\n</pre>\n\nExample:\n<pre>\nconnectorsPCB = [\n                  [pcbLength/2, 10, 2.5, 3.8, 5]\n                 ,[pcbLength/2, pcbWidth-10, 2.5, 3.8, 5]\n                ];\n</pre>\nIt takes in account the \"**pcbThickness**\" to calculate the hight of the lid-connector.\n\nThanks to *Oliver Grafe*\n\n![connectorTypes](https://user-images.githubusercontent.com/5585427/192100231-b6df4e7d-50e8-4b75-8e8b-85a4b2d3e3b7.png)\n\n\n<hr>\n\n## Rev. 1.4\n\n*This release breaks with previous releases in the extra parm \"**angle**\" in all the cutouts array's!!!*\n\nAll plane array's now have this syntax:\n\n<pre>\n//-- plane    -- origin is pcb[0,0,0]\n// (0) = posx\n// (1) = posy\n// (2) = width\n// (3) = length\n// (4) = angle\n// (5) = { yappRectangle | yappCircle }\n// (6) = { yappCenter }\n</pre>\n\nFor your box to work with this release you have to add this extra parm (as \"***0***\") to all your cutOut-array-row's\n\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2022 Willem Aandewiel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# YAPP_Box\nYet Another Parametric Projectbox generator\n\nThis OpenSCAD project can be used to create extremely comprehensive and customizable project boxes/enclosures using OpenSCAD.\n\nThe [complete and official documentation gitbook](https://mrwheel-docs.gitbook.io/yappgenerator_en/) explains the entire API.\n\nYou can open Issues here, but please also place them in a comment at one of the following blog posts:\n* \"<a href=\"https://willem.aandewiel.nl/index.php/2022/01/02/yet-another-parametric-projectbox-generator/\">Yet Another Parametric Projectbox generator blog post</a>\" (English)\n* \"<a href=\"https://willem.aandewiel.nl/index.php/2022/01/01/nog-een-geparameteriseerde-projectbox-generator/\">Nog een geparametriseerde projectbox generator</a>\" (Dutch).\n\n<hr>\n\nI have done my best, but it can probably be done simpler. \nIf you think you can help, please contact me or make a Pull Request.\n\n## How to program your Project Box\nIt all starts with the dimensions of the PCB going inside your Project Box, as well as a few other dimensions:\n\n```openscad\nprintBaseShell      = true;\nprintLidShell       = true;\n\n// Edit these parameters for your own board dimensions\nwallThickness       = 1.0;\nbasePlaneThickness  = 1.0;\nlidPlaneThickness   = 1.0;\n\n// Total height of box = basePlaneThickness + lidPlaneThickness \n//                     + baseWallHeight + lidWallHeight\n\nbaseWallHeight      = 7;\nlidWallHeight       = 4;\n\npcbLength           = 88;\npcbWidth            = 49;\npcbThickness        = 1.5;\n                            \n// padding between pcb and inside wall\npaddingFront        = 4;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n// ridge where Base- and Lid- off the box can overlap\n// Make sure this isn't less than lidWallHeight\nridgeHeight         = 3;\nridgeSlack          = 0.2;\nroundRadius         = 2.0;  // don't make this to big..\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 5.0;\npinDiameter         = 1.0;\npinHoleSlack        = 0.5;\nstandoffDiameter    = 4;\n```\n\nYou probably want some cutouts in your box for connectors and stuff.\nFor every plane (side) of the Project Box, there is an array that holds the cutouts for that plane.\n\nA picture is worth a thousand words ...\n\n### Cutouts in the *Right* Plane:\n![YAPP_cutoutsRight](https://user-images.githubusercontent.com/5585427/150956351-cef4fc0e-474d-4b44-b667-1a4d227400b6.png)\n\n### Cutouts in the *Left* Plane:\n![YAPP_cutoutsLeft](https://user-images.githubusercontent.com/5585427/150956356-ec4d5e17-c78e-41ae-bcd7-be8710f5a32c.png)\n\n### Cutouts in the *Back* Plane:\n![YAPP_cutoutsBack](https://user-images.githubusercontent.com/5585427/150956361-aa0c924f-ddc3-4260-a999-be9cd5b80b2e.png)\n\n### Cutouts in the *Front* Plane:\n![YAPP_cutoutsFront](https://user-images.githubusercontent.com/5585427/150956366-d5ca6715-7bdf-4ce7-bae7-1d8c79737eb6.png)\n\n### Cutouts in the *Base*:\n![YAPP_cutoutsBase](https://user-images.githubusercontent.com/5585427/150956371-8ed2d85a-3c49-48c6-b0db-1742053f2455.png)\n\n### Cutouts in the *Lid*:\n![YAPP_cutoutsLid](https://user-images.githubusercontent.com/5585427/150956374-c0de9d91-03a4-4ee3-8475-fecb251e9bca.png)\n\n### Using the *angle* param (rotate around the x/y corner):\n![yappRectangle40dgrs](https://user-images.githubusercontent.com/5585427/157865661-02407bfe-fada-4528-b25c-ea83c94b9467.png)\n\n#### With `yappCenter`, the rectangle will rotate around its center point:\n![yappRectangleCenter10dgrs](https://user-images.githubusercontent.com/5585427/157865668-2b10bbe0-6223-4e6e-b74b-b81fb919f3da.png)\n\n### Base mounts:\n![Screenshot 2022-01-25 at 11 25 46](https://user-images.githubusercontent.com/5585427/150959614-b0d07141-27aa-4df3-b45e-09e662bacde9.png)\n\n### `pcbStands`:\n`pcbStands` fixate the PCB between the base and the lid.\n![YAPP_pcbStands](https://user-images.githubusercontent.com/5585427/150956378-ccdcdd88-9f0c-44cd-986f-70db3bf6d8e2.png)\n\n### Connectors between *Base* and *Lid*:\n![YAPP_connectors](https://user-images.githubusercontent.com/5585427/150956348-cfb4f550-a261-493a-9b86-6175e169b2bc.png)\n\n### ConnectorsPCB between *Base* and *Lid* that fixates the PCB:\n![connectorTypes](https://user-images.githubusercontent.com/5585427/192100231-b6df4e7d-50e8-4b75-8e8b-85a4b2d3e3b7.png)\n\n![YAPP_connector_D](https://user-images.githubusercontent.com/5585427/150956341-5c087f45-c228-46db-8eb1-b3add2e9afca.png)\n\nInserts are great for making a screw connection between the base and the lid.\n![Ruthex-insert-a](https://user-images.githubusercontent.com/5585427/150959697-beaf6a25-b1df-4a1d-901b-dbcdf486b612.png)\n\n\n### Snap Joins:\n![snapJoins1](https://user-images.githubusercontent.com/5585427/153425134-ec2348cd-45a7-4e2d-8cb6-2f69e6f7f80b.png)\n\n![snapJoins2](https://user-images.githubusercontent.com/5585427/153425125-04daa8ca-1126-4467-94a8-245c584d2333.png)\n\n#### Snap Joins *Symmetrical*:\n![snapJoinsSymetric](https://user-images.githubusercontent.com/5585427/153425131-df24321f-9cc6-4dd6-aff6-41627915afa7.png)\n\n### (more) Base Mounts:\n![yappBaseStand](https://user-images.githubusercontent.com/5585427/153425136-9bc916a2-1245-4b3e-9072-8dd7ed8c3df6.png)\n\n![yappBaseStand3D](https://user-images.githubusercontent.com/5585427/153425139-0b27f2f0-f12c-4d89-b394-70ebcf3e1c4f.png)\n\n### Hooks:\nThere are two type of \"hooks\"; at the inside of the box or at the outside of the box\n#### `baseHookOutside()`:\n![baseHookOutside](https://user-images.githubusercontent.com/5585427/153425144-9401e969-8988-47e6-9c12-a3eaf052bfca.png)\n\n![baseHookOutside3D](https://user-images.githubusercontent.com/5585427/153425145-ecd9bebd-82ba-4ab0-9685-9bf1c9b9273f.png)\n#### `lidHookInside()`:\n![lidHooksInside1](https://user-images.githubusercontent.com/5585427/153425146-485d8cde-c530-4ab6-879d-3958ca5384ba.png)\n\n![lidHooksInside3Db](https://user-images.githubusercontent.com/5585427/153425147-831b7f9c-1c74-4c58-8a3d-11b96aaf3107.png)\n\n![lidHooksInside3Da](https://user-images.githubusercontent.com/5585427/153426442-6a05f787-8897-4610-8411-bb7279269980.png)\n\n<hr>\n\n## Buy me a coffee (please)!\n\nIf you like this project or it saved you time, you can give me a cup of coffee :)\n\n<p>\n  <a href=\"https://www.paypal.me/WillemAandewiel/3\">\n      <img width=\"300\" alt=\"bmc-button-75\" src=\"https://user-images.githubusercontent.com/5585427/192536527-306e1082-7d4e-402c-b024-658d9e334356.png\" alt=\"Coffee\">\n  </a>\n</p>\n\n## Versioning\n* All major releases (v1, v2, v3) are intended to be compatible with all files previously designed for v3 (e.g., the v3.1 release will not remove features or make any breaking changes, compared to v3.0).\n* The filename of the library (e.g., `YAPPgenerator_v3.scad`) will thus have only the major version in its filename.\n* When a new major version is released, a branch will be created from the `main` branch at the last commit before work is started on the next major version. This branch can be used to fix bugs and add features to the old release version, if desired. These lineage branches will not be merged to `main`, and will continue on their own path.\n* All future tagged versions will have GitHub Releases created for them, which will include the changelog for the release. The `YAPP_Template_vx.scad` and `YAPPgenerator_vx.scad` files will also be attached to the release.\n* The ISO8601 international standard date format (yyyy-mm-dd) will be used for documenting dates.\n"
  },
  {
    "path": "YAPP_Template_v3.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.3.7 (2025-04-17)\n//\n// This design is parameterized based on the size of a PCB.\n//\n// For many/complex cutoutGrills, you might need to adjust\n//  the max number of elements in OpenSCAD:\n//\n//      Preferences->Advanced->Turn off rendering at 250000 elements\n//                                                   ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <./YAPPgenerator_v3.scad>\n\n//---------------------------------------------------------\n// This design is parameterized based on the size of a PCB.\n//---------------------------------------------------------\n// Note: length/lengte refers to X axis, \n//       width/breedte refers to Y axis,\n//       height/hoogte refers to Z axis\n\n/*\n      padding-back|<------pcb length --->|<padding-front\n                            RIGHT\n        0    X-axis ---> \n        +----------------------------------------+   ---\n        |                                        |    ^\n        |                                        |   padding-right \n      Y |                                        |    v\n      | |    -5,y +----------------------+       |   ---              \n B    a |         | 0,y              x,y |       |     ^              F\n A    x |         |                      |       |     |              R\n C    i |         |                      |       |     | pcb width    O\n K    s |         |                      |       |     |              N\n        |         | 0,0              x,0 |       |     v              T\n      ^ |    -5,0 +----------------------+       |   ---\n      | |                                        |    padding-left\n      0 +----------------------------------------+   ---\n        0    X-as --->\n                          LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\nprintDisplayClips     = true;\n\n// ********************************************************************\n// The Following will be used as the first element in the pbc array\n\n//Defined here so you can define the \"Main\" PCB using these if wanted\npcbLength           = 150; // front to back (X axis)\npcbWidth            = 100; // side to side (Y axis)\npcbThickness        = 1.6; \nstandoffHeight      = 1.0; //-- How much the PCB needs to be raised from the base to leave room for solderings and whatnot\nstandoffDiameter    = 7;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\n\n//===================================================================\n// *** PCBs ***\n// Printed Circuit Boards\n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : yappCoordBoxInside[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = name\n//    p(1) = length\n//    p(2) = width\n//    p(3) = posx\n//    p(4) = posy\n//    p(5) = Thickness\n//    p(6) = standoff_Height = Height to bottom of PCB from the inside of the base\n//             negative measures from inside of the lid to the top of the PCB\n//    p(7) = standoff_Diameter\n//    p(8) = standoff_PinDiameter\n//   Optional:\n//    p(9) = standoff_HoleSlack (default to 0.4)\n\n//The following can be used to get PCB values elsewhere in the script - not in pcb definition. \n//If \"PCB Name\" is omitted then \"Main\" is used\n//  pcbLength           --> pcbLength(\"PCB Name\")\n//  pcbWidth            --> pcbWidth(\"PCB Name\")\n//  pcbThickness        --> pcbThickness(\"PCB Name\") \n//  standoffHeight      --> standoffHeight(\"PCB Name\") \n//  standoffDiameter    --> standoffDiameter(\"PCB Name\") \n//  standoffPinDiameter --> standoffPinDiameter(\"PCB Name\") \n//  standoffHoleSlack   --> standoffHoleSlack(\"PCB Name\") \n\npcb = \n[\n  // Default Main PCB - DO NOT REMOVE the \"Main\" line.\n  [\"Main\",              pcbLength,pcbWidth,    0,0,    pcbThickness,  standoffHeight, standoffDiameter, standoffPinDiameter, standoffHoleSlack]\n];\n\n//-------------------------------------------------------------------                            \n//-- padding between pcb and inside wall\npaddingFront        = 2;\npaddingBack         = 2;\npaddingRight        = 2;\npaddingLeft         = 2;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 1.5;\nlidPlaneThickness   = 1.5;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 25;\nlidWallHeight       = 23;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.3; // Gap between the inside of the lid and the outside of the base\n//New in v3.3.7 \nridgeGap            = 0.5; // Gap between the bottom of the base ridge and the bottom of the lid when assembled.\nroundRadius         = 3.0;\n\n// Box Types are 0-4 with 0 as the default\n// 0 = All edges rounded with radius (roundRadius) above\n// 1 = All edges sqrtuare\n// 2 = All edges chamfered by (roundRadius) above \n// 3 = Square top and bottom edges (the ones that touch the build plate) and rounded vertical edges\n// 4 = Square top and bottom edges (the ones that touch the build plate) and chamfered vertical edges\n// 5 = Chanfered top and bottom edges (the ones that touch the build plate) and rounded vertical edges\nboxType             = 0; // Default type 0\n\n// Set the layer height of your printer\nprinterLayerHeight  = 0.2;\n\n\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n// -- Render --\nrenderQuality             = 8;          //-> from 1 to 32, Default = 8\n\n// --Preview --\npreviewQuality            = 5;          //-> from 1 to 32, Default = 5\nshowSideBySide            = true;       //-> Default = true\nonLidGap                  = 0;  // tip don't override to animate the lid opening\ncolorLid                  = \"YellowGreen\";   \nalphaLid                  = 1;\ncolorBase                 = \"BurlyWood\";\nalphaBase                 = 1;\nhideLidWalls              = false;      //-> Remove the walls from the lid : only if preview and showSideBySide=true \nhideBaseWalls             = false;      //-> Remove the walls from the base : only if preview and showSideBySide=true  \nshowOrientation           = true;       //-> Show the Front/Back/Left/Right labels : only in preview\nshowPCB                   = false;      //-> Show the PCB in red : only in preview \nshowSwitches              = false;      //-> Show the switches (for pushbuttons) : only in preview \nshowButtonsDepressed      = false;      //-> Should the buttons in the Lid On view be in the pressed position\nshowOriginCoordBox        = false;      //-> Shows red bars representing the origin for yappCoordBox : only in preview \nshowOriginCoordBoxInside  = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowOriginCoordPCB        = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowMarkersPCB            = false;      //-> Shows black bars corners of the PCB : only in preview \nshowMarkersCenter         = false;      //-> Shows magenta bars along the centers of all faces  \ninspectX                  = 0;          //-> 0=none (>0 from Back)\ninspectY                  = 0;          //-> 0=none (>0 from Right)\ninspectZ                  = 0;          //-> 0=none (>0 from Bottom)\ninspectXfromBack          = true;       //-> View from the inspection cut foreward\ninspectYfromLeft          = true;       //-> View from the inspection cut to the right\ninspectZfromBottom        = true;       //-> View from the inspection cut up\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n\n//-------------------------------------------------------------------\n//-------------------------------------------------------------------\n// Start of Debugging config (used if not overridden in template)\n// ------------------------------------------------------------------\n// ------------------------------------------------------------------\n\n//==================================================================\n//  *** Shapes ***\n//------------------------------------------------------------------\n//  There are a view pre defines shapes and masks\n//  shapes:\n//      shapeIsoTriangle, shapeHexagon, shape6ptStar\n//\n//  masks:\n//      maskHoneycomb, maskHexCircles, maskBars, maskOffsetBars\n//\n//------------------------------------------------------------------\n// Shapes should be defined to fit into a 1x1 box (+/-0.5 in X and Y) - they will \n// be scaled as needed.\n// defined as a vector of [x,y] vertices pairs.(min 3 vertices)\n// for example a triangle could be [yappPolygonDef,[[-0.5,-0.5],[0,0.5],[0.5,-0.5]]];\n// To see how to add your own shapes and mask see the YAPPgenerator program\n//------------------------------------------------------------------\n\n\n// Show sample of a Mask\n//SampleMask(maskHoneycomb);\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//   Optional:\n//    p(2) = Height to bottom of PCB from inside of base: Default = standoffHeight\n//             negative measures from inside of the lid to the top of the PCB\n//    p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    p(4) = standoffDiameter    Default = standoffDiameter;\n//    p(5) = standoffPinDiameter Default = standoffPinDiameter;\n//    p(6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    p(7) = filletRadius (0 = auto size)\n//    p(8) = Pin Length : Default = 0 -> PCB Gap + standoff_PinDiameter\n//             Indicated length of pin without the half sphere tip. \n//             Example : pcbThickness() only leaves the half sphere tip above the PCB\n//    n(a) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    n(b) = { <yappPin>, yappHole, yappTopPin } \n//             yappPin = Pin on Base and Hole on Lid \n//             yappHole = Hole on Both\n//             yappTopPin = Hole on Base and Pin on Lid\n//    n(c) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { yappNoFillet } : Removes the internal and external fillets and the Rounded tip on the pins\n//    n(f) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(g) = yappSelfThreading : make the hole a self threading hole \n//             This ignores the holeSlack and would only be usefull \n//             if the opposing stand if deleted see sample in Demo_Connectors\n//-------------------------------------------------------------------\npcbStands = \n[\n];\n\n\n//===================================================================\n//  *** Connectors ***\n//  Standoffs with hole through base and socket in lid for screw type connections.\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB : pcb[0,0,0]\n//  \n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = StandHeight : From specified origin \n//    p(3) = screwDiameter\n//    p(4) = screwHeadDiameter (don't forget to add extra for the fillet or specify yappNoInternalFillet)\n//    p(5) = insertDiameter\n//    p(6) = outsideDiameter\n//   Optional:\n//    p(7) = insert Depth : default to entire connector\n//    p(8) = PCB Gap : Default if yappCoordPCB then pcbThickness else 0\n//    p(9) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }\n//    n(b) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(c) = { yappNoFillet } : Don't add fillets\n//    n(d) = { yappCountersink }\n//    n(e) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(f) = { yappThroughLid = changes the screwhole to the lid and the socket to the base}\n//    n(g) = {yappSelfThreading} : Make the insert self threading specify the Screw Diameter in the insertDiameter\n//    n(h) = { yappNoInternalFillet } : Don't add internal fillets (external fillets can still be added)\n\n//-------------------------------------------------------------------\nconnectors   =\n[\n];\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//----------------------+-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//                      |                       |               |  (negative indicates outside of circle)\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be\n//                      |                       |               | provided\n//  yappRing            | width, length, radius |               | radius = outer radius, \n//                      |                       |               | length = inner radius\n//                      |                       |               | width = connection between rings\n//                      |                       |               |   0 = No connectors\n//                      |                       |               |   positive = 2 connectors\n//                      |                       |               |   negative = 4 connectors\n//  yappSphere          | width, radius         |               | Width = Sphere center distance from\n//                      |                       |               |   center of depth.  negative = below\n//                      |                       |               | radius = sphere radius\n//----------------------+-----------------------+---------------+------------------------------------\n//\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                     | yappCircleWithFlats | yappCircleWithKey | yappSphere }\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappAltOrigin } // Only affects Top(lid), Back and Right Faces\n//    n(g) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(h) = { yappFromInside } Make the cut from the inside towards the outside\n//-------------------------------------------------------------------\ncutoutsBase = \n[\n];\n\ncutoutsLid  = \n[\n\n];\n\ncutoutsFront =  \n[\n];\n\n\ncutoutsBack = \n[\n];\n\ncutoutsLeft =   \n[\n];\n\ncutoutsRight =  \n[\n];\n\n\n\n//===================================================================\n//  *** Snap Joins ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx | posy\n//    p(1) = width\n//    p(2) = { yappLeft | yappRight | yappFront | yappBack } : one or more\n//   Optional:\n//    n(a) = { <yappOrigin>, yappCenter }\n//    n(b) = { yappSymmetric }\n//    n(c) = { yappRectangle } == Make a diamond shape snap\n//-------------------------------------------------------------------\nsnapJoins   =   \n[\n];\n\n//===================================================================\n//  *** Box Mounts ***\n//  Mounting tabs on the outside of the box\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X.\n//                    Position is to center of mounting screw in leftmost position in slot\n//    p(1) = screwDiameter\n//    p(2) = width of opening in addition to screw diameter \n//                    (0=Circular hole screwWidth = hole twice as wide as it is tall)\n//    p(3) = height\n//    n(a) = { yappLeft | yappRight | yappFront | yappBack } : one or more\n//   Optional:\n//    p(4) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(b) = { yappNoFillet }\n//    n(c) = { <yappBase>, yappLid }\n//    n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of \n//                            the left of the opening\n//    n(e) = { <yappGlobalOrigin>, yappAltOrigin } : Only affects Back and Right Faces\n//-------------------------------------------------------------------\nboxMounts =\n[\n];\n\n//===================================================================\n//  *** Light Tubes ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = tubeLength\n//    p(3) = tubeWidth\n//    p(4) = tubeWall\n//    p(5) = gapAbovePcb\n//    p(6) = { yappCircle | yappRectangle } : tubeType    \n//   Optional:\n//    p(7) = lensThickness (how much to leave on the top of the lid for the \n//           light to shine through 0 for open hole : Default = 0/Open\n//    p(8) = Height to top of PCB : Default = standoffHeight+pcbThickness\n//    p(9) = filletRadius : Default = 0/Auto \n//    n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside } \n//    n(b) = { <yappGlobalOrigin>, yappAltOrigin }\n//    n(c) = { yappNoFillet }\n//    n(d) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//-------------------------------------------------------------------\nlightTubes =\n[\n];\n\n//===================================================================\n//  *** Push Buttons ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = capLength \n//    p(3) = capWidth \n//    p(4) = capRadius \n//    p(5) = capAboveLid\n//    p(6) = switchHeight\n//    p(7) = switchTravel\n//    p(8) = poleDiameter\n//   Optional:\n//    p(9) = Height to top of PCB : Default = standoffHeight + pcbThickness\n//    p(10) = { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey } : Shape, Default = yappRectangle\n//    p(11) = angle : Default = 0\n//    p(12) = filletRadius          : Default = 0/Auto \n//    p(13) = buttonWall            : Default = 2.0;\n//    p(14) = buttonPlateThickness  : Default= 2.5;\n//    p(15) = buttonSlack           : Default= 0.25;\n//    n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside } \n//    n(b) = { <yappGlobalOrigin>,  yappAltOrigin }\n//    n(c) = { yappNoFillet }\n//    n(d) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//-------------------------------------------------------------------\npushButtons = \n[\n];\n             \n//===================================================================\n//  *** Labels ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   p(0) = posx\n//   p(1) = posy/z\n//   p(2) = rotation degrees CCW\n//   p(3) = depth : positive values go into case (Remove) negative values are raised (Add)\n//   p(4) = { yappLeft, yappRight, yappFront, yappBack, yappLid, yappBase } : plane\n//   p(5) = font\n//   p(6) = size\n//   p(7) = \"label text\"\n//  Optional:\n//   p(8) = Expand : Default = 0 : mm to expand text by (making it bolder) \n//   p(9) = Direction : { <yappTextLeftToRight>, yappTextRightToLeft, yappTextTopToBottom, yappTextBottomToTop }\n//   p(10) = Horizontal alignment : { <yappTextHAlignLeft>, yappTextHAlignCenter, yappTextHAlignRight }\n//   p(11) = Vertical alignment : {  yappTextVAlignTop, yappTextVAlignCenter, yappTextVAlignBaseLine, <yappTextVAlignBottom> } \n//   p(12) = Character Spacing multiplier (1.0 = normal)\n//-------------------------------------------------------------------\nlabelsPlane =\n[\n];\n\n\n//===================================================================\n//  *** Ridge Extension ***\n//    Extension from the lid into the case for adding split opening at various heights\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = pos\n//    p(1) = width\n//    p(2) = height : Where to relocate the seam : yappCoordPCB = Above (positive) the PCB\n//                                                yappCoordBox = Above (positive) the bottom of the shell (outside)\n//   Optional:\n//    n(a) = { <yappOrigin>, yappCenter } \n//    n(b) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(c) = { yappAltOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces\n//    n(d) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//\n// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.\n//-------------------------------------------------------------------\nridgeExtLeft =\n[\n];\n\nridgeExtRight =\n[\n];\n\nridgeExtFront =\n[\n];\n\nridgeExtBack =\n[\n];\n\n\n//===================================================================\n//  *** Display Mounts ***\n//    add a cutout to the lid with mounting posts for a display\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p[2] : displayWidth = overall Width of the display module\n//    p[3] : displayHeight = overall Height of the display module\n//    p[4] : pinInsetH = Horizontal inset of the mounting hole\n//    p[5] : pinInsetV = Vertical inset of the mounting hole\n//    p[6] : pinDiameter,\n//    p[7] : postOverhang  = Extra distance towards outside of pins to move the post for the display to sit on - 0 = centered : pin Diameter will move the post to align to the outside of the pin (moves it half the distance specified for compatability : -pinDiameter will move it in.\n//    p[8] : walltoPCBGap = Distance from the display PCB to the surface of the screen\n//    p[9] : pcbThickness  = Thickness of the display module PCB\n//    p[10] : windowWidth = opening width for the screen\n//    p[11] : windowHeight = Opening height for the screen\n//    p[12] : windowOffsetH = Horizontal offset from the center for the opening\n//    p[13] : windowOffsetV = Vertical offset from the center for the opening\n//    p[14] : bevel = Apply a 45degree bevel to the opening\n// Optionl:\n//    p[15] : rotation\n//    p[16] : snapDiameter : default = pinDiameter*2\n//    p[17] : lidThickness : default = lidPlaneThickness\n//    n(a) = { <yappOrigin>, yappCenter } \n//    n(b) = { <yappCoordBox> | yappCoordPCB | yappCoordBoxInside }\n//    n(c) = { <yappGlobalOrigin>, yappAltOrigin } // Only affects Top(lid), Back and Right Faces\n//    n(d) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(e) = {yappSelfThreading} : Replace the pins with self threading holes\n//-------------------------------------------------------------------\ndisplayMounts =\n[\n];\n\n//========= HOOK functions ============================\n  \n// Hook functions allow you to add 3d objects to the case.\n// Lid/Base = Shell part to attach the object to.\n// Inside/Outside = Join the object from the midpoint of the shell to the inside/outside.\n// Pre = Attach the object Pre before doing Cutouts/Stands/Connectors. \n\n\n//===========================================================\n// origin = box(0,0,0)\nmodule hookLidInside()\n{\n  //if (printMessages) echo(\"hookLidInside() ..\");\n  \n} // hookLidInside()\n  \n\n//===========================================================\n// origin = box(0,0,shellHeight)\nmodule hookLidOutside()\n{\n  //if (printMessages) echo(\"hookLidOutside() ..\");\n  \n} // hookLidOutside()\n\n//===========================================================\n//===========================================================\n// origin = box(0,0,0)\nmodule hookBaseInside()\n{\n  //if (printMessages) echo(\"hookBaseInside() ..\");\n  \n} // hookBaseInside()\n\n//===========================================================\n// origin = box(0,0,0)\nmodule hookBaseOutside()\n{\n  //if (printMessages) echo(\"hookBaseOutside() ..\");\n  \n} // hookBaseInside()\n\n// **********************************************************\n// **********************************************************\n// **********************************************************\n// *************** END OF TEMPLATE SECTION ******************\n// **********************************************************\n// **********************************************************\n// **********************************************************\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "YAPPgenerator_v3.scad",
    "content": "/*\n***************************************************************************  \n**  Yet Another Parameterised Projectbox generator\n**\n*/\n\nVersion=\"v3.3.8 (2025-10-24)\";\n\n/*\n**\n**  Copyright (c) 2021, 2022, 2023, 2024, 2025 Willem Aandewiel\n**\n**  With help from:\n**   - Keith Hadley (parameterized label depth)\n**   - Oliver Grafe (connectorsPCB)\n**   - Juan Jose Chong (dynamic standoff flange)\n**   - Dan Drum (cleanup code)\n**   - Dave Rosenhauer (fillets and a lot more)\n**\n**\n**  for many or complex cutouts you might need to adjust\n**  the number of elements:\n**\n**      Preferences->Advanced->Turn off rendering at 250000 elements\n**                                                  ^^^^^^\n**\n**  TERMS OF USE: MIT License. See base offile.\n***************************************************************************      \n*/\n\n// If set to true will generate the sample box at every save\ndebug = false;\nprintMessages = debug;\n\n//---------------------------------------------------------\n// This design is parameterized based on the size of a PCB.\n//---------------------------------------------------------\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n      padding-back|<------pcb length --->|<padding-front\n                            RIGHT\n        0    X-axis ---> \n        +----------------------------------------+   ---\n        |                                        |    ^\n        |                                        |   padding-right \n      Y |                                        |    v\n      | |    -5,y +----------------------+       |   ---              \n B    a |         | 0,y              x,y |       |     ^              F\n A    x |         |                      |       |     |              R\n C    i |         |                      |       |     | pcb width    O\n K    s |         |                      |       |     |              N\n        |         | 0,0              x,0 |       |     v              T\n      ^ |    -5,0 +----------------------+       |   ---\n      | |                                        |    padding-left\n      0 +----------------------------------------+   ---\n        0    X-as --->\n                          LEFT\n*/\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\nprintDisplayClips     = true;\nshiftLid              = 10;  // Set the distance between the lid and base when rendered or previewed side by side\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n// ********************************************************************\n// The Following will be used as the first element in the pbc array\n\n//Defined here so you can define the \"Main\" PCB using these if wanted\npcbLength           = 120; // front to back (X axis)\npcbWidth            = 50; // side to side (Y axis)\npcbThickness        = 1.6;\nstandoffHeight      = 1.0;  //-- How much the PCB needs to be raised from the base to leave room for solderings \nstandoffDiameter    = 7;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\n\n//===================================================================\n// *** PCBs ***\n// Printed Circuit Boards\n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : yappCoordBoxInside[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = name\n//    p(1) = length\n//    p(2) = width\n//    p(3) = posx\n//    p(4) = posy\n//    p(5) = Thickness\n//    p(6) = standoff_Height = Height to bottom of PCB from the inside of the base\n//             negative measures from inside of the lid to the top of the PCB\n//    p(7) = standoff_Diameter\n//    p(8) = standoff_PinDiameter\n//   Optional:\n//    p(9) = standoff_HoleSlack (default to 0.4)\n\n//The following can be used to get PCB values. If \"PCB Name\" is omitted then \"Main\" is used\n//  pcbLength           --> pcbLength(\"PCB Name\")\n//  pcbWidth            --> pcbWidth(\"PCB Name\")\n//  pcbThickness        --> pcbThickness(\"PCB Name\") \n//  standoffHeight      --> standoffHeight(\"PCB Name\") \n//  standoffDiameter    --> standoffDiameter(\"PCB Name\") \n//  standoffPinDiameter --> standoffPinDiameter(\"PCB Name\") \n//  standoffHoleSlack   --> standoffHoleSlack(\"PCB Name\") \n\npcb = \n[\n  //-- Default Main PCB - DO NOT REMOVE the \"Main\" line.\n  [\"Main\",              pcbLength,pcbWidth,    0,0,    pcbThickness,  standoffHeight, standoffDiameter, standoffPinDiameter, standoffHoleSlack]\n];\n\n//-------------------------------------------------------------------\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.8;\nbasePlaneThickness  = 1.6;\nlidPlaneThickness   = 1.6;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//                       + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoff_Height+pcb_Thickness)\nbaseWallHeight      = 10;\nlidWallHeight       = 10;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight \n//     or 1.8x wallThickness if using snaps\nridgeHeight         = 5.0;\nridgeSlack          = 0.2; // Gap between the inside of the lid and the outside of the base\n//New in v3.3.7 \nridgeGap            = 0.5; // Gap between the bottom of the base ridge and the bottom of the lid when assembled.\n\n//-- Radius of the shell corners\nroundRadius         = wallThickness + 1;  // Default to 1 more than the wall thickness\n\n// Box Types are 0-5 with 0 as the default\n// 0 = All edges rounded with radius (roundRadius) above\n// 1 = All edges square\n// 2 = All edges chamfered by (roundRadius) above \n// 3 = Square top and bottom edges (the ones that touch the build plate) and rounded vertical edges\n// 4 = Square top and bottom edges (the ones that touch the build plate) and chamfered vertical edges\n// 5 = Chamfered top and bottom edges (the ones that touch the build plate) and rounded vertical edges\nboxType = 5; // Default type 0\n\n\n//---------------------------\n//--     MISC Options     --\n//---------------------------\n\n//-- Cone aperture in degrees for countersunk-head screws\ncountersinkAngle = 90;          //-- metric: 90\n\n// Set the layer height of your printer\nprinterLayerHeight  = 0.2;\n\n// Set the ratio between the wall thickness and the ridge height. \n//    Recommended to be left at 1.8 but for strong snaps.\nwallToRidgeRatio = 1.8;\n\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n// -- Render --\nrenderQuality             = 8;          //-> from 1 to 32, Default = 8\n\n// --Preview --\npreviewQuality            = 5;          //-> from 1 to 32, Default = 5\nshowSideBySide            = true;       //-> Default = true\nonLidGap                  = 0;  // tip don't override to animate the lid opening\n//onLidGap                  = ((ridgeHeight) - (ridgeHeight * abs(($t-0.5)*2)))*2;  // tip don't override to animate the lid opening/closing\ncolorLid                  = \"YellowGreen\";   \nalphaLid                  = 1;\ncolorBase                 = \"BurlyWood\";\nalphaBase                 = 1;\nhideLidWalls              = false;      //-> Remove the walls from the lid : only if preview and showSideBySide=true \nhideBaseWalls             = false;      //-> Remove the walls from the base : only if preview and showSideBySide=true  \nshowOrientation           = true;       //-> Show the Front/Back/Left/Right labels : only in preview\nshowPCB                   = false;      //-> Show the PCB in red : only in preview \nshowSwitches              = false;      //-> Show the switches (for pushbuttons) : only in preview \nshowButtonsDepressed      = false;      //-> Should the buttons in the Lid On view be in the pressed position\nshowOriginCoordBox        = false;      //-> Shows red bars representing the origin for yappCoordBox : only in preview \nshowOriginCoordBoxInside  = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowOriginCoordPCB        = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowMarkersPCB            = false;      //-> Shows black bars corners of the PCB : only in preview \nshowMarkersCenter         = false;      //-> Shows magenta bars along the centers of all faces  \ninspectX                  = 0;          //-> 0=none (>0 from Back)\ninspectY                  = 0;          //-> 0=none (>0 from Right)\ninspectZ                  = 0;          //-> 0=none (>0 from Bottom)\ninspectXfromBack          = true;       //-> View from the inspection cut foreward\ninspectYfromLeft          = true;       //-> View from the inspection cut to the right\ninspectZfromBottom        = true;       //-> View from the inspection cut up\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n\n// ******************************\n//  REMOVE BELOW FROM TEMPLATE\n\n// Set the glogal for the quality\nfacetCount = $preview ? previewQuality*4 : renderQuality*4;\n\n//-- better leave these ----------\nbuttonWall          = 2.0;\nbuttonPlateThickness= 2.5;\nbuttonSlack         = 0.25;\n\n//-- constants, do not change (shifted to large negative values so another element in the \n//-- array won't match\n\n// Define some alternates to undef\nyappDefault             = undef;\ndefault                 = undef;\n\n// Shapes\nyappRectangle           = -30000;\nyappCircle              = -30001;\nyappPolygon             = -30002;\nyappRoundedRect         = -30003;\nyappCircleWithFlats     = -30004;\nyappCircleWithKey       = -30005;\nyappRing                = -30006;\nyappSphere              = -30007; //-- New 3.3\n\n// NEW for 3.x \n// Edge Shapes\nyappEdgeRounded         = -30090;\nyappEdgeSquare          = -30091;\nyappEdgeChamfered       = -30092;\n\n//Shell options\nyappBoth                = -30100;\nyappLidOnly             = -30101;\nyappBaseOnly            = -30102;\n\n//PCB standoff typrs\nyappHole                = -30200;\nyappPin                 = -30201;\nyappTopPin              = -30202;\n\n// Faces\nyappLeft                = -30300;\nyappRight               = -30301;\nyappFront               = -30302;\nyappBack                = -30303;\n\nyappLid                 = -30304;\nyappBase                = -30305;\n\nyappPartBase            = -30306;\nyappPartLid             = -30307;\n\n//-- Placement Options\nyappCenter              = -30400;  // Cutouts, boxMounts, lightTubes, pushButtons, pcbStands, Connectors\nyappOrigin              = -30401;  // Cutouts, boxMounts, lightTubes, pushButtons, pcbStands, Connectors\n\nyappSymmetric           = -30402;  // snapJoins \nyappAllCorners          = -30403;  // pcbStands, Connectors \nyappFrontLeft           = -30404;  // pcbStands, Connectors \nyappFrontRight          = -30405;  // pcbStands, Connectors \nyappBackLeft            = -30406;  // pcbStands, Connectors \nyappBackRight           = -30407;  // pcbStands, Connectors \n\nyappFromInside          = -30410;  // Cutouts \n\nyappTextLeftToRight     = -30470;\nyappTextRightToLeft     = -30471;\nyappTextTopToBottom     = -30472;\nyappTextBottomToTop     = -30473;\n\nyappTextHAlignLeft      = -30474;\nyappTextHAlignCenter    = -30475;\nyappTextHAlignRight     = -30476;\n\nyappTextVAlignTop       = -30477;\nyappTextVAlignCenter    = -30478;\nyappTextVAlignBaseLine  = -30479;\nyappTextVAlignBottom    = -30480;\n\n// Lightube options\nyappThroughLid          = -30500;  // lightTubes\n\n// Misc Options\nyappNoFillet            = -30600;  // pcbStands, connectors, lightTubes, pushButtons\nyappCountersink         = -30601;  // connectors\nyappSelfThreading       = -30602;  // connectors, displayMounts\nyappNoInternalFillet    = -30603;  // connectors\nyappHalfSelfThreading   = -30604;  // displayMounts\n\n// Coordinate options\nyappCoordPCB            = -30700;  // pcbStands, connectors, Cutouts, boxMounts, lightTubes, pushButtons \nyappCoordBox            = -30701;  // pcbStands, connectors, Cutouts, boxMounts, lightTubes, pushButtons \nyappCoordBoxInside      = -30702;  // pcbStands, connectors, Cutouts, boxMounts, lightTubes, pushButtons \n\nyappAltOrigin           = -30710;  // pcbStands, connectors, Cutouts, boxMounts, lightTubes, pushButtons \nyappGlobalOrigin        = -30711;  // pcbStands, connectors, Cutouts, boxMounts, lightTubes, pushButtons \n\n//yappConnWithPCB - Depreciated use yappCoordPCB \n//yappLeftOrigin  - Depreciated use yappAltOrigin\n\n// Grid options\nyappPatternSquareGrid   = -30800;\nyappPatternHexGrid      = -30801;\n\nyappMaskDef             = -30900;\nyappPolygonDef          = -30901;\nyappPCBName             = -30902;\n\n\nminkowskiErrorCorrection = $preview ? 1.0125 : 1;\nboxLength = maxLength(pcb);\nboxWidth = maxWidth(pcb);\n\n//-- For New boxTypes (Default to all edges rounded)\n//-- options: \n//--    yappEdgeRounded - rounded using roundRadius\n//--    yappEdgeSquare - squared corners\n//--    yappEdgeChamfered - chamfered with roundRadius sides\n\nboxStyles = [\n  [0, yappEdgeRounded, yappEdgeRounded],\n  [1, yappEdgeSquare, yappEdgeSquare],\n  [2, yappEdgeChamfered, yappEdgeChamfered],\n  [3, yappEdgeSquare, yappEdgeRounded],\n  [4, yappEdgeSquare, yappEdgeChamfered],\n  [5, yappEdgeChamfered, yappEdgeRounded],\n];\n\nshellEdgeTopBottom = boxStyles[boxType][1];\nshellEdgeVert = boxStyles[boxType][2];\n\n//-------------------------------------------------------------------\n// Misc internal values\n\nshellInsideWidth  = boxWidth+paddingLeft+paddingRight;\nshellInsideLength = boxLength+paddingFront+paddingBack;\nshellInsideHeight = baseWallHeight+lidWallHeight;\n\nshellWidth        = shellInsideWidth+(wallThickness*2);\nshellLength       = shellInsideLength+(wallThickness*2);\nshellHeight       = basePlaneThickness+shellInsideHeight+lidPlaneThickness;\n\n//  REMOVE ABOVE FROM TEMPLATE\n// ******************************\n\n\n//-------------------------------------------------------------------\n//-------------------------------------------------------------------\n// Start of Debugging config (used if not overridden in template)\n// ------------------------------------------------------------------\n// ------------------------------------------------------------------\n\n// ==================================================================\n// Shapes\n// ------------------------------------------------------------------\n\n// Shapes should be defined to fit into a 1x1 box (+/-0.5 in X and Y) - they will be scaled as needed.\n// defined as a vector of [x,y] vertices pairs.(min 3 vertices)\n// for example a triangle could be [yappPolygonDef,[[-0.5,-0.5],[0,0.5],[0.5,-0.5]]];\n\n// Pre-defined shapes\nshapeIsoTriangle = [yappPolygonDef,[[-0.5,-sqrt(3)/4],[0,sqrt(3)/4],[0.5,-sqrt(3)/4]]];\nshapeIsoTriangle2 = [yappPolygonDef,[[0,+sqrt(1/3)],[+0.5,-sqrt(1/12)],[-0.5,-sqrt(1/12)]]];\nshapeHexagon = [yappPolygonDef,[[-0.50,0],[-0.25,+0.433012],[+0.25,+0.433012],[+0.50 ,0],[+0.25,-0.433012],[-0.25,-0.433012]]];\nshape6ptStar = [yappPolygonDef,[[-0.50,0],[-0.25,+0.144338],[-0.25,+0.433012],[0,+0.288675],[+0.25,+0.433012],[+0.25,+0.144338],[+0.50 ,0],[+0.25,-0.144338],[+0.25,-0.433012],[0,-0.288675],[-0.25,-0.433012],[-0.25,-0.144338]]];\nshapeTriangle = [yappPolygonDef,[[-0.5,-1/3],[0,+2/3],[+0.5,-1/3]]];\nshapeTriangle2 = [yappPolygonDef,[[-0.5,-0.5],[0,0.5],[0.5,-0.5]]];\nshapeArrow = [yappPolygonDef,[[-1/3,+0.5],[0.166667,+0.5],[+2/3,0],[0.166667,-0.5],[-1/3,-0.5]]];\n\npreDefinedShapes=[\n  [\"shapeIsoTriangle\", shapeIsoTriangle], \n  [\"shapeIsoTriangle2\", shapeIsoTriangle2], \n  [\"shapeHexagon\", shapeHexagon],\n  [\"shape6ptStar\", shape6ptStar],\n  [\"shapeTriangle\", shapeTriangle],\n  [\"shapeTriangle2\",shapeTriangle2], \n  [\"shapeArrow\", shapeArrow],\n  ];\n\n\n//==================================================================\n//  *** Masks ***\n//------------------------------------------------------------------\n//  Parameters:\n//    maskName = [yappMaskDef,[\n//     p(0) = Grid pattern :{ yappPatternSquareGrid, yappPatternHexGrid }  \n//     p(1) = horizontal Repeat : if yappPatternSquareGrid then 0 = no repeat one \n//                                shape per column, if yappPatternHexGrid 0 is not valid\n//     p(2) = vertical Repeat :   if yappPatternSquareGrid then 0 = no repeat one shape \n//                                per row, if yappPatternHexGrid 0 is not valid\n//     p(3) = grid rotation\n//     p(4) = openingShape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect}\n//     p(5) = openingWidth, :  if yappPatternSquareGrid then 0 = no repeat one shape per \n//                             column, if yappPatternHexGrid 0 is not valid\n//     p(6) = openingLength,   if yappPatternSquareGrid then 0 = no repeat one shape per \n//                             row, if yappPatternHexGrid 0 is not valid\n//     p(7) = openingRadius\n//     p(8) = openingRotation\n//     p(9) = shape polygon : Required if openingShape = yappPolygon\n//   ]];\n//------------------------------------------------------------------\nmaskHoneycomb = [yappMaskDef,[\n  yappPatternHexGrid,   // pattern\n  5,                    // hRepeat\n  5,                    // vRepeat\n  0,                    // rotation\n  yappPolygon,          // openingShape\n  4,                    // openingWidth, \n  4,                    // openingLength, \n  0,                    // openingRadius\n  30,                   // openingRotation\n  shapeHexagon]];\n\n\nmaskHexCircles = [yappMaskDef,[\n  yappPatternHexGrid,   // pattern\n  5,                    // hRepeat\n  5,                    // vRepeat\n  30,                   // rotation\n  yappCircle,           // openingShape\n  0,                    // openingWidth, \n  0,                    // openingLength, \n  2,                    // openingRadius\n  0                     // openingRotation\n  ]];\n\nmaskCircles = [yappMaskDef,[\nyappPatternSquareGrid,  // pattern\n  5,                    // hRepeat\n  5,                    // vRepeat\n  0,                    // rotation\n  yappCircle,           // openingShape\n  0,                    // openingWidth, \n  0,                    // openingLength, \n  2,                    // openingRadius\n  0                     // openingRotation\n  ]\n];\n\n\nmaskSquares = [yappMaskDef,[\nyappPatternSquareGrid,  // pattern\n  4,                    // hRepeat\n  4,                    // vRepeat\n  0,                    // rotation\n  yappRectangle,           // openingShape\n  2,                    // openingWidth, \n  2,                    // openingLength, \n  0,                    // openingRadius\n  0                     // openingRotation\n  ]\n];\n\nmaskBars = [yappMaskDef,[\n  yappPatternSquareGrid, // pattern\n  0,                     // hRepeat 0= Default to opening width - no repeat\n  4,                     // vRepeat\n  0,                     // rotation\n  yappRectangle,         // openingShape\n  0,                     // openingWidth, 0= Default to opening width - no repeat\n  2,                     // openingLength, \n  2.5,                   // openingRadius\n  0                      // openingRotation\n  ]\n];\n\nmaskOffsetBars = [yappMaskDef,[\n  yappPatternHexGrid,   // pattern\n  7,                    // hRepeat \n  2*sqrt(3),            // vRepeat\n  -30,                  // rotation\n  yappRoundedRect,      // openingShape\n  10,                   // openingWidth, \n  2,                    // openingLength, \n  1,                    // openingRadius\n  30                    // openingRotation\n  ]\n];\n\npreDefinedMasks=[\n  [\"maskHoneycomb\", maskHoneycomb], \n  [\"maskHexCircles\", maskHexCircles], \n  [\"maskCircles\", maskCircles],\n  [\"maskSquares\", maskSquares],\n  [\"maskBars\", maskBars],\n  [\"maskOffsetBars\", maskOffsetBars],\n  ];\n\n//-- Define 3 optional custom masks that can be defined in the script\nmaskCustom1 = [];\nmaskCustom2 = [];\nmaskCustom3 = [];\n\n\n//-- Show sample of a Mask.in the negative X,Y quadrant\n//SampleMask(maskHoneycomb);\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//   Optional:\n//    p(2) = Height to bottom of PCB from inside of base: Default = standoffHeight\n//             negative measures from inside of the lid to the top of the PCB\n//    p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    p(4) = standoffDiameter    Default = standoffDiameter;\n//    p(5) = standoffPinDiameter Default = standoffPinDiameter;\n//    p(6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    p(7) = filletRadius (0 = auto size)\n//    p(8) = Pin Length : Default = 0 -> PCB Gap + standoff_PinDiameter\n//             Indicated length of pin without the half sphere tip. \n//             Example : pcbThickness() only leaves the half sphere tip above the PCB\n//    n(a) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    n(b) = { <yappPin>, yappHole, yappTopPin } \n//             yappPin = Pin on Base and Hole on Lid \n//             yappHole = Hole on Both\n//             yappTopPin = Hole on Base and Pin on Lid\n//    n(c) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { yappNoFillet } : Removes the internal and external fillets and the Rounded tip on the pins\n//    n(f) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(g) = yappSelfThreading : make the hole a self threading hole \n//             This ignores the holeSlack and would only be usefull \n//             if the opposing stand if deleted see sample in Demo_Connectors\n//-------------------------------------------------------------------\npcbStands = \n[\n];\n\n\n//===================================================================\n//  *** Connectors ***\n//  Standoffs with hole through base and socket in lid for screw type connections.\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB : pcb[0,0,0]\n//  \n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = StandHeight : From specified origin \n//    p(3) = screwDiameter\n//    p(4) = screwHeadDiameter (don't forget to add extra for the fillet or specify yappNoInternalFillet)\n//    p(5) = insertDiameter\n//    p(6) = outsideDiameter\n//   Optional:\n//    p(7) = insert Depth : default to entire connector\n//    p(8) = PCB Gap : Default if yappCoordPCB then pcbThickness else 0\n//    p(9) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }\n//    n(b) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(c) = { yappNoFillet } : Don't add fillets\n//    n(d) = { yappCountersink }\n//    n(e) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(f) = { yappThroughLid = changes the screwhole to the lid and the socket to the base}\n//    n(g) = {yappSelfThreading} : Make the insert self threading specify the Screw Diameter in the insertDiameter\n//    n(h) = { yappNoInternalFillet } : Don't add internal fillets (external fillets can still be added)\n\n//-------------------------------------------------------------------\nconnectors   =\n[\n];\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//                        Required                Not Used        Note\n//----------------------+-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//                      |                       |               |  (negative indicates outside of circle)\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be\n//                      |                       |               | provided\n//  yappRing            | width, length, radius |               | radius = outer radius, \n//                      |                       |               | length = inner radius\n//                      |                       |               | width = connection between rings\n//                      |                       |               |   0 = No connectors\n//                      |                       |               |   positive = 2 connectors\n//                      |                       |               |   negative = 4 connectors\n//  yappSphere          | width, radius         |               | Width = Sphere center distance from\n//                      |                       |               |   center of depth.  negative = below\n//                      |                       |               | radius = sphere radius\n//----------------------+-----------------------+---------------+------------------------------------\n//\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey | yappSphere }\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappAltOrigin } // Only affects Top(lid), Back and Right Faces\n//    n(g) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(h) = { yappFromInside } Make the cut from the inside towards the outside\n//-------------------------------------------------------------------\ncutoutsBase = \n[\n];\n\ncutoutsLid  = \n[\n];\n\ncutoutsFront =  \n[\n];\n\ncutoutsBack = \n[\n];\n\ncutoutsLeft =   \n[\n];\n\ncutoutsRight =  \n[\n];\n\n\n//===================================================================\n//  *** Snap Joins ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx | posy\n//    p(1) = width\n//    p(2) = { yappLeft | yappRight | yappFront | yappBack } : one or more\n//   Optional:\n//    n(a) = { <yappOrigin>, yappCenter }\n//    n(b) = { yappSymmetric }\n//    n(c) = { yappRectangle } == Make a diamond shape snap\n//-------------------------------------------------------------------\nsnapJoins   =   \n[\n];\n\n\n//===================================================================\n//  *** Box Mounts ***\n//  Mounting tabs on the outside of the box\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X.\n//                    Position is to center of mounting screw in leftmost position in slot\n//    p(1) = screwDiameter\n//    p(2) = width of opening in addition to screw diameter \n//                    (0=Circular hole screwWidth = hole twice as wide as it is tall)\n//    p(3) = height\n//    n(a) = { yappLeft | yappRight | yappFront | yappBack } : one or more\n//   Optional:\n//    p(4) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(b) = { yappNoFillet }\n//    n(c) = { <yappBase>, yappLid }\n//    n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of \n//                            the left of the opening\n//    n(e) = { <yappGlobalOrigin>, yappAltOrigin } : Only affects Back and Right Faces\n//-------------------------------------------------------------------\nboxMounts =\n[\n];\n\n   \n//===================================================================\n//  *** Light Tubes ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = tubeLength\n//    p(3) = tubeWidth\n//    p(4) = tubeWall\n//    p(5) = gapAbovePcb\n//    p(6) = { yappCircle | yappRectangle } : tubeType\n//   Optional:\n//    p(7) = lensThickness (how much to leave on the top of the lid for the \n//           light to shine through 0 for open hole : Default = 0/Open\n//    p(8) = Height to top of PCB : Default = standoffHeight+pcbThickness\n//    p(9) = filletRadius : Default = 0/Auto \n//    n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside } \n//    n(b) = { <yappGlobalOrigin>, yappAltOrigin }\n//    n(c) = { yappNoFillet }\n//    n(d) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//-------------------------------------------------------------------\nlightTubes =\n[\n];\n\n\n//===================================================================\n//  *** Push Buttons ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = capLength \n//    p(3) = capWidth \n//    p(4) = capRadius \n//    p(5) = capAboveLid\n//    p(6) = switchHeight\n//    p(7) = switchTravel\n//    p(8) = poleDiameter\n//   Optional:\n//    p(9) = Height to top of PCB : Default = standoffHeight + pcbThickness\n//    p(10) = { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey } : Shape, Default = yappRectangle\n//    p(11) = angle : Default = 0\n//    p(12) = filletRadius          : Default = 0/Auto \n//    p(13) = buttonWall            : Default = 2.0;\n//    p(14) = buttonPlateThickness  : Default= 2.5;\n//    p(15) = buttonSlack           : Default= 0.25;\n//    p(16) = snapSlack             : Default= 0.20;\n//    n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside } \n//    n(b) = { <yappGlobalOrigin>,  yappAltOrigin }\n//    n(c) = { yappNoFillet }\n//    n(d) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//-------------------------------------------------------------------\npushButtons = \n[\n];\n    \n  \n//===================================================================\n//  *** Labels ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   p(0) = posx\n//   p(1) = posy/z\n//   p(2) = rotation degrees CCW\n//   p(3) = depth : positive values go into case (Remove) negative values are raised (Add)\n//   p(4) = { yappLeft, yappRight, yappFront, yappBack, yappLid, yappBase } : plane\n//   p(5) = font\n//   p(6) = size\n//   p(7) = \"label text\"\n//  Optional:\n//   p(8) = Expand : Default = 0 : mm to expand text by (making it bolder) \n//   p(9) = Direction : { <yappTextLeftToRight>, yappTextRightToLeft, yappTextTopToBottom, yappTextBottomToTop }\n//   p(10) = Horizontal alignment : { <yappTextHAlignLeft>, yappTextHAlignCenter, yappTextHAlignRight }\n//   p(11) = Vertical alignment : {  yappTextVAlignTop, yappTextVAlignCenter, yappTextVAlignBaseLine, <yappTextVAlignBottom> } \n//   p(12) = Character Spacing multiplier (1.0 = normal)\n//-------------------------------------------------------------------\nlabelsPlane =\n[\n];\n\n\n//===================================================================\n//  *** Images ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   p(0) = posx\n//   p(1) = posy/z\n//   p(2) = rotation degrees CCW\n//   p(3) = depth : positive values go into case (Remove) negative values are raised (Add)\n//   p(4) = { yappLeft, yappRight, yappFront, yappBack, yappLid, yappBase } : plane\n//   p(5) = \"image filename.svg\"\n//  Optional:\n//   p(6) = Scale : Default = 1 : ratio to scale image by (making it larger or smaller)\n//-------------------------------------------------------------------\nimagesPlane =\n[\n];\n\n\n//===================================================================\n//  *** Ridge Extension ***\n//    Extension from the lid into the case for adding split opening at various heights\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = pos\n//    p(1) = width\n//    p(2) = height : Where to relocate the seam : yappCoordPCB = Above (positive) the PCB\n//                                                yappCoordBox = Above (positive) the bottom of the shell (outside)\n//   Optional:\n//    n(a) = { <yappOrigin>, yappCenter } \n//    n(b) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(c) = { <yappGlobalOrigin>, yappAltOrigin } // Only affects Top(lid), Back and Right Faces\n//    n(d) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//\n// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.\n//-------------------------------------------------------------------\nridgeExtFront =\n[\n];\n\nridgeExtBack =\n[\n];\n\nridgeExtLeft =\n[\n];\n\nridgeExtRight =\n[\n];\n\n//===================================================================\n//  *** Display Mounts ***\n//    add a cutout to the lid with mounting posts for a display\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p[2] : displayWidth = overall Width of the display module\n//    p[3] : displayHeight = overall Height of the display module\n//    p[4] : pinInsetH = Horizontal inset of the mounting hole\n//    p[5] : pinInsetV = Vertical inset of the mounting hole\n//    p[6] : pinDiameter,\n//    p[7] : postOverhang  = Extra distance towards outside of pins to move the post for the display to sit on - 0 = centered : pin Diameter will move the post to align to the outside of the pin (moves it half the distance specified for compatability : -pinDiameter will move it in.\n//    p[8] : walltoPCBGap = Distance from the display PCB to the surface of the screen\n//    p[9] : pcbThickness  = Thickness of the display module PCB\n//    p[10] : windowWidth = opening width for the screen\n//    p[11] : windowHeight = Opening height for the screen\n//    p[12] : windowOffsetH = Horizontal offset from the center for the opening\n//    p[13] : windowOffsetV = Vertical offset from the center for the opening\n//    p[14] : bevel = Apply a 45degree bevel to the opening\n// Optionl:\n//    p[15] : rotation\n//    p[16] : snapDiameter : default = pinDiameter*2\n//    p[17] : lidThickness : default = lidPlaneThickness\n\n//    p[18] : snapSlack : default = 0.05\n\n//    n(a) = { <yappOrigin>, yappCenter } \n//    n(b) = { <yappCoordBox> | yappCoordPCB | yappCoordBoxInside }\n//    n(c) = { <yappGlobalOrigin>, yappAltOrigin } // Only affects Top(lid), Back and Right Faces\n//    n(d) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(e) = {yappSelfThreading} : Replace the pins with self threading holes\n//-------------------------------------------------------------------\ndisplayMounts =\n[\n];\n\n\n//========= HOOK functions ============================\n//-- Hook functions allow you to add 3d objects to the case.\n//-- Lid/Base = Shell part to attach the object to.\n//-- Inside/Outside = Join the object from the midpoint of the shell to the inside/outside.\n//-- Pre = Attach the object Pre before doing Cutouts/Stands/Connectors. \n//===========================================================\n//-- origin = box(0,0,0)\nmodule hookLidInsidePre()\n{\n  //if (printMessages) echo(\"hookLidInsidePre() ..\");\n  \n} //-- hookLidInsidePre()\n\n//===========================================================\n//-- origin = box(0,0,0)\nmodule hookLidInside()\n{\n  //if (printMessages) echo(\"hookLidInside() ..\");\n  \n} //-- hookLidInside()\n  \n//===========================================================\n//===========================================================\n//-- origin = box(0,0,shellHeight)\nmodule hookLidOutsidePre()\n{\n  //if (printMessages) echo(\"hookLidOutsidePre() ..\");\n  \n} //-- hookLidOutsidePre()\n\n//===========================================================\n//-- origin = box(0,0,shellHeight)\nmodule hookLidOutside()\n{\n  //if (printMessages) echo(\"hookLidOutside() ..\");\n  \n} //-- hookLidOutside()\n\n//===========================================================\n//===========================================================\n//-- origin = box(0,0,0)\nmodule hookBaseInsidePre()\n{\n  //if (printMessages) echo(\"hookBaseInsidePre() ..\");\n  \n} //-- hookBaseInsidePre()\n\n//===========================================================\n//-- origin = box(0,0,0)\nmodule hookBaseInside()\n{\n  //if (printMessages) echo(\"hookBaseInside() ..\");\n  \n} //-- hookBaseInside()\n\n//===========================================================\n//===========================================================\n//-- origin = box(0,0,0)\nmodule hookBaseOutsidePre()\n{\n  //if (printMessages) echo(\"hookBaseOutsidePre() ..\");\n  \n} //-- hookBaseOutsidePre()\n\n//===========================================================\n//-- origin = box(0,0,0)\nmodule hookBaseOutside()\n{\n  //if (printMessages) echo(\"hookBaseOutside() ..\");\n  \n} //-- hookBaseOutside()\n\n//===========================================================\n//===========================================================\n\n//-- **********************************************************\n//-- **********************************************************\n//-- **********************************************************\n//-- *************** END OF TEMPLATE SECTION ******************\n//-- **********************************************************\n//-- **********************************************************\n//-- **********************************************************\n\n\n\n//===========================================================\nmodule printBoxMounts()\n{ \n      //-------------------------------------------------------------------\n      module roundedRect(size, radius)\n      {\n        x1 = size[0];\n        x2 = size[1];\n        y  = size[2];\n        l  = size[3];\n        h  = size[4];\n      \n        linear_extrude(h)\n        {\n          hull()\n          {\n            // place 4 circles in the corners, with the given radius\n            translate([(x1+radius), (y+radius), 0])\n              circle(r=radius);\n          \n            translate([(x1+radius), (y+l)+radius, 0])\n              circle(r=radius);\n          \n            translate([(x2+radius), (y+l)+radius, 0])\n              circle(r=radius);\n          \n            translate([(x2+radius), (y+radius), 0])\n              circle(r=radius);\n          }\n        } // linear_extrude\n      } //-- roundRect()\n      //-------------------------------------------------------------------\n  \n      module oneMount(bm, maxLength, originLLOpt, invertX)\n      {\n        isCenter = isTrue(yappCenter, bm);\n        mountPosRaw1 = is_list(bm[0]) ? bm[0][0] : bm[0]; //-- = posx\n        mountOpeningDiameter = bm[1];                     //-- = screwDiameter\n        mountWidthRaw = bm[2];                            //-- = width\n        mountHeight = bm[3];                              //-- = Height\n        filletRad = getParamWithDefault(bm[4],0);         //-- fillet radius\n        bmYpos    = is_list(bm[0]) \n                  ? (mountOpeningDiameter*-2) - bm[0][1] \n                  : (mountOpeningDiameter*-2);   \n        \n        slotOrientation = mountWidthRaw<0 ? false : true;\n        mountWidth = slotOrientation ? mountWidthRaw : 0;\n        mountLength = slotOrientation ? 0 : mountWidthRaw;\n        \n        //-- Adjust for centered mounts\n        mountPosRaw2 = (isCenter) ? mountPosRaw1 - (mountWidth/2) : mountPosRaw1;\n        //-- Adjust for inverted axis\n        mountPosRaw = invertX ? mountPosRaw2 : -mountPosRaw2;\n        //-- Adjust for LowerLeft Origin\n        mountPos = originLLOpt ? maxLength - mountPosRaw - mountWidth : mountPosRaw;\n     \n        totalmountWidth = mountWidth+mountOpeningDiameter*2;\n            \n        newWidth  = maxWidth(mountWidth, mountOpeningDiameter, maxLength);\n        scrwX1pos = mountPos;\n        scrwX2pos = scrwX1pos + newWidth;\n\n        newLength  = maxWidth(mountLength, mountOpeningDiameter, maxLength);\n        scrwY1pos = 0;\n        scrwY2pos = scrwY1pos + newLength;\n    \n        filletRadius = (filletRad==0) ? mountHeight/4 : filletRad;\n        \n        outRadius = mountOpeningDiameter;\n        bmX1pos   = scrwX1pos-mountOpeningDiameter;\n        bmX2pos   = scrwX2pos-outRadius;\n            \n        bmYpos1   = (slotOrientation) ? bmYpos : bmYpos + newLength;\n        bmLen     = -bmYpos1+roundRadius;\n            \n        //-- Get where to connect the mount defaulting to base\n        mountToPart = (isTrue(yappLid, bm)) ? yappLid : yappBase; \n        \n        mountOffsetZ = (mountToPart==yappBase) ? 0 : -shellHeight + (mountHeight*2);\n        mountFlipZ = (mountToPart==yappBase) ? 0 : 1;\n        \n        translate([0,0,mountOffsetZ])\n        {\n          mirror([0,0,mountFlipZ])\n          {\n            difference()\n            {\n              //-- Mounting tab\n              color(\"red\")\n              roundedRect([bmX1pos,bmX2pos,bmYpos1,bmLen,mountHeight], outRadius);\n              translate([0, (bmYpos + mountOpeningDiameter), -1])\n              {\n                //-- Slot\n                color(\"blue\")\n                hull() \n                {\n                  linear_extrude(mountHeight*2)\n                  {\n                  // translate([scrwX1pos - mountPos,0, 0]) \n                    translate([scrwX1pos,scrwY1pos, 0]) \n                      color(\"blue\")\n                      {\n                        circle(mountOpeningDiameter/2);\n                      }\n                  // translate([scrwX2pos - mountPos, 0, 0]) \n                    translate([scrwX2pos, scrwY2pos, 0]) \n                      color(\"blue\")\n                        circle(mountOpeningDiameter/2);\n                  } // extrude\n                } // hull\n              } // translate\n            \n            } // difference..\n            \n            //-- add fillet\n            if (!isTrue(yappNoFillet, bm))\n            {\n              filletRad = min(filletRadius, -bmYpos/4);\n              color (\"red\")\n              union()\n              {\n              translate([scrwX1pos -mountOpeningDiameter,0,0])  // x, Y, Z\n              {\n                linearFillet((scrwX2pos-scrwX1pos)+(mountOpeningDiameter*2), filletRad, 180);\n              }\n              translate([scrwX1pos -mountOpeningDiameter,0,-(roundRadius-mountHeight+filletRadius)])  // x, Y, Z\n              {\n                cube([(scrwX2pos-scrwX1pos)+(mountOpeningDiameter*2), roundRadius,roundRadius-mountHeight+filletRadius]);\n              }\n            }\n            } // Fillet\n          } // difference\n        } //mirror\n      } //-- oneMount()\n      \n    //--------------------------------------------------------------------\n    function maxWidth(w, r, l) = (w>(l-(r*4)))        ? l-(r*4)      : w;\n    //--------------------------------------------------------------------\n\n    //--------------------------------------------------------\n    //-- position is: [(shellLength/2), \n    //--               shellWidth/2, \n    //--               (baseWallHeight+basePlaneThickness)]\n    //--------------------------------------------------------\n    //-- back to [0,0,0]\n    translate([(shellLength/2)*-1,\n                (shellWidth/2)*-1,\n                (baseWallHeight+basePlaneThickness)*-1])\n    {\n      for (bm = boxMounts)\n      {    \n        mountPos = is_list(bm[0]) ? bm[0][0] : bm[0]; // = posx\n        mountHeight = bm[3];\n        mountLength = bm[2]<0 ? 0 : bm[2];\n        \n        \n        originLLOpt = isTrue(yappAltOrigin, bm);\n\n        if (isTrue(yappLeft, bm))\n        {\n          translate([mountLength,0, mountHeight])\n          rotate([0,180,0])\n          {\n            oneMount(bm, shellLength, false, false);\n          }\n        } //  if yappLeft\n        \n        if (isTrue(yappRight, bm))\n        {\n          translate([0,shellWidth, mountHeight])\n          rotate([0,180,180])\n          {\n            oneMount(bm, shellLength, originLLOpt, true);\n          }\n        } //  if yappRight\n        \n        if (isTrue(yappFront, bm))\n        {\n          translate([shellLength,mountLength, mountHeight])\n          rotate([0,180,90])\n          {\n            oneMount(bm, shellWidth, false, false);\n          }\n        } //  if yappFront\n        \n        if (isTrue(yappBack, bm))\n        {\n          translate([0,0, mountHeight])\n          rotate([0,180,-90])\n          {\n            oneMount(bm, shellWidth, originLLOpt, true);\n          }\n        } //  if yappBack\n      } // for ..\n  } //  translate to [0,0,0]\n} //-- printBoxMounts()\n\n\n//===========================================================\nmodule printSnapJoins(casePart)\n{\n  if (casePart == yappPartBase) \n  {\n    //--   The snap itself\n    if (len(snapJoins) > 0) \n    {\n      assert ((ridgeHeight >= (wallThickness*wallToRidgeRatio)), str(\"ridgeHeight < \", wallToRidgeRatio, \" times wallThickness: no SnapJoins possible\"));\n    }\n\n    for (snj = snapJoins)\n    {\n      useCenter = (isTrue(yappCenter, snj));\n      diamondshape = isTrue(yappRectangle, snj);\n\n      snapDiam   = (!diamondshape) ? wallThickness : (wallThickness/sqrt(2));  // fixed\n      sideLength = ((isTrue(yappLeft, snj)) || (isTrue(yappRight, snj))) ? shellLength : shellWidth;\n      snapWidth  = snj[1];\n      snapStart  = (useCenter) ? snj[0] - snapWidth/2 : snj[0];\n      snapZpos = (!diamondshape) ? \n                  (basePlaneThickness+baseWallHeight)-((wallThickness/2)) \n                : (basePlaneThickness+baseWallHeight)-((wallThickness));\n      tmpAmin    = (roundRadius)+(snapWidth/2);\n      tmpAmax    = sideLength - tmpAmin;\n      tmpA       = max(snapStart+(snapWidth/2), tmpAmin);\n      snapApos   = min(tmpA, tmpAmax);\n      \n      if(!diamondshape)\n      {\n        if (isTrue(yappLeft, snj))\n        {\n          translate([snapApos-(snapWidth/2),\n                        wallThickness/2,\n                        snapZpos])\n          {\n            rotate([0,90,0])\n              color(\"blue\") cylinder(d=snapDiam, h=snapWidth);\n          }\n          if (isTrue(yappSymmetric, snj))\n          {\n            translate([shellLength-(snapApos+(snapWidth/2)),\n                        wallThickness/2,\n                        snapZpos])\n            {\n              rotate([0,90,0])\n                color(\"blue\") cylinder(d=snapDiam, h=snapWidth);\n            }\n            \n          } // yappSymmetric\n        } // yappLeft\n        \n        if (isTrue(yappRight, snj))\n        {\n          translate([snapApos-(snapWidth/2),\n                        shellWidth-(wallThickness/2),\n                        snapZpos])\n          {\n            rotate([0,90,0])\n              color(\"blue\") cylinder(d=snapDiam, h=snapWidth);\n          }\n          if (isTrue(yappSymmetric, snj))\n          {\n            translate([shellLength-(snapApos+(snapWidth/2)),\n                        shellWidth-(wallThickness/2),\n                        snapZpos])\n            {\n              rotate([0,90,0])\n                color(\"blue\") cylinder(d=snapDiam, h=snapWidth);\n            }\n            \n          } // yappSymmetric\n        } // yappRight\n        \n        if (isTrue(yappBack, snj))\n        {\n          translate([(wallThickness/2),\n                        snapApos-(snapWidth/2),\n                        snapZpos])\n          {\n            rotate([270,0,0])\n              color(\"blue\") cylinder(d=snapDiam, h=snapWidth);\n          }\n          if (isTrue(yappSymmetric, snj))\n          {\n            translate([(wallThickness/2),\n                          shellWidth-(snapApos+(snapWidth/2)),\n                          snapZpos])\n            {\n              rotate([270,0,0])\n                color(\"blue\") cylinder(d=snapDiam, h=snapWidth);\n            }\n            \n          } // yappSymmetric\n        } // yappBack\n        \n        if (isTrue(yappFront, snj))\n        {\n          translate([shellLength-(wallThickness/2),\n                        snapApos-(snapWidth/2),\n                        snapZpos])\n          {\n            rotate([270,0,0])\n              color(\"blue\") cylinder(d=snapDiam, h=snapWidth);\n          }\n          if (isTrue(yappSymmetric, snj))\n          {\n            translate([shellLength-(wallThickness/2),\n                          shellWidth-(snapApos+(snapWidth/2)),\n                          snapZpos])\n            {\n              rotate([270,0,0])\n                color(\"blue\") cylinder(d=snapDiam, h=snapWidth);\n            }\n            \n          } // yappSymmetric\n        } // yappFront\n      }\n      else \n      {\n        //-- Use Diamond shaped snaps\n        \n        if (isTrue(yappLeft, snj))\n        {\n          translate([snapApos-(snapWidth/2), (wallThickness/2)+0.15, snapZpos])\n          {\n            scale([1,.60, 1])\n              rotate([45,0,0])\n                color(\"blue\") cube([snapWidth, snapDiam, snapDiam]);\n\n          }\n          if (isTrue(yappSymmetric, snj))\n          {\n            translate([shellLength-(snapApos+(snapWidth/2)),\n                        (wallThickness/2)+0.15,\n                        snapZpos])\n            {\n            scale([1,.60, 1])\n              rotate([45,0,0])\n                color(\"blue\") cube([snapWidth, snapDiam, snapDiam]);\n            }\n            \n          } // yappSymmetric\n        } // yappLeft\n        \n        if (isTrue(yappRight, snj))\n        {\n          translate([snapApos-(snapWidth/2),\n                        shellWidth-((wallThickness/2)+0.15),\n                        snapZpos])\n          {\n            scale([1,.60, 1])\n              rotate([45,0,0])\n                color(\"blue\") cube([snapWidth, snapDiam, snapDiam]);\n          }\n          if (isTrue(yappSymmetric, snj))\n          {\n            translate([shellLength-(snapApos+(snapWidth/2)),\n                        shellWidth-((wallThickness/2)+0.15),\n                        snapZpos])\n            {\n              scale([1,.60, 1])\n                rotate([45,0,0])\n                  color(\"blue\") cube([snapWidth, snapDiam, snapDiam]);\n\n            }\n            \n          } // yappSymmetric\n        } // yappRight\n        \n        if (isTrue(yappBack, snj))\n        {\n          translate([((wallThickness/2)+0.15),\n                        snapApos-(snapWidth/2),\n                        snapZpos])\n          {\n            scale([.60,1, 1])\n              rotate([45,0,90])\n               color(\"blue\") cube([snapWidth, snapDiam, snapDiam]);\n          }\n          if (isTrue(yappSymmetric, snj))\n          {\n            translate([((wallThickness/2)+0.15),\n                          shellWidth-(snapApos+(snapWidth/2)),\n                          snapZpos])\n            {\n              scale([.60,1, 1])\n                rotate([45,0,90])\n                  color(\"blue\") cube([snapWidth, snapDiam, snapDiam]);\n            }\n            \n          } // yappCenter\n        } // yappBack\n        \n        if (isTrue(yappFront, snj))\n        {\n          translate([shellLength-((wallThickness/2)+0.15),\n                        snapApos-(snapWidth/2),\n                        snapZpos])\n          {\n            scale([.60, 1, 1])\n              rotate([45,0,90])\n                color(\"blue\") cube([snapWidth, snapDiam, snapDiam]);\n          }\n          if (isTrue(yappSymmetric, snj))\n          {\n            translate([shellLength-((wallThickness/2)+0.15),\n                          shellWidth-(snapApos+(snapWidth/2)),\n                          snapZpos])\n            {\n              scale([.60, 1, 1])\n                rotate([45,0,90])\n                  color(\"blue\") cube([snapWidth, snapDiam, snapDiam]);\n            }          \n          } // yappCenter\n        } // yappFront\n      } // diamondshape\n    } // for snj .. \n  } //  Base\n\n  if (casePart == yappPartLid) \n  {\n    //-- The cutout/reciever \n    if (len(snapJoins) > 0) \n    {\n      assert ((ridgeHeight >= (wallThickness*wallToRidgeRatio)), str(\"ridgeHeight < \", wallToRidgeRatio, \" times wallThickness: no SnapJoins possible\"));\n    }\n    \n    for (snj = snapJoins)\n    {\n      useCenter = (isTrue(yappCenter, snj));\n      diamondshape = isTrue(yappRectangle, snj);\n      \n      sideLength = ((isTrue(yappLeft, snj)) || (isTrue(yappRight, snj))) ? shellLength : shellWidth;\n      snapWidth  = snj[1]+1;\n      snapStart  = (useCenter) ? (snj[0] - snapWidth/2) : (snj[0]) - 0.5;\n      snapDiam   = (!diamondshape) ? (wallThickness*1.0) : wallThickness/sqrt(2);\n      snapZpos = (!diamondshape) \n                  ? ((lidPlaneThickness+lidWallHeight)*-1)-(wallThickness*1.0)\n                  : ((lidPlaneThickness+lidWallHeight)*-1)-(wallThickness);\n      tmpAmin    = (roundRadius)+(snapWidth/2);\n      tmpAmax    = sideLength - tmpAmin;\n      tmpA       = max(snapStart+(snapWidth/2), tmpAmin);\n      snapApos   = min(tmpA, tmpAmax);\n\n      if(!diamondshape)\n      {\n        if (isTrue(yappLeft, snj))\n        {\n          translate([snapApos-(snapWidth/2), -0.02, snapZpos])\n          {\n            color(\"blue\") cube([snapWidth, wallThickness+0.04, snapDiam]);\n          }\n          if (isTrue(yappSymmetric, snj))\n          {\n            translate([shellLength-(snapApos+(snapWidth/2)), -0.02, snapZpos])\n            {\n              color(\"blue\") cube([snapWidth, wallThickness+0.04, snapDiam]);\n            }\n          } // yappSymmetric\n        } // yappLeft\n        \n        if (isTrue(yappRight, snj))\n        {\n          translate([snapApos-(snapWidth/2),shellWidth-wallThickness-0.02, snapZpos])\n          {\n            color(\"blue\") cube([snapWidth, wallThickness+0.04, snapDiam]);\n          }\n          if (isTrue(yappSymmetric, snj))\n          {\n            translate([shellLength-(snapApos+(snapWidth/2)), shellWidth-wallThickness-0.02, snapZpos])\n            {\n              color(\"blue\") cube([snapWidth, wallThickness+0.04, snapDiam]);\n            } \n          } // yappSymmetric\n        } // yappRight\n        \n        if (isTrue(yappBack, snj))\n        {\n          translate([-0.02, snapApos-(snapWidth/2), snapZpos])\n          {\n            color(\"blue\") cube([wallThickness+0.04, snapWidth, snapDiam]);\n          }\n          if (isTrue(yappSymmetric, snj))\n          {\n            translate([-0.02, shellWidth-(snapApos+(snapWidth/2)), snapZpos])\n            {\n              color(\"blue\") cube([wallThickness+0.04, snapWidth, snapDiam]);\n            }\n          } // yappSymmetric\n        } // yappBack\n        \n        if (isTrue(yappFront, snj))\n        {\n          translate([shellLength-wallThickness-0.02, snapApos-(snapWidth/2), snapZpos])\n          {\n            color(\"blue\") cube([wallThickness+0.04, snapWidth, snapDiam]);\n          }\n          if (isTrue(yappSymmetric, snj))\n          {\n            translate([shellLength-wallThickness-0.02, shellWidth-(snapApos+(snapWidth/2)), snapZpos])\n            {\n              color(\"blue\") cube([wallThickness+0.04, snapWidth, snapDiam]);\n            }\n          } // yappSymmetric\n        } // yappFront\n      }\n      else\n      // Use the Diamond Shape\n      {\n        if (printMessages) echo (\"making Diamond shaped snaps\");\n        if (isTrue(yappLeft, snj))\n        {\n          translate([snapApos-(snapWidth/2)-0.5, (wallThickness/2)+0.15, snapZpos])\n          {\n            scale([1,.60, 1])\n                rotate([45,0,0])\n            color(\"blue\") cube([snapWidth+1, snapDiam, snapDiam]);\n          }\n          if (isTrue(yappSymmetric, snj))\n          {\n          //  translate([shellLength-(snapApos+(snapWidth/2)+0.5), (wallThickness/2)+0.04, snapZpos])\n            translate([shellLength-(snapApos+(snapWidth/2)+0.5), (wallThickness/2)+0.15, snapZpos])\n            {\n              scale([1,.60, 1])\n                rotate([45,0,0])\n              color(\"blue\") cube([snapWidth+1, snapDiam, snapDiam]);\n            }\n          } // yappSymmetric\n        } // yappLeft\n        \n        if (isTrue(yappRight, snj))\n        {\n          translate([snapApos-(snapWidth/2)-0.5, shellWidth-(wallThickness/2)-0.15, snapZpos])\n          {\n            scale([1,.60, 1])\n                rotate([45,0,0])\n            color(\"blue\") cube([snapWidth+1, snapDiam, snapDiam]);\n          }\n          if (isTrue(yappSymmetric, snj))\n          {\n            translate([shellLength-(snapApos+(snapWidth/2)+0.5), shellWidth-(wallThickness/2)-0.15, snapZpos])\n            {\n              scale([1,.60, 1])\n                rotate([45,0,0])\n              color(\"blue\") cube([snapWidth+1, snapDiam, snapDiam]);\n            } \n          } // yappSymmetric\n        } // yappRight\n        \n        if (isTrue(yappBack, snj))\n        {\n          translate([(wallThickness/2)+0.15, snapApos-(snapWidth/2)-0.5, snapZpos])\n          {\n            scale([0.6, 1, 1])\n             rotate([45,0,90])\n              color(\"blue\") \n               cube([snapWidth+1, snapDiam, snapDiam]);\n          }\n          if (isTrue(yappSymmetric, snj))\n          {\n            translate([(wallThickness/2)+0.15, shellWidth-(snapApos+(snapWidth/2))-0.5, snapZpos])\n            {\n              scale([0.6, 1, 1])\n              rotate([45,0,90])\n                 color(\"blue\") \n                   cube([snapWidth+1, snapDiam, snapDiam]);\n            }\n            \n          } // yappSymmetric\n        } // yappBack\n        \n        if (isTrue(yappFront, snj))\n        {\n          translate([shellLength-((wallThickness/2)+0.15), snapApos-(snapWidth/2)-0.5, snapZpos])\n          {\n              scale([0.6, 1, 1])\n                rotate([45,0,90])\n            color(\"blue\") cube([snapWidth+1, snapDiam, snapDiam]);\n          }\n          if (isTrue(yappSymmetric, snj))\n          {\n            translate([shellLength-((wallThickness/2)+0.15),  shellWidth-(snapApos+(snapWidth/2))-0.5,  snapZpos])\n            {\n              scale([0.6, 1, 1])\n                rotate([45,0,90])\n              color(\"blue\") cube([snapWidth+1, snapDiam, snapDiam]);\n            }     \n          } // yappSymmetric\n        } // yappFront      \n      }\n    } // for snj .. \n  } //  Lid()\n} //-- printSnapJoins()\n\n  //--------------------------------------------------------\n  module minkowskiOuterBox(L, W, H, oRad, plane, wall)\n  {    \n    if ((shellEdgeTopBottom == yappEdgeRounded) && (shellEdgeVert == yappEdgeRounded))\n    { \n      minkowski()\n      {\n        cube([L+(wall*2)-(oRad*2), W+(wall*2)-(oRad*2), (H*2)+(plane*2)-(oRad*2)], center=true);\n        sphere(oRad*minkowskiErrorCorrection); // Compensate for minkowski error\n      }\n    } \n    else if ((shellEdgeTopBottom == yappEdgeSquare) && (shellEdgeVert == yappEdgeSquare))\n    {\n      cube([L+(wall*2), W+(wall*2), (H*2)+(plane*2)], center=true);\n    } \n    else if ((shellEdgeTopBottom == yappEdgeSquare) && (shellEdgeVert == yappEdgeRounded))\n    {\n      linear_extrude((H*2)+(plane*2),center=true)\n//      roundedRectangle2D(width=L+(wall*2),length=W+(wall*2),radius=(iRad*2)-wall/2);\n      roundedRectangle2D(width=L+(wall*2),length=W+(wall*2),radius=oRad);\n    } \n    else if ((shellEdgeTopBottom == yappEdgeSquare) && (shellEdgeVert == yappEdgeChamfered))\n    {\n      linear_extrude((H*2)+(plane*2),center=true)\n      chamferedRectangle2D(L+(wall*2),W+(wall*2),oRad);\n    } \n    else if ((shellEdgeTopBottom == yappEdgeChamfered) && (shellEdgeVert == yappEdgeChamfered))\n    {\n      chamferCube3D(L+(wall*2),W+(wall*2),(H*2)+(plane*2),(oRad),(oRad),(oRad));\n    } \n    \n    // BoxType=5\n    else if ((shellEdgeTopBottom == yappEdgeChamfered) && (shellEdgeVert == yappEdgeRounded))\n    {\n      //--bottom\n      translate([0,0,-((H*2)+(plane*2)-((oRad)))/2])\n      mirror([0,0,1])\n      linear_extrude(((oRad)), scale = [1-(((oRad))/(L+(wall*2))*2),1-(((oRad))/(W+(wall*2))*2)],center=true)\n      roundedRectangle2D(width=L+(wall*2),length=W+(wall*2),radius=(oRad));\n\n      //--main\n      linear_extrude((H*2)+(plane*2)-(((oRad))*2) + 0.02,center=true)\n      roundedRectangle2D(width=L+(wall*2),length=W+(wall*2),radius=(oRad));\n\n      //--top\n      translate([0,0,((H*2)+(plane*2)-((oRad)))/2])\n      linear_extrude(((oRad)), scale = [1-(((oRad))/(L+(wall*2))*2),1-(((oRad))/(W+(wall*2))*2)],center=true)\n      roundedRectangle2D(width=L+(wall*2),length=W+(wall*2),radius=(oRad));\n    } \n    else \n    {\n      assert(false, \"Unsupported edge combination\");\n    } \n  } //-- minkowskiOuterBox()\n\n  module minkowskiCutBox(L, W, H, cRad, plane, wall)\n  {\n    if ((shellEdgeTopBottom == yappEdgeRounded) && (shellEdgeVert == yappEdgeRounded))\n    { \n      minkowski()\n      {\n        cube([L+(wall)-(cRad*2), W+(wall)-(cRad*2), (H*2)+(plane)-(cRad*2)], center=true);\n        sphere(cRad*minkowskiErrorCorrection); // Compensate for minkowski error\n      }\n    } \n    else if ((shellEdgeTopBottom == yappEdgeSquare) && (shellEdgeVert == yappEdgeSquare))\n    {\n      cube([L+(wall), W+(wall), (H*2)+(plane)], center=true);\n    } \n    else if ((shellEdgeTopBottom == yappEdgeSquare) && (shellEdgeVert == yappEdgeRounded))\n    {\n      linear_extrude((H*2)+(plane),center=true)\n      roundedRectangle2D(width=L+(wall),length=W+(wall),radius=cRad);\n    } \n    else if ((shellEdgeTopBottom == yappEdgeSquare) && (shellEdgeVert == yappEdgeChamfered))\n    {\n      linear_extrude((H*2)+(plane),center=true)\n      chamferedRectangle2D(L+(wall),W+(wall),(cRad));\n    } \n    else if ((shellEdgeTopBottom == yappEdgeChamfered) && (shellEdgeVert == yappEdgeChamfered))\n    {\n      chamferCube3D(L+(wall),W+(wall),(H*2)+(plane),(cRad),(cRad),(cRad*sqrt(2)));\n    } \n\n    // BoxType=5\n    else if ((shellEdgeTopBottom == yappEdgeChamfered) && (shellEdgeVert == yappEdgeRounded))\n    {\n      //--bottom\n      translate([0,0,-((H*2)+(plane*1)-((cRad)))/2])\n      mirror([0,0,1])\n      linear_extrude(((cRad)), scale = [1-(((cRad))/(L+(wall*1))*2),1-(((cRad))/(W+(wall*1))*2)],center=true)\n      roundedRectangle2D(width=L+(wall*1),length=W+(wall*1),radius=(cRad));\n\n      //--main\n      linear_extrude((H*2)+(plane*1)-(((cRad))*2) + 0.02,center=true)\n      roundedRectangle2D(width=L+(wall*1),length=W+(wall*1),radius=(cRad));\n\n      //--top\n      translate([0,0,((H*2)+(plane*1)-((cRad)))/2])\n      linear_extrude(((cRad)), scale = [1-(((cRad))/(L+(wall*1))*2),1-(((cRad))/(W+(wall*1))*2)],center=true)\n      roundedRectangle2D(width=L+(wall*1),length=W+(wall*1),radius=(cRad));\n    } \n\n    else \n    {\n      assert(false, \"Unsupported edge combination\");\n    }\n  } //-- minkowskiCutBox()\n  \n  //--------------------------------------------------------\n  module minkowskiInnerBox(L, W, H, iRad, plane, wall)\n  {\n    if ((shellEdgeTopBottom == yappEdgeRounded) && (shellEdgeVert == yappEdgeRounded))\n    { \n      minkowski()\n      {\n        cube([L-((iRad*2)), W-((iRad*2)), (H*2)-((iRad*2))], center=true);\n        sphere(iRad*minkowskiErrorCorrection); // Compensate for minkowski error\n      }\n    } \n    else if ((shellEdgeTopBottom == yappEdgeSquare) && (shellEdgeVert == yappEdgeSquare))\n    {\n      cube([L, W, (H*2)], center=true);\n    } \n    else if ((shellEdgeTopBottom == yappEdgeSquare) && (shellEdgeVert == yappEdgeRounded))\n    {\n      linear_extrude(H*2,center=true)\n      roundedRectangle2D(width=L,length=W,radius=iRad);\n    } \n    else if ((shellEdgeTopBottom == yappEdgeSquare) && (shellEdgeVert == yappEdgeChamfered))\n    {\n      linear_extrude(H*2,center=true)\n      chamferedRectangle2D(L,W,iRad);\n    } \n    else if ((shellEdgeTopBottom == yappEdgeChamfered) && (shellEdgeVert == yappEdgeChamfered))\n    {\n      chamferCube3D(L,W,H*2,iRad,iRad,iRad);\n    } \n\n    // BoxType=5\n    else if ((shellEdgeTopBottom == yappEdgeChamfered) && (shellEdgeVert == yappEdgeRounded))\n    {\n      //--bottom\n      translate([0,0,-((H*2)+(plane*0)-((iRad)))/2])\n      mirror([0,0,1])\n      linear_extrude(((iRad)), scale = [1-(((iRad))/(L+(wall*0))*2),1-(((iRad))/(W+(wall*0))*2)],center=true)\n      roundedRectangle2D(width=L+(wall*0),length=W+(wall*0),radius=(iRad));\n\n      //--main\n      linear_extrude((H*2)+(plane*0)-(((iRad))*2) + 0.02,center=true)\n      roundedRectangle2D(width=L+(wall*0),length=W+(wall*0),radius=(iRad));\n\n      //--top\n      translate([0,0,((H*2)+(plane*0)-((iRad)))/2])\n      linear_extrude(((iRad)), scale = [1-(((iRad))/(L+(wall*0))*2),1-(((iRad))/(W+(wall*0))*2)],center=true)\n      roundedRectangle2D(width=L+(wall*0),length=W+(wall*0),radius=(iRad));\n    } \n\n    else \n    {\n      assert(false, \"Unsupported edge combination\");\n    } \n  } //-- minkowskiInnerBox()\n\n\n//===========================================================\nmodule minkowskiBox(shell, L, W, H, rad, plane, wall, preCutouts)\n{\n  iRad = getMinRad(rad, wall);\n  cRad = (rad + iRad)/2;\n  oRad = rad;\n    \n  \n  //--------------------------------------------------------\n  \n  if (preCutouts) \n  {\n    if (shell==yappPartBase)\n    {\n      if (len(boxMounts) > 0)\n      {\n        difference()\n        {\n          printBoxMounts();\n          minkowskiCutBox(L, W, H, cRad, plane, wall);\n        } // difference()\n      } // if (len(boxMounts) > 0)\n     \n      //-- Objects to be cut to outside the box       \n      //color(\"Orange\")\n      difference()\n      {\n        //-- move it to the origin of the base\n        translate ([-L/2, -W/2, -H])\n          hookBaseOutsidePre();    \n        minkowskiCutBox(L, W, H, cRad, plane, wall);\n      } // difference()\n    \n      //-- draw stuff inside the box\n      //color(\"LightBlue\")\n      intersection()\n      {\n        minkowskiCutBox(L, W, H, cRad, plane, wall);\n        translate ([-L/2, -W/2, -H]) //-baseWallHeight])\n          hookBaseInsidePre();\n      } // intersection()\n\n      //-- The actual box\n      color(colorBase, alphaBase)\n      difference()\n      {\n        minkowskiOuterBox(L, W, H, rad, plane, wall);\n        minkowskiInnerBox(L, W, H, iRad, plane, wall);\n      } // difference\n   \n      //-- Draw the labels that are added (raised) from the case\n      color(\"DarkGreen\") drawLabels(yappPartBase, false);\n      color(\"DarkGreen\") drawImages(yappPartBase, false);\n\n    } // if (shell==yappPartBase)\n    else\n    {\n      //-- Lid\n      if (len(boxMounts) > 0)\n      {\n        difference()\n        {\n          printBoxMounts();\n          minkowskiCutBox(L, W, H, cRad, plane, wall);\n        } // difference()\n      } // if (len(boxMounts) > 0)\n\n      //color(\"Red\")\n      difference()\n      {\n        //-- Objects to be cut to outside the box \n        //-- move it to the origin of the base\n        translate ([-L/2, -W/2, H])\n        hookLidOutsidePre();\n        minkowskiCutBox(L, W, H, cRad, plane, wall);\n      } // difference()\n      \n      //-- draw stuff inside the box\n      //color(\"LightGreen\")\n      intersection()\n      {\n        minkowskiCutBox(L, W, H, cRad, plane, wall);\n        translate ([-L/2, -W/2, H])\n          hookLidInsidePre();\n      } //intersection()\n\n      //-- The actual box\n      color(colorLid, alphaLid)\n      difference()\n      {\n        minkowskiOuterBox(L, W, H, rad, plane, wall);\n        minkowskiInnerBox(L, W, H, iRad, plane, wall);\n      } // difference  \n\n      //-- Draw the labels that are added (raised) from the case\n      color(\"DarkGreen\") drawLabels(yappPartLid, false);\n      color(\"DarkGreen\") drawImages(yappPartLid, false);\n    }\n  }\n  else // preCutouts\n  {\n    //-- Only add the Post hooks\n    if (shell==yappPartBase)\n    {\n      //color(\"Orange\")\n      difference()\n      {\n        // Objects to be cut to outside the box       \n        // move it to the origin of the base\n        translate ([-L/2, -W/2, -H]) \n          hookBaseOutside();\n        minkowskiCutBox(L, W, H, cRad, plane, wall);\n      } // difference()\n\n      //draw stuff inside the box\n      //color(\"LightBlue\")\n      intersection()\n      {\n        minkowskiCutBox(L, W, H, cRad, plane, wall);\n      \n        translate ([-L/2, -W/2, -H])\n          hookBaseInside();\n      } // intersection()\n    } // if (shell==yappPartBase)\n    else\n    {\n      //Lid      \n      //color(\"Red\")\n      difference()\n      {\n        //-- Objects to be cut to outside the box \n        //-- move it to the origin of the base\n        translate ([-L/2, -W/2, H])\n        hookLidOutside();\n        minkowskiCutBox(L, W, H, cRad, plane, wall);\n      } // difference()\n\n      //-- draw stuff inside the box\n      //color(\"LightGreen\")\n      intersection()\n      {\n        translate ([-L/2, -W/2, H])\n          hookLidInside();\n        minkowskiCutBox(L, W, H, cRad, plane, wall);\n      }\n    }\n  } //preCutouts\n} //-- minkowskiBox()\n\n\n//===========================================================\nmodule showPCBMarkers(thePCB)\n{  \n  pcb_Length     = pcbLength(thePCB[0]); \n  pcb_Width      = pcbWidth(thePCB[0]); \n  pcb_Thickness  = pcbThickness(thePCB[0]); \n\n  posX          = translate2Box_X(0, yappBase, [yappCoordPCB, yappGlobalOrigin, thePCB[0]]);\n  posY          = translate2Box_Y(0, yappBase, [yappCoordPCB, yappGlobalOrigin, thePCB[0]]);\n  posZ          = translate2Box_Z(0, yappBase, [yappCoordPCB, yappGlobalOrigin, thePCB[0]]);\n\n  {\n    markerHeight=shellHeight+onLidGap+10;\n    //-- Back Left \n    translate([0, 0, (markerHeight/2) -posZ - 5]) \n      color(\"red\",0.50)\n        %cylinder(\n          r = .5,\n          h = markerHeight,\n          center = true);\n\n    translate([0, pcb_Width, (markerHeight/2) -posZ - 5]) \n      color(\"red\",0.50)\n        %cylinder(\n          r = .5,\n          h = markerHeight,\n          center = true);\n\n    translate([pcb_Length, pcb_Width, (markerHeight/2) -posZ - 5]) \n      color(\"red\",0.50)\n        %cylinder(\n          r = .5,\n          h = markerHeight,\n          center = true);\n\n    translate([pcb_Length, 0, (markerHeight/2) -posZ - 5]) \n      color(\"red\",0.50)\n        %cylinder(\n          r = .5,\n          h = markerHeight,\n          center = true);\n\n    translate([(shellLength/2)-posX, 0, pcb_Thickness])\n      rotate([0,90,0])\n        color(\"red\",0.50)\n          %cylinder(\n            r = .5,\n            h = shellLength+(wallThickness*2)+paddingBack,\n            center = true);\n\n    translate([(shellLength/2)-posX, pcb_Width, pcb_Thickness])\n      rotate([0,90,0])\n        color(\"red\",0.50)\n          %cylinder(\n            r = .5,\n            h = shellLength+(wallThickness*2)+paddingBack,\n            center = true);\n\n    translate([0, (shellWidth/2)-posY, pcb_Thickness])\n      rotate([90,90,0])\n        color(\"red\",0.50)\n          %cylinder(\n            r = .5,\n            h = shellWidth+(wallThickness*2)+paddingLeft,\n            center = true);\n\n    translate([pcb_Length, (shellWidth/2)-posY, pcb_Thickness])\n      rotate([90,90,0])\n        color(\"red\",0.50)\n          %cylinder(\n            r = .5,\n            h = shellWidth+(wallThickness*2)+paddingLeft,\n            center = true);\n            \n  } // show_markers   \n} //-- showMarkersPCB()\n\n\n//===========================================================\nmodule printPCB(thePCB) //posX, posY, posZ, length, width, thickness)\n{\n  pcbName = thePCB[0];\n  \n  posX = translate2Box_X(0, yappBase, [yappCoordPCB,yappGlobalOrigin, pcbName]);\n  posY = translate2Box_Y(0, yappBase, [yappCoordPCB,yappGlobalOrigin, pcbName]);\n  posZ = translate2Box_Z(0, yappBase, [yappCoordPCB,yappGlobalOrigin, pcbName]);\n  \n  //-- Adjust to the bottom of the PCB is at posZ\n  translate([posX,posY,posZ-pcbThickness(pcbName)])\n  \n  {\n    //-- Draw the PCB \n    color(\"red\", 0.5)\n//      cube([thePCB[1], thePCB[2], thePCB[5]]);\n      cube([pcbLength(pcbName), pcbWidth(pcbName), pcbThickness(pcbName)]);\n  \n//    hshift = (thePCB[1] > thePCB[2]) ? 0 : 4;\n    hshift = (thePCB[1] > thePCB[2]) ? 0 : 4;\n    //-- Add the name\n//    linear_extrude(thePCB[5]+ 0.04) \n    linear_extrude(pcbThickness(pcbName)+ 0.04) \n    {\n      translate([2+hshift,3,0])\n//      rotate([0,0,(thePCB[1] > thePCB[2]) ? 0 : 90])\n      rotate([0,0,(pcbLength(pcbName) > pcbWidth(pcbName)) ? 0 : 90])\n//      text(thePCB[0]\n      text(pcbName\n            , size=3\n            , direction=\"ltr\"\n            , halign=\"left\"\n            , valign=\"bottom\");\n    } // rotate\n        \n    if (showSwitches)\n    {\n      drawSwitchOnPCB(thePCB);\n    }\n    \n    if (showMarkersPCB) \n    {\n      showPCBMarkers(thePCB);\n    }\n  }\n} //-- printPCB()\n\n\n//===========================================================\n//-- Place the standoffs and through-PCB pins in the base Box\nmodule pcbHolders() \n{        \n  for ( stand = pcbStands )\n  {\n    //-- Get the PCBinfo \n    thePCBName = getPCBName(yappPCBName, stand);\n   \n    pcb_Length = pcbLength(thePCBName);\n    pcb_Width = pcbWidth(thePCBName);\n    pcb_Thickness = pcbThickness(thePCBName);\n    standoff_Height = standoffHeight(thePCBName);\n    pcbStandHeight  = getParamWithDefault(stand[2], standoff_Height);\n    filletRad = getParamWithDefault(stand[7],0);\n  //  standType = isTrue(yappHole, stand) ? yappHole : yappPin;\n    standType = \n\t\t\tisTrue(yappHole, stand) ? yappHole : \n\t\t\tisTrue(yappTopPin, stand) ? yappTopPin : \n\t\t\tyappPin;\n\n//    p(8) = Pin Length : Default = 0\n//    pinLength = getParamWithDefault(stand[8],0);\n    \n\n    //-- Calculate based on the Coordinate system\n    coordSystem = getCoordSystem(stand, yappCoordPCB);\n    \n    \n    offsetX   = translate2Box_X(0, yappBase, coordSystem);\n    offsetY   = translate2Box_Y(0, yappBase, coordSystem);\n    \n    connX   = stand[0];\n    connY   = stand[1];\n    \n    lengthX   = coordSystem[0]==yappCoordPCB ? pcb_Length \n              : coordSystem[0]==yappCoordBox ? shellLength \n              : coordSystem[0]==yappCoordBoxInside ? shellInsideLength \n              : undef;\n              \n    lengthY   = coordSystem[0]==yappCoordPCB ? pcb_Width \n              : coordSystem[0]==yappCoordBox ? shellWidth \n              : coordSystem[0]==yappCoordBoxInside ? shellInsideWidth \n              : undef;\n        \n    allCorners = (isTrue(yappAllCorners, stand)) ? true : false;\n    primeOrigin = (!isTrue(yappBackLeft, stand) && !isTrue(yappFrontLeft, stand) && !isTrue(yappFrontRight, stand) && !isTrue(yappBackRight, stand) && !isTrue(yappAllCorners, stand) ) ? true : false;\n\n    if (!isTrue(yappLidOnly, stand))\n    {\n      if (primeOrigin || allCorners || isTrue(yappBackLeft, stand))\n         translate([offsetX+connX, offsetY + connY, basePlaneThickness])\n          pcbStandoff(yappPartBase, pcbStandHeight, filletRad, standType, \"green\", !isTrue(yappNoFillet, stand),stand);\n\n      if (allCorners || isTrue(yappFrontLeft, stand))\n         translate([offsetX + lengthX - connX, offsetY + connY, basePlaneThickness])\n          pcbStandoff(yappPartBase, pcbStandHeight, filletRad, standType, \"green\", !isTrue(yappNoFillet, stand),stand);\n\n      if (allCorners || isTrue(yappFrontRight, stand))\n        translate([offsetX + lengthX - connX, offsetY + lengthY - connY, basePlaneThickness])\n          pcbStandoff(yappPartBase, pcbStandHeight, filletRad, standType, \"green\", !isTrue(yappNoFillet, stand),stand);\n\n      if (allCorners || isTrue(yappBackRight, stand))\n        translate([offsetX + connX, offsetY + lengthY - connY, basePlaneThickness])\n          pcbStandoff(yappPartBase, pcbStandHeight, filletRad, standType, \"green\", !isTrue(yappNoFillet, stand),stand);\n    } //if\n  } //for  \n} //-- pcbHolders()\n\n\n\n//===========================================================\n// Place the Pushdown in the Lid\nmodule pcbPushdowns() \n{        \n for ( pushdown = pcbStands )\n  {\n    //-- Get the PCBinfo \n    thePCB = getPCBInfo(yappPCBName, pushdown);\n   \n    pcb_Length       = pcbLength(thePCB[0]); \n    pcb_Width        = pcbWidth(thePCB[0]);\n    pcb_Thickness    = pcbThickness(thePCB[0]);\n    standoff_Height  = standoffHeight(thePCB[0]);\n  \n    //-- Calculate based on the Coordinate system\n    coordSystem = getCoordSystem(pushdown, yappCoordPCB);\n\n    offsetX   = translate2Box_X(0, yappBase, coordSystem);\n    offsetY   = translate2Box_Y(0, yappBase, coordSystem);\n\n    //-- Calculate based on the Coordinate system\n    usePCBCoord = (coordSystem[0] == yappCoordPCB) ? true : false;\n    \n    pcbGapTmp = getParamWithDefault(pushdown[3],-1);\n    pcbGap = (pcbGapTmp == -1 ) ? (usePCBCoord) ? pcb_Thickness : 0 : pcbGapTmp;\n\n    filletRad = getParamWithDefault(pushdown[7],0);\n     \n    standType = \n\t\t\tisTrue(yappHole, pushdown) ? yappHole : \n\t\t\tisTrue(yappTopPin, pushdown) ? yappTopPin : \n\t\t\tyappPin;\n  \n    pcbStandHeightTemp  = getParamWithDefault(pushdown[2], standoff_Height);\n    \n    pcbStandHeight=(baseWallHeight+lidWallHeight)\n                     -(pcbStandHeightTemp+pcbGap);\n\n    pcbZlid = (baseWallHeight+lidWallHeight+lidPlaneThickness)\n                    -(pcbStandHeightTemp+pcbGap);\n\n    connX   = pushdown[0];\n    connY   = pushdown[1];\n    lengthX   = usePCBCoord ? pcb_Length : shellLength;\n    lengthY   = usePCBCoord ? pcb_Width : shellWidth;\n\n    allCorners = (isTrue(yappAllCorners, pushdown)) ? true : false;\n    primeOrigin = (!isTrue(yappBackLeft, pushdown) && !isTrue(yappFrontLeft, pushdown) && !isTrue(yappFrontRight, pushdown) && !isTrue(yappBackRight, pushdown) && !isTrue(yappAllCorners, pushdown) ) ? true : false;\n\n    if (!isTrue(yappBaseOnly, pushdown))\n    {\n      if (primeOrigin || allCorners || isTrue(yappBackLeft, pushdown))\n      {\n        translate([offsetX + connX, offsetY + connY, pcbZlid*-1])\n          pcbStandoff(yappPartLid, pcbStandHeight, filletRad, standType, \"yellow\", !isTrue(yappNoFillet, pushdown),pushdown);\n      }\n      if (allCorners || isTrue(yappFrontLeft, pushdown))\n      {\n        translate([offsetX + lengthX - connX, offsetY + connY, pcbZlid*-1])\n          pcbStandoff(yappPartLid, pcbStandHeight, filletRad, standType, \"yellow\", !isTrue(yappNoFillet, pushdown),pushdown);\n      }\n      if (allCorners || isTrue(yappFrontRight, pushdown))\n      {\n         translate([offsetX + lengthX - connX, offsetY + lengthY - connY, pcbZlid*-1])\n          pcbStandoff(yappPartLid, pcbStandHeight, filletRad, standType, \"yellow\", !isTrue(yappNoFillet, pushdown),pushdown);\n      }\n      if (allCorners || isTrue(yappBackRight, pushdown))\n      {\n        translate([offsetX + connX, offsetY + lengthY - connY, pcbZlid*-1])\n          pcbStandoff(yappPartLid, pcbStandHeight, filletRad, standType, \"yellow\", !isTrue(yappNoFillet, pushdown),pushdown);\n      }\n    }\n  }  \n} //-- pcbPushdowns()\n\n//===========================================================\nmodule sanityCheckList(theList, theListName, minCount, shapeParam=undef, validShapes = []) \n  {    \n    if (printMessages) echo(\"Sanity Checking \", theListName, theList);\n      \n    if (is_list(theList))\n    {\n      if (len(theList)>0)\n      {\n        //-- Go throught the vector checking each one\n        for(pos = [0 : len(theList)-1])\n        {\n          item = theList[pos];\n          //-- Check that there are at least the minimun elements\n          //-- Cutouts require 9 elements\n          assert((len(item) >= minCount), str(theListName, \" item \", pos, \" require \", minCount, \" parameters at a minimum.\") );\n            \n          if (shapeParam!=undef)\n          {\n            theShape = item[shapeParam];\n            \n            assert((isTrue(theShape,validShapes)), str(theListName, \" item \", pos, \" Shape (param \",shapeParam,\") required to be one of the following \", validShapes) );\n          }\n        }\n      }\n      else\n      {\n        if (printMessages) echo (str(theListName, \" is empty\"));\n      }\n    } \n    else\n    {\n      if (printMessages) echo (theListName, \" is not defined\");\n    }\n  } //-- sanityCheckCutoutList()\n\n//===========================================================\n//-- Master module to process the 4 ridge extension for the box faces\nmodule makeRidgeExt(type, subtract)\n{      \n  if (printMessages) echo(\"***** Process RidgeExt *****\");\n  processFaceList(yappLeft,    ridgeExtLeft, type, \"ridgeExt\", subtract);\n  processFaceList(yappRight,   ridgeExtRight, type, \"ridgeExt\", subtract);\n  processFaceList(yappFront,   ridgeExtFront, type, \"ridgeExt\", subtract);\n  processFaceList(yappBack,    ridgeExtBack, type, \"ridgeExt\", subtract);\n} //-- makeRidgeExt()\n\n\n\n//===========================================================\n//-- Master module to process the 6 vectors for the box faces\nmodule makeCutouts(type)\n{      \n  if (type==yappPartBase)\n  { \n    //-- The bottom plane is only on the Base\n    processFaceList(yappBase,  cutoutsBase, type, \"cutout\", true); \n  }\n  else\n  {\n    //-- The bottom plane is only on the Lid\n    processFaceList(yappLid,     cutoutsLid, type, \"cutout\", true);\n  }\n  //-- All others can cross bewteen the two\n  processFaceList(yappLeft,    cutoutsLeft, type, \"cutout\", true);\n  processFaceList(yappRight,   cutoutsRight, type, \"cutout\", true);\n  processFaceList(yappFront,   cutoutsFront, type, \"cutout\", true);\n  processFaceList(yappBack,    cutoutsBack, type, \"cutout\", true);\n\n} //-- makeCutouts()\n\n\n//===========================================================\nmodule processCutoutList_Mask(cutOut, rot_X, rot_Y, rot_Z, offset_x, offset_y, offset_z, wallDepth,base_pos_H, base_pos_V, base_width, base_height, base_depth, base_angle, pos_X, pos_Y, invertZ, zAdjustForCutFromInside)\n{\n  //-- Check if there is a mask\n  theMask = getVector(yappMaskDef, cutOut);    \n  theMaskVector = getVectorInVector(yappMaskDef, cutOut);\n  useMask = ((!theMask==false) || (!theMaskVector==false));\n \n  if (printMessages) echo(\"processCutoutList_Mask\",base_depth=base_depth, zAdjustForCutFromInside=zAdjustForCutFromInside);\n\n  if (useMask) \n  {\n    maskDef      = (theMask != false) ? theMask :(theMaskVector!=false) ? theMaskVector[0][1] : undefined;\n    maskhOffset  = (theMask != false) ? 0 : (theMaskVector!=false) ? getParamWithDefault(theMaskVector[1],0) : undefined;\n    maskvOffset  = (theMask != false) ? 0 : (theMaskVector!=false) ? getParamWithDefault(theMaskVector[2],0) : undefined;\n    maskRotation = (theMask != false) ? 0 : (theMaskVector!=false) ? getParamWithDefault(theMaskVector[3],0) : undefined;\n\n    intersection()\n    {\n      //shape\n      processCutoutList_Shape(cutOut, rot_X, rot_Y, rot_Z, offset_x, offset_y, offset_z, wallDepth,base_pos_H, base_pos_V, base_width, base_height, base_depth, base_angle, pos_X, pos_Y, invertZ, zAdjustForCutFromInside);\n      \n      centeroffsetH = (isTrue(yappCenter, cutOut)) ? 0 : base_width / 2;\n      centeroffsetV = (isTrue(yappCenter, cutOut)) ? 0 : base_height / 2;\n      zShift = invertZ ? -base_depth - zAdjustForCutFromInside : zAdjustForCutFromInside;\n\t\t\t\n      translate([offset_x, offset_y, offset_z]) \n      {\n        rotate([rot_X, rot_Y, rot_Z])\n        {\n           translate([base_pos_H + centeroffsetH, base_pos_V+centeroffsetV, wallDepth + zShift - 0.02])\n          color(\"Fuchsia\")\n          genMaskfromParam(maskDef, base_width, base_height, base_depth, maskhOffset, maskvOffset, maskRotation);\n        }// rotate\n      } //translate\n    } // intersection\n  } // Use Mask\n  else\n  {\n    processCutoutList_Shape(cutOut, rot_X, rot_Y, rot_Z, offset_x, offset_y, offset_z, wallDepth,base_pos_H, base_pos_V, base_width, base_height, base_depth, base_angle, pos_X, pos_Y, invertZ, zAdjustForCutFromInside);\n  }\n} //-- processCutoutList_Mask()\n\n//===========================================================\n//-- Process the list passeed in\nmodule processCutoutList_Shape(cutOut, rot_X, rot_Y, rot_Z, offset_x, offset_y, offset_z, wallDepth,base_pos_H, base_pos_V, base_width, base_height, base_depth, base_angle, pos_X, pos_Y, invertZ, zAdjustForCutFromInside)\n{\n  theRadius = cutOut[4];\n  theShape = cutOut[5];\n  theAngle = getParamWithDefault(cutOut[7],0);\n  \n  zShift = invertZ ? -base_depth - zAdjustForCutFromInside : zAdjustForCutFromInside;\n  \n  //-- Output all of the current parameters\n  if (printMessages) echo(\"base_pos_H\",base_pos_H);\n  if (printMessages) echo(\"base_pos_V\",base_pos_V);\n  if (printMessages) echo(\"base_width\",base_width);\n  if (printMessages) echo(\"base_height\",base_height);\n  if (printMessages) echo(\"base_depth\",base_depth);\n  if (printMessages) echo(\"wallDepth\",wallDepth);\n\n  if (printMessages) echo (\"rot_X\", rot_X); \n  if (printMessages) echo (\"rot_Y\", rot_Y); \n  if (printMessages) echo (\"rot_Z\", rot_Z); \n  if (printMessages) echo (\"offset_x\", offset_x); \n  if (printMessages) echo (\"offset_y\", offset_y); \n  if (printMessages) echo (\"offset_z\", offset_z); \n  if (printMessages) echo (\"pos_X\", pos_X); \n  if (printMessages) echo (\"pos_Y\", pos_Y); \n  if (printMessages) echo (\"base_depth\", base_depth); \n  if (printMessages) echo (\"base_angle\", base_angle);\n  if (printMessages) echo (\"invertZ\", invertZ); \n  if (printMessages) echo (\"zShift\", zShift); \n  \n  thePolygon = getVector(yappPolygonDef, cutOut);\n  if (printMessages) echo(\"Polygon Definition\", thePolygon=thePolygon);\n\n  translate([offset_x, offset_y, offset_z]) \n  {\n    rotate([rot_X, rot_Y, rot_Z])\n    {\n      translate([pos_X, pos_Y, wallDepth + zShift - 0.02]) \n      {\n        if (printMessages) echo(\"Drawing cutout shape\");\n        // Draw the shape\n          color(\"Fuchsia\")\n            generateShape (theShape,(isTrue(yappCenter, cutOut)), base_width, base_height, base_depth + 0.04, theRadius, theAngle, thePolygon);\n      } //translate\n    }// rotate\n  } //translate\n  \n  if (printMessages) echo (\"------------------------------\");\n    \n} //-- processCutoutList_Shape()\n\n\n//===========================================================\n// Process the list passeed in\nmodule processCutoutList_Face(face, cutoutList, casePart, swapXY, swapWH, invertZ, rot_X, rot_Y, rot_Z, offset_x, offset_y, offset_z, wallDepth)\n{\n  for ( cutOut = cutoutList )\n  {\n    //-- Get the desired coordinate system    \n    theCoordSystem = getCoordSystem(cutOut, yappCoordPCB);   \n   \n    theX = translate2Box_X (cutOut[0], face, theCoordSystem);\n    theY = translate2Box_Y (cutOut[1], face, theCoordSystem);\n    theWidth = cutOut[2];\n    theLength = cutOut[3];\n    theRadius = cutOut[4];\n    theShape = cutOut[5];\n    theDepth = getParamWithDefault(cutOut[6],0);\n    theAngle = getParamWithDefault(cutOut[7],0);\n\n    useCenterCoordinates = isTrue(yappCenter, cutOut);\n    \n    if (printMessages) echo(\"useCenterCoordinates\", useCenterCoordinates);\n    if (printMessages) echo(\"processCutoutList_Face\", cutOut);\n\n    //-- Calc H&W if only Radius is given\n    tempWidth = (theShape == yappCircle) ?theRadius*2 : theWidth;\n    tempLength = (theShape == yappCircle) ? theRadius*2 : theLength;\n    \n    base_width  = (swapWH) ? tempLength : tempWidth;\n    base_height = (swapWH) ? tempWidth : tempLength;\n    \n    base_pos_H  = ((!swapXY) ? theY : theX);\n    base_pos_V  = ((!swapXY) ? theX : theY);\n  \n\t\t\n    //-- Add 0.04 to the depth - we will shift by 0.02 later to center it on the wall\n    base_depth  = (theDepth == 0) ? wallDepth + 0.04 : abs(theDepth) + 0.04;\n    base_angle  = theAngle;\n\n\t\t//--Check for negative depth\n\t\tzAdjustForCutFromInside = !isTrue(yappFromInside, cutOut) ? 0 : wallDepth - base_depth;\n\n    if (printMessages) echo (\"---Box---\");\n    pos_X = base_pos_H;\n    pos_Y = base_pos_V;\n    \n\t\tprocessCutoutList_Mask(cutOut, rot_X, rot_Y, rot_Z, offset_x, offset_y, offset_z, wallDepth, base_pos_H, base_pos_V, base_width, base_height, base_depth, base_angle, pos_X, pos_Y, invertZ, zAdjustForCutFromInside);\n\t\t\n  } //for ( cutOut = cutoutList )\n} //-- processCutoutList_Face()\n\n\n//===========================================================\n// Process the list passeed in\nmodule processRidgeExtList_Face(face, ridgeExtList, casePart, swapXY, swapWH, invertZ, rot_X, rot_Y, rot_Z, offset_x, offset_y, offset_z, wallDepth, subtract)\n{\n  for ( ridgeExt = ridgeExtList )\n  {\n    //-- Calculate based on the Coordinate system (test for Box override) thus defaulting to PCB\n    theCoordSystem = getCoordSystem(ridgeExt, yappCoordPCB);\n    thePCBName = getPCBName(yappPCBName, ridgeExt);\n\n    useCenterCoordinates = isTrue(yappCenter, ridgeExt); \n    \n    //-- Convert x pos if needed\n    theX = translate2Box_X (ridgeExt[0], face, theCoordSystem);  \n    theY =  baseWallHeight+basePlaneThickness;// RidgePos\n    theWidth = ridgeExt[1];\n    theLength = translate2Box_Y (ridgeExt[2], face, theCoordSystem); //ridgeExt[2];\n    \n    originLLOpt = isTrue(yappAltOrigin, ridgeExt);\n    \n    //-- Calc H&W if only Radius is given\n    //-- add slack for the part connected to the lid\n    tempWidth = (subtract) ? theWidth : theWidth - ridgeSlack*2;\n    \n    //-- Shift so that 0 aligns with the original seam\n    tempLength = theY - theLength;\n    \n    base_width  = (swapWH) ? tempLength : tempWidth;\n    base_height = (swapWH) ? tempWidth : tempLength;\n    \n    base_pos_H  = ((!swapXY) ? theY : theX);\n    base_pos_V  = ((!swapXY) ? theX : theY);\n\n    base_depth  = wallDepth;\n    base_angle  = 0;\n\n    //-- Only adjust the H Pos for centering\n    pos_X = base_pos_H;\n    pos_Y = (useCenterCoordinates) ? base_pos_V - (base_height/2) : base_pos_V + ((subtract) ? 0 : ridgeSlack);\n\n    adjustedHeight = (base_width > 0) ? base_width : base_width-ridgeHeight;\n    \n    processRidgeExtList(subtract, ridgeExt, casePart, rot_X, rot_Y, rot_Z, offset_x, offset_y, offset_z, wallDepth, base_pos_H, base_pos_V, adjustedHeight, base_height, base_depth, base_angle, pos_X, pos_Y, invertZ);\n  } //for ( ridgeExt = ridgeExtList )\n} //-- processRidgeExtList_Face()\n\n\n//===========================================================\n//-- Process the list passeed in\nmodule processRidgeExtList(subtract, ridgeExt, casePart, rot_X, rot_Y, rot_Z, offset_x, offset_y, offset_z, wallDepth,base_pos_H, base_pos_V, base_width, base_height, base_depth, base_angle, pos_X, pos_Y, invertZ)\n{\n  apply = \n          ((base_width >= 0) && (casePart == yappPartLid) && ( subtract)) ? false :\n          ((base_width >= 0) && (casePart == yappPartLid) && (!subtract)) ? true :\n          ((base_width >= 0) && (casePart != yappPartLid) && ( subtract)) ? true :\n          ((base_width >= 0) && (casePart != yappPartLid) && (!subtract)) ? false :\n          ((base_width <  0) && (casePart == yappPartLid) && ( subtract)) ? true :\n          ((base_width <  0) && (casePart == yappPartLid) && (!subtract)) ? false :\n          ((base_width <  0) && (casePart != yappPartLid) && ( subtract)) ? false :\n          ((base_width <  0) && (casePart != yappPartLid) && (!subtract)) ? true : undef;\n    \n  if (apply && (base_width!=0))\n  {\n    drawWidth = (base_width >= 0) ? base_width : -base_width;\n    drawOffset = (base_width >= 0) ? -base_width : -ridgeHeight;\n    \n    translate([offset_x, offset_y, offset_z]) \n    {\n      rotate([rot_X, rot_Y, rot_Z])\n      {\n        translate([pos_X, pos_Y, 0]) \n        {\n          color((subtract) \n          ? \"teal\" \n          : (casePart == yappPartLid) ? colorLid : colorBase,\n          (subtract) \n          ? 1\n          : (casePart == yappPartLid) ? alphaLid : alphaBase)\n            translate([drawOffset,0,((invertZ) ? wallDepth-base_depth : wallDepth) + ((subtract) ? -0.02 : 0)])\n              cube([drawWidth+0.02,base_height,base_depth + ((subtract) ? 0.04 : 0)]);  \n        } //translate\n      }// rotate\n    } //translate\n  } // apply\n  \n  \n  else if (base_width <  ridgeHeight) \n  {\n    //-- Special Case\n    drawWidth = (base_width > 0) \n      ? ridgeHeight-base_width        //-- Positive\n      : ridgeHeight+base_width;       //-- Negative\n    \n    drawOffset = (base_width > 0) \n      ? -ridgeHeight                  //-- Positive\n      : -ridgeHeight-base_width;      //-- Negative\n  \n    translate([offset_x, offset_y, offset_z]) \n    {\n      rotate([rot_X, rot_Y, rot_Z])\n      {\n        translate([pos_X, pos_Y, 0]) \n        {\n          color((subtract) \n          ? \"teal\" \n          : (casePart == yappPartLid) ? colorLid : colorBase,\n          (subtract) \n          ? 1\n          : (casePart == yappPartLid) ? alphaLid : alphaBase)\n            translate([drawOffset,0,((invertZ) ? wallDepth-base_depth : wallDepth) + ((subtract) ? -0.02 : 0)])\n              cube([drawWidth+0.02,base_height,base_depth + ((subtract) ? 0.04 : 0)]);  \n        } //translate\n      }// rotate\n    } //translate\n  }\n} //-- processRidgeExtList()\n\n\n//===========================================================\n// Process the list passeed in for the face\nmodule processFaceList(face, list, casePart, listType, subtract)\n{\n  assert(!is_undef(listType), \"processFaceList: listType must be passed in\");\n  assert(!is_undef(subtract), \"processFaceList: subtract must be passed in\");\n  \n    //\n    //      [0]pos_x->|\n    //                |\n    //  L  |          +-----------+  ^ \n    //  E  |          |           |  |\n    //  F  |          |<[2]length>|  [3]height\n    //  T  |          +-----------+  v   \n    //     |            ^\n    //     |            | [1]pos_y\n    //     |            v\n    //     |   +----------------------------- pcb(0,0)\n    //     |\n    //     +--------------------------------- box(0,0)\n\n  if (printMessages) echo (\"------------------------------\"); \n  if (printMessages) echo (\"processCutoutList started\"); \n\n  // Setup translations for the requested face\n  if (face == yappLeft) \n  { \n    if (printMessages) echo(str(\"Process \", listType, \" on Left Face\"));\n    rot_X = 90;      // Y\n    rot_Y = -90;     // X\n    rot_Z = 180;     // Z    \n    offset_x = 0;\n    offset_y = -wallThickness;\n    offset_z = (casePart==yappPartLid) ? -shellHeight : 0;\n    \n    wallDepth = wallThickness;\n    if (listType==\"cutout\") \n    {\n      processCutoutList_Face(face, list, casePart, false, true, false, rot_X, rot_Y, rot_Z, offset_x, offset_y, offset_z, wallDepth);\n    } //-- listType==\"cutout\"\n    else if (listType==\"ridgeExt\")\n    {\n      processRidgeExtList_Face(face, list, casePart, false, true, false, rot_X, rot_Y, rot_Z, offset_x, offset_y, offset_z, wallDepth, subtract);\n      \n    } //-- (listType==\"ridgeExt\") \n  }\n  else if (face == yappRight) \n  {  \n    if (printMessages) echo(str(\"Process \", listType, \" on Right Face\"));\n    rot_X = 90;      //-- Y\n    rot_Y = -90;     //-- X\n    rot_Z = 180;     //-- Z\n    offset_x = 0;\n    offset_y = shellWidth - (wallThickness);\n    offset_z = (casePart==yappPartLid) ? -shellHeight : 0;\n    wallDepth = wallThickness;\n    if (listType==\"cutout\") \n    {\n      processCutoutList_Face(face, list, casePart, false, true, true, rot_X, rot_Y, rot_Z, offset_x, offset_y, offset_z, wallDepth);\n    } // listType==\"cutout\"\n    else if (listType==\"ridgeExt\")\n    {\n      processRidgeExtList_Face(face, list, casePart, false, true, true, rot_X, rot_Y, rot_Z, offset_x, offset_y, offset_z, wallDepth, subtract);\n      \n    } // (listType==\"ridgeExt\") \n  }\n  else if (face == yappFront) \n  {\n    if (printMessages) echo(str(\"Process \", listType, \" on Front Face\"));\n    rot_X = 0;      //-- Y\n    rot_Y = -90;    //-- X\n    rot_Z = 0;      //-- Z\n    offset_x = shellLength + wallThickness;\n    offset_y = 0;\n    offset_z = (casePart==yappPartLid) ? -shellHeight : 0;\n    wallDepth = wallThickness;\n    if (listType==\"cutout\") \n    {\n      processCutoutList_Face(face, list, casePart, false, true, false, rot_X, rot_Y, rot_Z, offset_x, offset_y, offset_z, wallDepth);\n    } //-- listType==\"cutout\"\n    else if (listType==\"ridgeExt\")\n    {\n      processRidgeExtList_Face(face, list, casePart, false, true, false, rot_X, rot_Y, rot_Z, offset_x, offset_y, offset_z, wallDepth, subtract);\n      \n    } //-- (listType==\"ridgeExt\") \n  }\n  else if (face == yappBack) \n  {\n    if (printMessages) echo(str(\"Process \", listType, \" on Back Face\"));\n    rot_X = 0;      //-- Y\n    rot_Y = -90;    //-- X\n    rot_Z = 0;      ///-- Z\n    offset_x = wallThickness; \n    offset_y = 0;\n    offset_z = (casePart==yappPartLid) ? -shellHeight : 0;\n    wallDepth = wallThickness;\n    if (listType==\"cutout\") \n    {\n      processCutoutList_Face(face, list, casePart, false, true, true, rot_X, rot_Y, rot_Z, offset_x, offset_y, offset_z, wallDepth);\n    } //-- listType==\"cutout\"\n    else if (listType==\"ridgeExt\")\n    {\n      processRidgeExtList_Face(face, list, casePart, false, true, true, rot_X, rot_Y, rot_Z, offset_x, offset_y, offset_z, wallDepth, subtract);\n      \n    } //-- (listType==\"ridgeExt\") \n  }\n  else if (face == yappLid) \n  {\n    if (printMessages) echo(str(\"Process \", listType, \" on Lid Face\"));\n    rot_X = 0;\n    rot_Y = 0;\n    rot_Z = 0;\n    offset_x = 0;\n    offset_y = 0;\n    offset_z = -lidPlaneThickness;\n    wallDepth = lidPlaneThickness;\n    if (listType==\"cutout\") \n    {\n      processCutoutList_Face(face, list, casePart, true, false, true, rot_X, rot_Y, rot_Z, offset_x, offset_y, offset_z, wallDepth);\n    } //-- listType==\"cutout\"\n  }\n  else if (face == yappBase) \n  {\n    if (printMessages) echo(str(\"Process \", listType, \" on Base Face\"));\n    rot_X = 0;\n    rot_Y = 0;\n    rot_Z = 0;\n    offset_x = 0;\n    offset_y = 0;\n    offset_z = -basePlaneThickness;\n    wallDepth = basePlaneThickness;\n    if (listType==\"cutout\") \n    {\n      processCutoutList_Face(face, list, casePart, true, false, false, rot_X, rot_Y, rot_Z, offset_x, offset_y, offset_z, wallDepth);\n    } //-- listType==\"cutout\"\n  } \n} //-- processFaceList()\n\n\n//===========================================================\n//--\n//--        -->|             |<-- tubeLength and tubeWidth-->\n//--    --------             ----------------------------------------------------\n//--                                         # lidPlaneThickness             Leave .5mm is not yappThroughLid \n//--    ----+--+             +--+---------------------------------------      \n//--        |  |             |  |   ^                    \n//--        |  |             |  |   |\n//--        |  |             |  |   #Tube Height\n//--        |  |             |  |   |\n//--        |  |             |  |   |\n//--        |  |             |  |   |\n//--        |  |             |  |   v\n//--        +--+             +--+   \n//--\n//--       #tAbvPcb\n//--        \n//--   +------------------------------------ topPcb \n//--   |  # pcb_Thickness\n//--   +-+--+-------------------------------\n//--     |  | # standoff_Height\n//-- ----+  +-------------------------------------\n//--              # basePlaneThickness\n//-- ---------------------------------------------\n//-- \nmodule lightTubeCutout()\n{\n  for(tube=lightTubes)\n  {\n    if (printMessages) echo (\"Tube Def\",tube=tube);\n    //-- Get the desired coordinate system    \n    theCoordSystem = getCoordSystem(tube, yappCoordPCB);  \n  \n    standoff_Height = standoffHeight(theCoordSystem[2]);\n    pcb_Thickness = pcbThickness(theCoordSystem[2]);\n    \n    xPos = translate2Box_X (tube[0], yappLid, theCoordSystem);\n    yPos = translate2Box_Y (tube[1], yappLid, theCoordSystem);\n    \n    tLength         = tube[2];\n    tWidth          = tube[3];\n    tWall           = tube[4];\n    tAbvPcb         = tube[5];\n    shape           = tube[6];\n    lensThickness   = getParamWithDefault(tube[7],0);\n    toTopOfPCB      = getParamWithDefault(tube[8], standoff_Height+pcb_Thickness);\n\n    cutoutDepth = lidPlaneThickness-lensThickness;\n    \n    pcbTop2Lid = (baseWallHeight+lidWallHeight+lidPlaneThickness)-(toTopOfPCB+tAbvPcb);\n    \n    tmpArray = [[xPos, yPos, tWidth, tLength, tLength/2, shape, 0, 0, yappCoordBox, yappCenter]];\n   \n    if (printMessages) echo (\"Tube tempArray\",tmpArray);\n    translate([0,0,-lensThickness])\n    {\n      processFaceList(yappLid, tmpArray, yappPartLid, \"cutout\", true);\n    }\n  } //-- for tubes\n} //-- lightTubeCutout()\n\n\n//===========================================================\nmodule buildLightTubes()\n{\n  for(tube=lightTubes)\n  {\n    //-- Get the desired coordinate system    \n    theCoordSystem = getCoordSystem(tube, yappCoordPCB);    \n   \n    standoff_Height = standoffHeight(theCoordSystem[2]);\n    pcb_Thickness = pcbThickness(theCoordSystem[2]);\n    \n    xPos = translate2Box_X (tube[0], yappLid, theCoordSystem);\n    yPos = translate2Box_Y (tube[1], yappLid, theCoordSystem);\n\n    tLength       = tube[2];\n    tWidth        = tube[3];\n    tWall         = tube[4];\n    tAbvPcb       = tube[5];\n    tubeType      = tube[6];\n    lensThickness = getParamWithDefault(tube[7],0);\n    filletRad     = getParamWithDefault(tube[9],0);\n    toTopOfPCB    = getParamWithDefault(tube[8], standoff_Height+pcb_Thickness);\n    \n    pcbTop2Lid = (shellHeight) - (basePlaneThickness + lidPlaneThickness + toTopOfPCB + tAbvPcb);\n     \n    if (printMessages) echo(\"buildLightTubes\", tubeType=tubeType); \n    if (printMessages) echo (baseWallHeight=baseWallHeight, lidWallHeight=lidWallHeight, lidPlaneThickness=lidPlaneThickness, toTopOfPCB=toTopOfPCB, tAbvPcb=tAbvPcb);\n    if (printMessages) echo (pcbTop2Lid=pcbTop2Lid);\n    \n    translate([xPos, yPos, ((pcbTop2Lid)/-2)-lidPlaneThickness])\n    {\n      if (tubeType == yappCircle)\n      {\n        difference()\n        {\n          color(\"red\") \n            cylinder(h=pcbTop2Lid, d=max(tWidth,tLength)+(tWall*2), center=true);\n          \n          translate([0,0,-lensThickness - 0.02])\n            color(\"blue\") \n              cylinder(h=pcbTop2Lid + lidPlaneThickness +0.02, d=tWidth, center=true);\n        }\n        if (!isTrue(yappNoFillet, tube))\n        {\n          filletRadius = (filletRad==0) ? lidPlaneThickness : filletRad; \n          translate([0,0,(pcbTop2Lid/2)])\n          color(\"red\") pinFillet(-(tWidth+(tWall*2))/2, filletRadius);\n        } // ifFillet\n      }\n      else\n      {\n        difference()\n        {\n          color(\"red\") \n            cube([tWidth+(tWall*2), tLength+(tWall*2), pcbTop2Lid], center=true);\n          \n          translate([0,0,tWall*-1])\n            color(\"green\") \n              cube([tWidth, tLength, pcbTop2Lid], center=true);\n          translate([0,0, +lensThickness])\n            color(\"blue\") \n              cube([tWidth, tLength, pcbTop2Lid+lensThickness], center=true);\n        }\n        if ((!isTrue(yappNoFillet, tube)))\n        {\n          filletRadius = (filletRad==0) ? lidPlaneThickness : filletRad; \n          translate([0,0,(pcbTop2Lid/2)])\n          color(\"red\") rectangleFillet(tWidth+(tWall*2), tLength+(tWall*2),filletRadius, 1);\n        } // ifFillet\n      }\n    }\n  } //--for(..)\n  \n} //-- buildLightTubes()\n\n\n//===========================================================\n//-- Create the cut through the lid\nmodule buttonCutout()\n{\n  for(button=pushButtons)\n  {\n    // Get the desired coordinate system    \n    theCoordSystem = getCoordSystem(button, yappCoordPCB);    \n   \n    xPos = translate2Box_X (button[0], yappLid, theCoordSystem);\n    yPos = translate2Box_Y (button[1], yappLid, theCoordSystem);\n    cWidth    = button[2];    \n    cLength   = button[3];\n    cRadius   = button[4];    \n    shape     = getShapeWithDefault(button[10],yappRectangle);\n    angle     = getParamWithDefault(button[11],0);\n    buttonSlack = getParamWithDefault(button[15],buttonSlack); \n     \n    thePolygon = getVectorBase(yappPolygonDef, button);\n     \n    tmpArray = [[xPos, \n                  yPos, \n                  cWidth + buttonSlack*2, \n                  cLength + buttonSlack*2,\n                  cRadius + buttonSlack, \n                  shape, \n                  0, \n                  angle , \n                  yappCenter,\n                  yappCoordBox, // Coordinates are already translated to yappCoordBox\n                  thePolygon// Polygon\n                ]];\n     processFaceList(yappLid, tmpArray, yappPartLid, \"cutout\", true);\n  } //-- for buttons\n  \n} //-- buttonCutout()\n\n\n//===========================================================\n//-- Create the cavity for the button\nmodule buildButtons(preCuts)\n{\n  if (printMessages) echo(\"buildButtons(): process \", len(pushButtons),\" buttons\");\n\n  // Use an index so we can offset the buttons outside the shell\n  if(len(pushButtons) > 0)\n  {\n    for(i=[0:len(pushButtons)-1])  \n    {\n      button=pushButtons[i];\n\n      // Get the desired coordinate system    \n      theCoordSystem = getCoordSystem(button, yappCoordPCB);    \n      standoff_Height=standoffHeight(theCoordSystem[2]);\n      pcb_Thickness=pcbThickness(theCoordSystem[2]);      \n      \n      // Get all of the parameters\n      xPos = translate2Box_X (button[0], yappLid, theCoordSystem);\n      yPos = translate2Box_Y (button[1], yappLid, theCoordSystem);\n           \n      cLength     = button[2];\n      cWidth      = button[3];\n      cRadius     = button[4];  // New\n      aboveLid    = button[5];\n      swHeight    = button[6];\n      swTravel    = max(button[7],0.5);\n      pDiam       = button[8];\n      toTopOfPCB  = getParamWithDefault(button[9], (standoff_Height+pcb_Thickness));\n      shape       = getShapeWithDefault(button[10],yappRectangle);\n      angle       = getParamWithDefault(button[11],0);\n      filletRad   = getParamWithDefault(button[12],0);\n      \n      // Enable overriding the defaults\n      thebuttonWall = getParamWithDefault(button[13],buttonWall);\n      thebuttonPlateThickness = getParamWithDefault(button[14],buttonPlateThickness);\n      thebuttonSlack = getParamWithDefault(button[15],buttonSlack);\n      theSnapSlack = getParamWithDefault(button[16],0.05);\n      thePolygon = getVector(yappPolygonDef, button); \n\n              //\n              //        -->|             |<-- LxW or Diameter\n              //\n              //            +-----------+                                                     -----    \n              //    -------+|           |+------------------------------------------    -----   ^\n              //           ||           ||               # lidPlaneThickness              ^     Button Thickness\n              //    ----+  ||           ||  +---------------------------------------      |     v\n              //        |  |+---+   +---+|  |   ^                    ^                    |   -----\n              //        |  |    |   |    |  |   |-- buttonCupDepth   |                    |\n              //        |  |    |   |    |  |   v                    |                    |\n              //        |  |    |   |    |  |   ^                    |-- cupDepth         |\n              //        |  |    |   |    |  |   |-- switchTravel     |                    |\n              //        |  |    |   |    |  |   v                    v                    |\n              //        |  +---+|   |+---+  |  ---                  ---                   |\n              //        |      ||   ||      |                                             |\n              //        +---+  ||   ||  +---+                          poleHolderLength --|\n              //            |  ||   ||  |                                                 |\n              //            |  ||   ||  |  >--<-- buttonWall                              v\n              //            +--+|   |+--+                                         -----------\n              //                |   |\n              //                +---+\n              //         -->|  |<-- buttonWall\n              //            -->|     |<-- poleDiam\n              //        \n              //   +------------------------------------ topPcb \n              //   +-+--+-------------------------------\n              //     |  | # standoffHeight\n              //-----+  +-------------------------------------\n              //              # basePlaneThickness\n              //---------------------------------------------\n      buttonCapNetThickness = 0.5;        \n      pcbTop2Lid        = (baseWallHeight+lidWallHeight)-(toTopOfPCB);\n      \n      buttonTopOffset     = ((aboveLid > 0) ? aboveLid : 0);\n      cupExtraDepth       = ((aboveLid < 0) ? -aboveLid : 0);\n      buttonTopThickness  = lidPlaneThickness + buttonTopOffset;\n\n      buttonCupDepth      = cupExtraDepth + swTravel + thebuttonSlack*2;\n\n      buttonTop2Lid       = pcbTop2Lid-swHeight;\n      \n      holderLength        = \n        buttonTop2Lid \n        - buttonCupDepth \n        - thebuttonWall \n        - thebuttonPlateThickness \n        - thebuttonSlack\n        ;\n      \n     // check if there is enough room for the button\n      assert(holderLength>=0, str(\"Processing pushButtons[\", i, \"] Not enough space to add button number \", i, \" increase case height above the PCB by \", -holderLength));\n      \n      // Create the Holder on the lid\n      if (preCuts)\n      {\n     //   color(\"blue\") \n        translate([xPos, yPos, -lidPlaneThickness])\n        {\n          difference()\n          {\n            union()\n            {\n              // Outside of CUP\n              // Other shapes don't get a base fillet (for now)\n              //module generateShape (Shape, useCenter, Width, Length, Thickness, Radius, Rotation, Polygon)\n              translate([0, 0, -(buttonCupDepth + thebuttonWall)])\n              {\n                filletRadius = (filletRad==0) ? lidPlaneThickness : filletRad; \n                color(\"green\")\n                if (!isTrue(yappNoFillet, button))\n                {\n                  generateShapeFillet (shape, true, cLength, cWidth, buttonCupDepth + thebuttonWall, filletRadius, 0, cRadius, angle, thePolygon, thebuttonWall);\n                }\n                else\n                {\n                  generateShape (shape, true, cLength, cWidth, buttonCupDepth + thebuttonWall, cRadius, angle, thePolygon, thebuttonWall);\n                } // fillet\n\n              } //translate\n              \n              //-------- outside pole holder -- Always a cylinder\n              translate([0, 0,  -thebuttonWall-buttonCupDepth-holderLength+0.01])\n              {\n                union()\n                {\n                  color(\"gray\") cylinder(h=holderLength+0.02, d=pDiam+thebuttonSlack+thebuttonWall);\n                  if (!isTrue(yappNoFillet, button))\n                  {\n                    filletRadius = (filletRad==0) ? lidPlaneThickness : filletRad;\n                    // Limit the fillet to the height of the pole or the width of the shelf \n                    maxFillet = min(holderLength, filletRadius);                   \n                    translate([0, 0, holderLength])\n                    color(\"violet\") pinFillet(-(pDiam+thebuttonSlack+thebuttonWall)/2,maxFillet);\n                  } // ifFillet\n                } // union\n              } // translate\n            } //-- union()\n            \n            // Hollow out the inside\n            \n            //-------- inside Cap \n            translate([0, 0, -(buttonCupDepth-0.02)])\n            {\n              color(\"blue\")                       \n                generateShape (shape, true, cLength+thebuttonSlack*2, cWidth+thebuttonSlack*2, buttonCupDepth+ 0.02, (cRadius+thebuttonSlack), angle, thePolygon);\n            }\n\n            //-- inside pole holder - extenderPole geleider --\n            translate([0, 0,  -(holderLength/2) - buttonCupDepth -(thebuttonWall/2) + 0.01]) \n            {\n              color(\"orange\") \n                cylinder(h=holderLength+thebuttonWall+0.04, d=pDiam+thebuttonSlack*2, center=true);\n            }\n          } // difference()\n        } //-- translate()\n      } \n      else // Post Cuts\n      {\n        // Create the button extension\n        if (printSwitchExtenders)  // only add to render if they are turned on\n        {\n          // possible location of the SwitchExtender and plate\n          // In lid (true)\n          //    If preview and lidOnBox\n          // In row next to lid (false)\n          //    anything else\n          externderPos = ($preview) ? (showSideBySide) ? false : true : false; \n           \n//          extHeight = buttonTop2Lid + lidPlaneThickness - thebuttonPlateThickness -buttonCapNetThickness -((aboveLid < 0) ? -aboveLid : 0);\n          extHeight = buttonTop2Lid -buttonCapNetThickness -cupExtraDepth;\n          \n          xOff = max(cLength, cWidth);\n          \n          // Determine where to show them for Lid on case or off\n          extPosX = (externderPos) ? xPos : -40 ;\n          extPosY = (externderPos) ? yPos : shellWidth*2 - (i* 20);\n          extPosZ = (externderPos) ? aboveLid - (showButtonsDepressed ? swTravel :0) : 0 ;\n          extRot  = (externderPos) ? angle : 0 ;\n\n          platePosX = (externderPos) ? xPos : -20 ;\n          platePosY = (externderPos) ? yPos : shellWidth*2 - (i* 20);\n          platePosZ = (externderPos) ? \n          + thebuttonPlateThickness/2 - lidPlaneThickness - buttonTop2Lid  - (showButtonsDepressed ? swTravel :0)\n          : -thebuttonPlateThickness/2;\n          \n          plateRot  = (externderPos) ? 180 : 0 ;\n          \n          color(\"red\")\n          translate ([extPosX,extPosY,extPosZ]) \n          {\n            rotate ([0,0,extRot])\n            {\n              makeSwitchExtender(shape, cLength-thebuttonSlack, cWidth-thebuttonSlack, cRadius, buttonTopThickness, pDiam, extHeight, aboveLid, thePolygon, thebuttonSlack);\n            }\n          } // translate extender\n          color(\"green\")\n          translate ([platePosX,platePosY,platePosZ]) \n          {\n            rotate ([plateRot,0,0])\n            {\n              makeSwitchPlate(pDiam, thebuttonPlateThickness, thebuttonSlack, theSnapSlack);\n            } \n          } // translate plate\n        } // printSwitchExtenders\n      } // Post Cuts\n    } //-- for buttons ..\n  } //-- len(pushButtons) > 0\n} //-- buildButtons()\n\n\n//===========================================================\nmodule drawLabels(casePart, subtract)\n{\n\tfunction textDirection(code) = \n\t\t(code == yappTextRightToLeft) ? \"rtl\" :\n\t\t(code == yappTextTopToBottom) ? \"ttb\" :\n\t\t(code == yappTextBottomToTop) ? \"btt\" :\n\t\t\"ltr\";\n\t\t\n\tfunction textHalign(code) = \n\t\t(code == yappTextHAlignCenter) ? \"center\" :\n\t\t(code == yappTextHAlignRight) ? \"right\" :\n\t\t\"left\";\n\t\t\n\tfunction textValign(code) = \n\t\t(code == yappTextVAlignTop) ? \"top\" :\n\t\t(code == yappTextVAlignCenter) ? \"center\" :\n\t\t(code == yappTextVAlignBaseLine) ? \"baseline\" :\n\t\t\"bottom\";\n\t\t\n\n  for ( label = labelsPlane )\n  {    \n    // If we are adding to the lid  we need to shift it because we are drawing before the lid is positioned\n    shiftX = (!subtract) ? -shellLength/2 : 0 ;\n    shiftY = (!subtract) ? -shellWidth/2 : 0 ;\n        \n    shiftZ = (!subtract) \n      ? (casePart== yappPartLid) \n        ? (lidWallHeight + lidPlaneThickness) \n        : -baseWallHeight - basePlaneThickness\n      : 0 ;\n        \n    //-- Optional:\n    expandBy = getParamWithDefault(label[8],0);\n\n\t\t//-- Add additional text properties\n    theDirection = getYappValueWithDefault(label[9], yappTextLeftToRight);\n    theHalign = getYappValueWithDefault(label[10], yappTextHAlignLeft);\n    theValign = getYappValueWithDefault(label[11], yappTextVAlignBottom);\n    theSpacing = getParamWithDefault(label[12], 1);\n\n\t\tcolor(\"red\")\n    translate([shiftX, shiftY, shiftZ])\n    {\n    //-- Check if the label is valid for the for subtract value \n    if (((label[3] > 0) && subtract) || ((label[3] < 0) && !subtract))\n    {\n      theDepth = (subtract) ? label[3] : -label[3];\n        \n      if ((casePart== yappPartLid) && (label[4]==yappLid))\n      {\n        if (printMessages) echo (\"Draw text on Lid (top)\");\n        offset_depth = (subtract) ?  0.01 : theDepth -0.01;\n        \n        translate([label[0], label[1], offset_depth - theDepth]) \n        {\n          rotate([0,0,label[2]])\n          { \n            linear_extrude(theDepth) \n            {\n              offset(r=expandBy)\n              text(label[7]\n                    , font=label[5]\n                    , size=label[6]\n                    , direction=textDirection(theDirection)\n                    , halign=textHalign(theHalign)\n                    , valign=textValign(theValign)\n\t\t\t\t\t\t\t\t\t\t, spacing=theSpacing);\n            } // rotate\n          } // extrude\n        } // translate\n      } //  if lid/lid\n      \n      if ((casePart== yappPartBase) && (label[4]==yappBase))\n      {\n        if (printMessages) echo (\"Draw text on Base (bottom)\");\n        offset_depth = (subtract) ?  -0.01 : -theDepth + 0.01;\n        \n        translate([label[0], shellWidth-label[1], offset_depth]) \n        {\n          rotate([0,0,180-label[2]])\n          {\n            mirror([1,0,0]) \n            linear_extrude(theDepth) \n            {\n              {\n                offset(r=expandBy)\n                text(label[7]\n                      , font=label[5]\n                      , size=label[6]\n\t\t\t\t\t\t\t\t\t\t\t, direction=textDirection(theDirection)\n\t\t\t\t\t\t\t\t\t\t\t, halign=textHalign(theHalign)\n\t\t\t\t\t\t\t\t\t\t\t, valign=textValign(theValign)\n\t\t\t\t\t\t\t\t\t\t\t, spacing=theSpacing);\n              } // mirror..\n            } // rotate\n          } // extrude\n        } // translate\n      } //  if base/base\n\n      if (label[4]==yappFront)\n      {\n        if (printMessages) echo (\"Draw text on Front\");\n        offset_v = (casePart==yappPartLid) ? -shellHeight : 0;\n        offset_depth = (subtract) ?  0.01 : theDepth - 0.01;\n\n        translate([shellLength - theDepth + offset_depth, label[0], offset_v + label[1]]) \n        {\n          rotate([90,0-label[2],90])\n          {\n            linear_extrude(theDepth) \n            {\n              offset(r=expandBy)\n              text(label[7]\n                      , font=label[5]\n                      , size=label[6]\n\t\t\t\t\t\t\t\t\t\t\t, direction=textDirection(theDirection)\n\t\t\t\t\t\t\t\t\t\t\t, halign=textHalign(theHalign)\n\t\t\t\t\t\t\t\t\t\t\t, valign=textValign(theValign)\n\t\t\t\t\t\t\t\t\t\t\t, spacing=theSpacing);\n            } // extrude\n          } // rotate\n        } // translate\n      } //  if base/front\n      if (label[4]==yappBack)\n      {\n        if (printMessages) echo (\"Draw text on Back\", casePart);\n        offset_v = (casePart==yappPartLid) ? -shellHeight : 0;\n        offset_depth = (subtract) ?  -0.01 : -theDepth + 0.01;\n\n        translate([offset_depth, shellWidth-label[0], offset_v + label[1]]) \n        {\n          rotate([90,0+label[2],90])\n          mirror([1,0,0])\n          {\n            linear_extrude(theDepth) \n            {\n              offset(r=expandBy)\n              text(label[7]\n                      , font=label[5]\n                      , size=label[6]\n\t\t\t\t\t\t\t\t\t\t\t, direction=textDirection(theDirection)\n\t\t\t\t\t\t\t\t\t\t\t, halign=textHalign(theHalign)\n\t\t\t\t\t\t\t\t\t\t\t, valign=textValign(theValign)\n\t\t\t\t\t\t\t\t\t\t\t, spacing=theSpacing);\n            } // extrude\n          } // rotate\n        } // translate\n      } //  if base/back\n      \n      if (label[4]==yappLeft)\n      {\n        if (printMessages) echo (\"Draw text on Left\", casePart);\n        offset_v = (casePart==yappPartLid) ? -shellHeight : 0;\n        offset_depth = (subtract) ?  -0.01 : -theDepth + 0.01;\n        translate([label[0], theDepth+offset_depth, offset_v + label[1]]) \n        {\n          rotate([90,-label[2],0])\n          {\n            linear_extrude(theDepth) \n            {\n              offset(r=expandBy)\n              text(label[7]\n                    , font=label[5]\n                    , size=label[6]\n\t\t\t\t\t\t\t\t\t\t, direction=textDirection(theDirection)\n\t\t\t\t\t\t\t\t\t\t, halign=textHalign(theHalign)\n\t\t\t\t\t\t\t\t\t\t, valign=textValign(theValign)\n\t\t\t\t\t\t\t\t\t\t, spacing=theSpacing);\n            } // extrude\n          } // rotate\n        } // translate\n      } //  if..base/left\n      \n      if (label[4]==yappRight)\n      {\n        if (printMessages) echo (\"Draw text on Right\");\n        offset_v = (casePart==yappPartLid) ? -shellHeight : 0;\n        offset_depth = (subtract) ?  0.01 : theDepth - 0.01;\n        // Not sure why this is off by 1.5!!!\n        translate([shellLength-label[0], shellWidth + offset_depth, -1.5 + offset_v + label[1]]) \n        {\n          rotate([90,label[2],0])\n          {\n            mirror([1,0,0])\n            linear_extrude(theDepth) \n            {\n              offset(r=expandBy)\n              text(label[7]\n                    , font=label[5]\n                    , size=label[6]\n\t\t\t\t\t\t\t\t\t\t, direction=textDirection(theDirection)\n\t\t\t\t\t\t\t\t\t\t, halign=textHalign(theHalign)\n\t\t\t\t\t\t\t\t\t\t, valign=textValign(theValign)\n\t\t\t\t\t\t\t\t\t\t, spacing=theSpacing);\n            } // extrude\n          } // rotate\n        } // translate\n      } //  if..base/right\n    } // Valid check\n    } // Translate\n  } // for labels\n  \n} //-- drawLabels()\n\n\n//===========================================================\nmodule drawImages(casePart, subtract)\n{\n  for ( image = imagesPlane )\n  {\n    // If we are adding to the lid  we need to shift it because we are drawing before the lid is positioned\n    shiftX = (!subtract) ? -shellLength/2 : 0 ;\n    shiftY = (!subtract) ? -shellWidth/2 : 0 ;\n\n    shiftZ = (!subtract)\n      ? (casePart== yappPartLid)\n        ? (lidWallHeight + lidPlaneThickness)\n        : -baseWallHeight - basePlaneThickness\n      : 0 ;\n\n\n    //   Optional:\n    scaleBy = getParamWithDefault(image[6],1.0);\n\n\n\n    translate([shiftX, shiftY, shiftZ])\n    {\n    // Check if the image is valid for the for subtract value\n    if (((image[3] > 0) && subtract) || ((image[3] < 0) && !subtract))\n    {\n      theDepth = (subtract) ? image[3] : -image[3];\n\n      if ((casePart== yappPartLid) && (image[4]==yappLid))\n      {\n        if (printMessages) echo (\"Draw image on Lid (top)\");\n        offset_depth = (subtract) ?  0.01 : theDepth -0.01;\n\n        translate([image[0], image[1], offset_depth - theDepth])\n        {\n          rotate([0,0,image[2]])\n          {\n            linear_extrude(theDepth)\n            {\n              scale(scaleBy)\n              import(file = image[5], center = true);\n            } // rotate\n          } // extrude\n        } // translate\n      } //  if lid/lid\n\n      if ((casePart== yappPartBase) && (image[4]==yappBase))\n      {\n        if (printMessages) echo (\"Draw image on Base (bottom)\");\n        offset_depth = (subtract) ?  -0.01 : -theDepth + 0.01;\n\n        translate([image[0], shellWidth-image[1], offset_depth])\n        {\n          rotate([0,0,180-image[2]])\n          {\n            mirror([1,0,0]) color(\"red\")\n            linear_extrude(theDepth)\n            {\n              {\n                scale(scaleBy)\n                import(file = image[5], center = true);\n              } // mirror..\n            } // rotate\n          } // extrude\n        } // translate\n      } //  if base/base\n\n      if (image[4]==yappFront)\n      {\n        if (printMessages) echo (\"Draw image on Front\");\n        offset_v = (casePart==yappPartLid) ? -shellHeight : 0;\n        offset_depth = (subtract) ?  0.01 : theDepth - 0.01;\n\n        translate([shellLength - theDepth + offset_depth, image[0], offset_v + image[1]])\n        {\n          rotate([90,0-image[2],90])\n          {\n            linear_extrude(theDepth)\n            {\n              scale(scaleBy)\n              import(file = image[5], center = true);\n            } // extrude\n          } // rotate\n        } // translate\n      } //  if base/front\n      if (image[4]==yappBack)\n      {\n        if (printMessages) echo (\"Draw image on Back\", casePart);\n        offset_v = (casePart==yappPartLid) ? -shellHeight : 0;\n        offset_depth = (subtract) ?  -0.01 : -theDepth + 0.01;\n\n        translate([offset_depth, shellWidth-image[0], offset_v + image[1]])\n        {\n          rotate([90,0+image[2],90])\n          mirror([1,0,0])\n          {\n            linear_extrude(theDepth)\n            {\n              scale(scaleBy)\n              import(file = image[5], center = true);\n            } // extrude\n          } // rotate\n        } // translate\n      } //  if base/back\n\n      if (image[4]==yappLeft)\n      {\n        if (printMessages) echo (\"Draw image on Left\", casePart);\n        offset_v = (casePart==yappPartLid) ? -shellHeight : 0;\n        offset_depth = (subtract) ?  -0.01 : -theDepth + 0.01;\n        translate([image[0], theDepth+offset_depth, offset_v + image[1]])\n        {\n          rotate([90,-image[2],0])\n          {\n            linear_extrude(theDepth)\n            {\n              scale(scaleBy)\n              import(file = image[5], center = true);\n            } // extrude\n          } // rotate\n        } // translate\n      } //  if..base/left\n\n      if (image[4]==yappRight)\n      {\n        if (printMessages) echo (\"Draw image on Right\");\n        offset_v = (casePart==yappPartLid) ? -shellHeight : 0;\n        offset_depth = (subtract) ?  0.01 : theDepth - 0.01;\n        // Not sure why this is off by 1.5!!!\n        translate([shellLength-image[0], shellWidth + offset_depth, -1.5 + offset_v + image[1]])\n        {\n          rotate([90,image[2],0])\n          {\n            mirror([1,0,0])\n            linear_extrude(theDepth)\n            {\n              scale(scaleBy)\n              import(file = image[5], center = true);\n            } // extrude\n          } // rotate\n        } // translate\n      } //  if..base/right\n    } // Valid check\n    } // Translate\n  } // for images\n\n} //  drawImages()\n\n\n//===========================================================\nmodule baseShell()\n{\n    //-------------------------------------------------------------------\n    module subtrbaseRidge(L, W, H, posZ, rad)\n    {\n      wall = (wallThickness/2)+(ridgeSlack/2);  // 26-02-2022\n      \n      oRad = rad;\n      iRad = getMinRad(oRad, wallThickness);\n      cRad = (rad + iRad)/2;\n      bRad = (rad + (wallThickness/2)) /2;\n      \n      difference()\n      {\n        translate([0,0,posZ])\n        {\n          //-- The outside doesn't need to be a minkowski form so just use a cube\n          translate([-L ,-W, 0]) {\n            cube([L*2, W*2, shellHeight]);\n          }\n        }\n        \n        //-- hollow inside\n        translate([0, 0, posZ])\n        {\n          linear_extrude(shellHeight+1)\n          {\n            if (shellEdgeVert == yappEdgeRounded)\n            { \n              //-- Changed to RoundedRectangle \n              roundedRectangle2D(width=L-ridgeSlack,length=W-ridgeSlack,radius=cRad-(ridgeSlack/4));\n            }\n            else if (shellEdgeVert == yappEdgeSquare)\n            { \n              square([(L-ridgeSlack), (W-ridgeSlack)], center=true);\n            }\n            else if (shellEdgeVert == yappEdgeChamfered)\n            { \n            chamferedRectangle2D((L-ridgeSlack), (W-ridgeSlack), bRad - (ridgeSlack/4));\n            }\n            else \n            {\n              assert(false, \"Unsupported edge combination\");\n            } \n          } // linear_extrude..\n        } // translate()\n      } // diff\n    } //-- subtrbaseRidge()\n\n//-------------------------------------------------------------------\n   \n  posZ00 = (baseWallHeight) + basePlaneThickness;\n  \n  translate([(shellLength/2), shellWidth/2, posZ00])\n  {\n    difference()  //(b) Remove the yappPartLid from the base\n    {\n      union()\n      {\n        //-- Create the shell and add the Mounts and Hooks\n        minkowskiBox(yappPartBase, shellInsideLength, shellInsideWidth, baseWallHeight, roundRadius, basePlaneThickness, wallThickness, true);\n        \n        \n        if ($preview) \n        {\n          translate([-shellLength/2, -shellWidth/2, -baseWallHeight-basePlaneThickness])    \n          drawCenterMarkers();\n        }\n      } // union\n      if ($preview && showSideBySide==false && hideBaseWalls)\n      {\n        //--- wall's\n        translate([0,0,shellHeight/2])\n        {\n          color(colorBase, alphaBase)\n          cube([shellLength*2, shellWidth*2, \n                shellHeight+((baseWallHeight*2)-(basePlaneThickness+roundRadius))], \n                center=true);\n        } // translate\n      } // hideBaseWalls=true\n      else  //-- normal\n      {\n        color(colorBase, alphaBase)\n        union()\n        {\n          //--- only cutoff upper half\n          translate([0,0,shellHeight/2])\n          {\n            cube([shellLength*2, shellWidth*2, shellHeight], center=true);\n          } // translate\n          \n          //-- Create ridge\n          subtrbaseRidge(shellInsideLength+wallThickness, \n                          shellInsideWidth+wallThickness, \n                          ridgeHeight, \n                          (ridgeHeight*-1), roundRadius);\n        } //union\n      } // hideBaseWalls=false\n    } // difference(b)  \n  } // translate\n  \n  //-- Draw the objects that connect to the Base\n  pcbHolders();\n  printSnapJoins(yappPartBase);\n\n  //--Only generate the cut box if we have connectors to add\n  if (len(connectors) >0)\n  {\n    intersection()\n    {  \n      iRad = getMinRad(roundRadius, wallThickness);\n      cRad = (roundRadius + iRad)/2;\n      \n      translate([shellLength/2, shellWidth/2, posZ00])\n      minkowskiCutBox(shellInsideLength-ridgeSlack, shellInsideWidth-ridgeSlack, baseWallHeight, cRad, lidPlaneThickness, wallThickness);\n      \n      shellConnectors(yappPartBase, false);\n    } //intersection()\n  }// have connectors\n  makeRidgeExt(yappPartBase, false);\n} //-- baseShell()\n\n\n//===========================================================\nmodule lidShell()\n{\n  //--Added configurable gap\n  function newRidge(p1) = (p1>ridgeGap) ? p1-ridgeGap : p1;\n  //-------------------------------------------------------------------\n  module removeLidRidge(L, W, H, rad)\n  {\n    wall = (wallThickness/2);\n    oRad = rad;\n    iRad = getMinRad(oRad, wall);\n     \n    iRad2 = getMinRad(oRad, wallThickness);\n    cRad = (rad + iRad2)/2;      \n    bRad = (rad + (wallThickness/2)) /2;\n    \n    //-- hollow inside\n    translate([0,0,-H-shellHeight])\n    {\n      linear_extrude(H+shellHeight)\n      {\n        if (shellEdgeVert == yappEdgeRounded)\n        { \n            //-- Changed to RoundedRectangle \n            roundedRectangle2D(width=L+ridgeSlack,length=W+ridgeSlack,radius=cRad+(ridgeSlack/4));\n        }\n        else if (shellEdgeVert == yappEdgeSquare)\n        { \n          square([(L+ridgeSlack), (W+ridgeSlack)], center=true);\n        }\n        else if (shellEdgeVert == yappEdgeChamfered)\n        { \n          chamferedRectangle2D((L+ridgeSlack), (W+ridgeSlack), bRad + (ridgeSlack/4));\n        }\n        else \n        {\n          assert(false, \"Unsupported edge combination\");\n        } \n      } // linear_extrude\n    } //  translate  \n  } //-- removeLidRidge()\n \n  //-------------------------------------------------------------------\n\n  posZ00 = lidWallHeight+lidPlaneThickness;    \n  translate([(shellLength/2), shellWidth/2, posZ00*-1])\n  {\n    difference() //d1\n    {\n      union()\n      {\n        minkowskiBox(yappPartLid, shellInsideLength,shellInsideWidth, lidWallHeight, roundRadius, lidPlaneThickness, wallThickness, true);\n        if ($preview) \n        {\n          translate([-shellLength/2, -shellWidth/2, -(shellHeight-lidWallHeight-lidPlaneThickness)])\n          drawCenterMarkers();\n        }\n      } // Union\n      \n      if ($preview && showSideBySide==false && hideLidWalls)\n      {\n        //--- cutoff wall\n        translate([-shellLength,-shellWidth,shellHeight*-1])\n        {\n          color(colorLid, alphaLid)\n          cube([shellLength*2, shellWidth*2, shellHeight+(lidWallHeight+lidPlaneThickness-roundRadius)], \n                  center=false);\n        } // translate\n      }\n      else  //-- normal\n      {\n        color(colorLid, alphaLid)\n        union()\n        {\n          //--- cutoff lower half\n          // Leave the Ridge height so we can trim out the part we don't want\n          translate([-shellLength,-shellWidth,-shellHeight - newRidge(ridgeHeight)])\n          {\n            cube([(shellLength)*2, (shellWidth)*2, shellHeight], center=false);\n          } // translate\n          \n          //-- remove the ridge\n          removeLidRidge(shellInsideLength+wallThickness, \n                      shellInsideWidth+wallThickness, \n                      newRidge(ridgeHeight), \n                      roundRadius);\n        }\n      } // if normal\n    } // difference(d1)\n  } // translate\n\n  // Draw the objects that connect to the Lid\n  makeRidgeExt(yappPartLid, false);\n  pcbPushdowns();\n  \n  //--Only generate the cut box if we have connectors to add\n  if (len( connectors) >0)\n  {\n    intersection()\n    {  \n      iRad = getMinRad(roundRadius, wallThickness);\n      cRad = (roundRadius + iRad)/2;\n\n      translate([(shellLength/2), shellWidth/2, posZ00*-1])\n      minkowskiCutBox(shellInsideLength, shellInsideWidth, lidWallHeight, cRad, lidPlaneThickness, wallThickness);\n      \n      shellConnectors(yappPartLid, false);\n    } //intersection()\n  }// have connectors\n  buildLightTubes();\n  buildButtons(true);\n} //-- lidShell()\n\n\n        \n//===========================================================\nmodule pcbStandoff(plane, pcbStandHeight, filletRad, type, color, useFillet, configList) \n{\n  //-- Get the PCBinfo (defaults)\n  thePCB = getPCBInfo(yappPCBName, configList);\n \n  pcb_Length       = pcbLength(thePCB[0]); \n  pcb_Width        = pcbWidth(thePCB[0]);\n  pcb_Thickness    = pcbThickness(thePCB[0]);\n  standoff_Height  = standoffHeight(thePCB[0]);\n  standoff_Diameter  = standoffDiameter(thePCB[0]);\n  standoff_PinDiameter  = standoffPinDiameter(thePCB[0]);\n  standoff_HoleSlack  = (standoffHoleSlack(thePCB[0]) != undef) ? standoffHoleSlack(thePCB[0]) : 0.4;\n  \n  usePCBCoord = isTrue(yappCoordBox, configList) ? false : true;\n    \n  pcbGapTmp = getParamWithDefault(configList[3],-1);\n  pcbGap = (pcbGapTmp == -1 ) ? (usePCBCoord) ? pcb_Thickness : 0 : pcbGapTmp;\n\n  thestandoff_Diameter = getParamWithDefault(configList[4],standoff_Diameter);\n  thestandoff_PinDiameter = getParamWithDefault(configList[5],standoff_PinDiameter);\n  thestandoff_HoleSlack = getParamWithDefault(configList[6],standoff_HoleSlack);\n\n  //Sanity Check the diameters\n   assert((thestandoff_PinDiameter < thestandoff_Diameter), str(\"Pin Diameter [\", thestandoff_PinDiameter, \"] is larger than PCB stand Diameter [\", thestandoff_Diameter, \"]\" ));\n  \n   assert((thestandoff_PinDiameter+thestandoff_HoleSlack < thestandoff_Diameter), str(\"Pin Diameter [\", thestandoff_PinDiameter, \"] with Slack [\", thestandoff_HoleSlack, \"] is larger than PCB stand Diameter [\", thestandoff_Diameter, \"]\" ));\n  \n  useSelfThreading = isTrue(yappSelfThreading, configList) ? true : false;\n\n  pinLengthParam = getParamWithDefault(configList[8],0);\n  \n  pinLength = (pinLengthParam == 0) \n    ? pcbGap + pcbStandHeight + thestandoff_PinDiameter \n    : pcbStandHeight + pinLengthParam ;\n  \n  \n\n    // **********************\n\t\t//-- Use boxPart to determine where to place it\n    module standoff(boxPart, color)\n    {      \n      color(color,1.0)\n        cylinder(d = thestandoff_Diameter, h = pcbStandHeight, center = false);\n      //-- flange --\n      if (boxPart == yappPartBase)\n      {\n        if (useFillet) \n        {\n          filletRadius = (filletRad==0) ? basePlaneThickness : filletRad; \n          color(color,1.0) pinFillet(thestandoff_Diameter/2, filletRadius);\n        } // ifFillet\n      }\n      if (boxPart == yappPartLid)\n      {\n        if (useFillet) \n        {\n          filletRadius = (filletRad==0) ? lidPlaneThickness : filletRad; \n          translate([0,0,pcbStandHeight])\n            color(color,1.0) pinFillet(-thestandoff_Diameter/2, filletRadius);\n        } // ifFillet\n      }\n    } //-- standoff()\n        \n    // **********************\n    module standPin(boxPart, color, pinLength)\n    {\n\t\t\tpinZOffset = (boxPart == yappPartBase)\n\t\t\t\t? 0\n\t\t\t\t: pcbStandHeight-pinLength;\n\t\t\n\t\t\ttipZOffset = (boxPart == yappPartBase)\n\t\t\t\t? 0\n\t\t\t\t: pinLength;\n\t\t\t\t\n\t\t\ttranslate([0,0,pinZOffset])\n\t\t\t{\n\t\t\t\tcolor(color, 1.0)\n\t\t\t\tunion() \n\t\t\t\t{\n\t\t\t\t  if (useFillet) \n\t\t\t\t\t{\n\t\t\t\t\t\ttranslate([0,0,pinLength-tipZOffset]) \n\t\t\t\t\t\tsphere(d = thestandoff_PinDiameter);\n\t\t\t\t\t} // if (useFillet)\n\t\t\t\tcylinder(\n\t\t\t\t\td = thestandoff_PinDiameter,\n\t\t\t\t\th = pinLength,\n\t\t\t\t\tcenter = false); \n\t\t\t\t} //union\n\t\t\t} // translate\n    } //-- standPin()\n    \n    // **********************\n\t\t//-- Use boxPart to determine where to place it\n    module standHole(boxPart, color, useSelfThreading)\n    {\n      if (useFillet) \n      {\n      \n        //--add option for no internal fillet\n        noIntFillet = isTrue(yappNoInternalFillet, configList);\n      \n        filletZ = (boxPart == yappPartBase)\n\t\t\t\t\t? -pcbGap :\n\t\t\t\t\tpcbStandHeight-pcbGap;\n\t\t\t\t\n\t\t\t\tfilletDiameter = (boxPart == yappPartBase)\n\t\t\t\t\t? -(thestandoff_PinDiameter+thestandoff_HoleSlack)/2\n\t\t\t\t\t: (thestandoff_PinDiameter+thestandoff_HoleSlack)/2;\n\t\t\t\t\n        holeZ = (boxPart == yappPartBase)\n\t\t\t\t\t? + 0.02 \n\t\t\t\t\t: -0.02;\n\n\t\t\t\tcolor(color, 1.0)\n\t\t\t\tdifference() \n\t\t\t\t{\n\t\t\t\t\t//--The Actual Hole\n\t\t\t\t\ttranslate([0,0,holeZ]) \n            \n            if (!useSelfThreading)\n            {   \n                cylinder(\n                    d = thestandoff_PinDiameter+thestandoff_HoleSlack,\n                    h = pcbStandHeight+0.02,\n                    //h = pcbStandHeight+0.02-thestandoff_PinDiameter/2,\n                    center = false);\n            } \n            else\n            {\n                self_forming_screw(h=pcbStandHeight+0.02, d=thestandoff_PinDiameter,center=false);   \n            }\n                        \n            if (!noIntFillet) {\n              //-- The Fillet\t\t\n              filletRadius = (filletRad==0) ? basePlaneThickness : filletRad; \n              translate([0,0,filletZ+pcbGap]) \n              color(color,1.0) \n              pinFillet(-filletDiameter, -filletRadius);\n            }\n\t\t\t\t} // difference\n      } //if (useFillet) \n      else\n      {\n        color(color, 1.0)\n        translate([0,0,-0.01])\n\n        if (!useSelfThreading)\n        {\n          cylinder(\n            d = thestandoff_PinDiameter+thestandoff_HoleSlack,\n            h = (pcbGap*2)+pcbStandHeight+0.02,\n            center = false);\n        } // Self Threading\n        else\n        {\n          self_forming_screw(\n            d=thestandoff_PinDiameter,\n            h=pcbStandHeight+0.02, \n            center=false);   \n        } // Not Self Threading\n      } //if (useFillet) else \n    } //-- standhole()\n    \n\t\t\n\t//--------------------------------------------------\n\t//-- Add the Standoff to the part.\n\tif (type == yappPin)  \n\t{\n\t\t//-- pin - Place Pin in Lid and Hole in Base\n\t\t//standoff(plane, color);\n\t\tif (plane == yappPartBase) \n\t\t{\n\t\t\tif (printMessages) echo(\"yappPin - Add Pin to Base\");\n\t\t\tstandoff(plane, color);\n\t\t\tstandPin(plane, color, pinLength);\n\t\t} //yappPartBase  \n\t\telse \n\t\t{\n\t\t\tif (printMessages) echo(\"yappPin - Add Hole to Lid\");\n\t\t\tdifference()\n\t\t\t{\n\t\t\t\tstandoff(plane, color);\n\t\t\t\tstandHole(plane, color, useSelfThreading);\n\t\t\t}   \n\t\t} // yappPartLid\n\t} //type == yappPin\n\t\n\tif (type == yappHole)                  //-- hole\n\t{\n\t\t//-- pin - Place Hole in Lid and Hole in Base\t\n\t\tif (plane == yappPartBase) \n\t\t{\n\t\t\tif (printMessages) echo(\"yappHole - Add Hole to Base\");\n\t\t\tdifference() \n\t\t\t{\n\t\t\t\tstandoff(plane, color);\n\t\t\t\tstandHole(plane, color, useSelfThreading);\n\t\t\t}\n\t\t} //yappPartBase\n\t\telse\n\t\t{\n\t\t\tif (printMessages) echo(\"yappHole - Add Hole to Lid\");\n\t\t\tdifference() \n\t\t\t{\n\t\t\t\tstandoff(plane, color);\n\t\t\t\tstandHole(plane, color, useSelfThreading);\n\t\t\t}\n\t\t} //yappPartLid\n\t} // type == yappHole\n\n\tif (type == yappTopPin)                  //-- TopPin\n\t{\n\t\t//-- pin - Place Hole in Lid and Pin in Base\n\t\tif (plane == yappPartLid) \n\t\t{\n\t\t\tif (printMessages) echo(\"yappTopPin - Add Pin to Lid\");\n\t\t\tstandoff(plane, color);\n\t\t\tstandPin(plane, color, pinLength);\n\t\t} // yappPartLid \n\t\telse \n\t\t{\n\t\t\tif (printMessages) echo(\"yappTopPin - Add Hole to Base\");\n\t\t\tdifference()\n\t\t\t{\n\t\t\t\tstandoff(plane, color);\n\t\t\t\tstandHole(plane, color, useSelfThreading);\n\t\t\t}   \n\t\t} //yappPartBase\n\t} // type == yappTopPin\n} //-- pcbStandoff()\n\n        \n//===========================================================\nmodule connectorNew(shellPart, theCoordSystem, x, y, conn, outD, subtract) \n{\n  face = (shellPart==yappPartBase) ? yappBase : yappLid ;\n  faceThickness = (shellPart==yappPartBase) ? basePlaneThickness : lidPlaneThickness ;\n  connHeightRaw = translate2Box_Z (conn[2], face, theCoordSystem);\n  \n  pcb_Thickness = pcbThickness(theCoordSystem[2]);\n  \n  connHeight =  connHeightRaw;\n\n  diam1 = conn[3]; //-- screw Diameter\n  diam2 = conn[4]; //-- screwHead Diameter\n  diam3 = conn[5]; //-- insert Diameter\n  diam4 = outD;\n  \n  \n  screwHoleHeight = connHeight;\n  \n//  echo(\"%^%^%^%^%\", ((diam4-diam2)/2));\n//  echo(faceThickness=faceThickness);\n  \n  screwHeadHeight = connHeight - max((((diam4-diam2)/2)), faceThickness );  \n//  screwHeadHeight = connHeight - 2;  \n  \n  insertHeight = getParamWithDefault(conn[7],undef);\n  \n  pcbGapTmp = getParamWithDefault(conn[8],undef);\n  \n  fR = getParamWithDefault(conn[9],0); //-- filletRadius\n \n  pcbGap = (pcbGapTmp == undef ) ? ((theCoordSystem[0]==yappCoordPCB) ? pcb_Thickness : 0) : pcbGapTmp;\n  \n  if (printMessages) echo(\"connectorNew\", pcbGap=pcbGap,connHeightRaw=connHeightRaw,connHeight=connHeight,shellHeight=shellHeight);\n   \n  if (shellPart==yappPartBase)\n  {\n//    color(\"Yellow\")\n    translate([x, y, 0])\n    {\n      hb = connHeight; \n      if (connHeight >= faceThickness) \n      {  \n        union()\n        {\n          //-- Do the add part\n          if (!subtract) \n          //difference()\n          {\n            union()\n            {\n              //-- outerCylinder --\n              color(\"orange\")\n              translate([0,0,0.02])\n              linear_extrude(hb-0.02)\n                circle(d = diam4); //-- outside Diam\n                \n              //--Add outer Fillet\n              if (!isTrue(yappNoFillet, conn))\n              {\n                filletRadius = (fR == 0) ? faceThickness : fR; \n                filletRad = min(filletRadius,connHeight - faceThickness);\n                if (hb>faceThickness)\n                {\n                  translate([0,0,(faceThickness)])\n                  {\n                    color(\"violet\")\n                    pinFillet(diam4/2, filletRad);\n                  }\n                }\n              }// ifFillet\n            }\n          }\n          else\n          //-- Remove part\n          {\n            difference()\n            {\n              union()\n              {\n                //-- screw head Hole --\n                color(\"Cyan\") \n                if (!isTrue(yappCountersink, conn))\n                {\n                  translate([0,0,-0.01]) \n                    cylinder(h=screwHeadHeight+0.02, d=diam2);\n                }\n                else\n                {\n                  translate([0,0, -0.01])\n                  union()\n                  {\n                    cylinder(h=countersinkHeight(conn), d1=diam2, d2=0);\n                  }\n                } // Countersunk\n                \n                \n                //-- screwHole --\n                translate([0,0,-0.01])  \n                  color(\"blue\") \n                    cylinder(h=screwHoleHeight+0.02, d=diam1);\n                \n              }//Union\n              //-- Internal fillet\n              if (!isTrue(yappNoFillet, conn) && !isTrue(yappCountersink, conn))\n              {\n                if (!isTrue(yappNoInternalFillet, conn)) \n                {\n                  filletRadius = (diam2-diam1)/4; // 1/2 the width of the screw flange\n                  \n                  filletRad = min (filletRadius, (diam4-diam1)/2);\n                  translate([0,0, screwHeadHeight+0.01])\n                  {\n                    color(\"Red\")\n                    pinFillet(-diam2/2-0.01, -filletRad);\n                  }\n                }// internal fillet allowed\n              }// ifFillet\n            } //  difference\n          }// Remove Part\n        } // union\n      } // Height > plane thickness\n    } //  translate\n  } //  if base\n  \n  if (shellPart==yappPartLid)\n  {\n    //-- calculate the Z-position for the lid connector.\n    //-- for a PCB connector, start the connector on top of the PCB to push it down.\n    \n    heightTemp = shellHeight-connHeight-pcbGap;\n    zOffset = -heightTemp;\n\n //   color(\"Yellow\")\n    translate([x, y, zOffset])\n    {\n      ht=(heightTemp);\n      union()\n      {\n        //-- Do the add part\n        if (!subtract) \n        {\n          union()\n          {\n            //-- outside Diameter --\n            color(\"orange\")\n            linear_extrude(ht-0.01)\n                circle(d = diam4);\n            //-- flange --\n            if (!isTrue(yappNoFillet, conn))\n            {\n              filletRadius = (fR == 0) ? lidPlaneThickness : fR;\n              translate([0,0,ht-lidPlaneThickness]) \n              {\n                pinFillet(-diam4/2, filletRadius);\n              }\n            } // ifFillet\n          } \n        } // Add Part\n        else\n        { // Subtract part\n          adjustedHeight = \n          (!is_undef(insertHeight) && (insertHeight < (ht-lidPlaneThickness))) \n            ? insertHeight - lidPlaneThickness + 0.02\n            : ht - lidPlaneThickness + 0.02  \n          ;\n        \n          //-- insert --\n          difference()\n          {\n            color(\"red\")\n            translate([0, 0, -0.01])\n            if (!isTrue(yappSelfThreading, conn))\n            {\n              //linear_extrude(ht - lidPlaneThickness + 0.02)\n              linear_extrude(adjustedHeight)\n                circle(d = diam3);\n            } else {\n              self_forming_screw(h=adjustedHeight, d=diam3, center=false);\n            } // Self Threading\n          \n \n\n              \n            //-- Internal fillet\n            if (!isTrue(yappNoFillet, conn) && !isTrue(yappCountersink, conn))\n            {\n              if (!isTrue(yappNoInternalFillet, conn)) \n                {              \n                filletRad = (diam3)/4;\n                translate([0,0, adjustedHeight+0.01])\n                {\n                  color(\"Green\")\n                  pinFillet(-diam3/2-0.01, -filletRad);\n                }\n              }// Allow Internal Fillet\n            }// ifFillet\n          }//Difference \n        } // Subtract Part\n      } // union\n    } // translate\n  } //  if lid\n} //-- connectorNew()\n\n        \n//===========================================================\n//-- DMR 2025/4/17 Split the connectors to an add/subtract set\nmodule shellConnectors(shellPartRaw, subtract) \n{\n  for ( conn = connectors )\n  {\n    //-- Add yappThroughLid option\n    shellPart = (isTrue(yappThroughLid, conn)) ? ((shellPartRaw==yappPartBase) ? yappPartLid : yappPartBase) : shellPartRaw;\n    \n    invertPart = isTrue(yappThroughLid, conn);\n    \n    allCorners = (isTrue(yappAllCorners, conn)) ? true : false;\n    primeOrigin = (!isTrue(yappBackLeft, conn) && !isTrue(yappFrontLeft, conn) && !isTrue(yappFrontRight, conn) && !isTrue(yappBackRight, conn) && !isTrue(yappAllCorners, conn) ) ? true : false;\n    \n    //-- Get the desired coordinate system  \n    //-- 3.3.6 change the default coordinate system  \n    //theCoordSystem = getCoordSystem(conn, yappCoordBox);    \n    theCoordSystem = getCoordSystem(conn, yappCoordPCB);    \n    face = (shellPart==yappPartBase) ? yappBase : yappLid ;\n \n    theLength = getLength(theCoordSystem);\n    theWidth = getWidth(theCoordSystem);\n   \n    connX = translate2Box_X (conn[0], face, theCoordSystem);\n    connY = translate2Box_Y (conn[1], face, theCoordSystem);\n\n    connX2 = translate2Box_X (theLength - conn[0], face, theCoordSystem);\n    connY2 = translate2Box_Y (theWidth - conn[1], face, theCoordSystem);\n\n    outD    = minOutside(conn[5]+1, conn[6]);\n    \n    mirror([0,0,invertPart])\n    {\n      \n      if (primeOrigin || allCorners || isTrue(yappBackLeft, conn))\n        connectorNew(shellPart, \n        theCoordSystem, \n        connX, \n        connY, \n        conn, \n        outD\n        ,subtract);\n\n      if (allCorners || isTrue(yappFrontLeft, conn))\n        connectorNew(shellPart, \n        theCoordSystem, \n        connX2, \n        connY, \n        conn, \n        outD,\n        subtract);\n\n      if (allCorners || isTrue(yappFrontRight, conn))\n        connectorNew(shellPart, \n        theCoordSystem, \n        connX2, \n        connY2, \n        conn, \n        outD,\n        subtract);\n\n      if (allCorners || isTrue(yappBackRight, conn))\n        connectorNew(shellPart, \n        theCoordSystem, \n        connX, \n        connY2, \n        conn, \n        outD,\n        subtract);\n    }//mirror\n  } // for ..\n} //-- shellConnectors()\n\n\n//===========================================================\nmodule showPCBs()\n{\n  if ($preview) {\n    // Loop through the PCBs\n    for ( thePCB = pcb ) {\n      printPCB(thePCB);\n    }  \n  }\n} //--showPCBs()\n\n\n//===========================================================\nmodule showOrientation()\n{\n  translate([-10, shellWidth/2+12, 0])\n    %rotate(270)\n      color(\"gray\")\n        linear_extrude(1) \n          text(\"BACK\"\n            , font=\"Liberation Mono:style=bold\"\n            , size=8\n            , direction=\"ltr\"\n            , halign=\"left\"\n            , valign=\"bottom\");\n\n  translate([shellLength+10, shellWidth/2-15, 0])\n    %rotate(90)\n      color(\"gray\")\n        linear_extrude(1) \n          text(\"FRONT\"\n            , font=\"Liberation Mono:style=bold\"\n            , size=8\n            , direction=\"ltr\"\n            , halign=\"left\"\n            , valign=\"bottom\");\n\n  %translate([shellLength/2- 13, -10, 0])\n      color(\"gray\")\n        linear_extrude(1) \n          text(\"LEFT\"\n            , font=\"Liberation Mono:style=bold\"\n            , size=8\n            , direction=\"ltr\"\n            , halign=\"left\"\n            , valign=\"bottom\");\n            \n  %translate([shellLength/2+ 16, (10+shellWidth), 0])\n    rotate([0,0,180])\n      color(\"gray\")\n        linear_extrude(1) \n          text(\"RIGHT\"\n            , font=\"Liberation Mono:style=bold\"\n            , size=8\n            , direction=\"ltr\"\n            , halign=\"left\"\n            , valign=\"bottom\");\n  if (showSideBySide)\n  {\n  translate([-10, shellWidth + shiftLid*2 + (shellWidth/2) +12, 0])\n    %rotate(270)\n      color(\"gray\")\n        linear_extrude(1) \n          text(\"BACK\"\n            , font=\"Liberation Mono:style=bold\"\n            , size=8\n            , direction=\"ltr\"\n            , halign=\"left\"\n            , valign=\"bottom\");\n\n  translate([shellLength+10, shellWidth + shiftLid*2 + shellWidth/2-15, 0])\n    %rotate(90)\n      color(\"gray\")\n        linear_extrude(1) \n          text(\"FRONT\"\n            , font=\"Liberation Mono:style=bold\"\n            , size=8\n            , direction=\"ltr\"\n            , halign=\"left\"\n            , valign=\"bottom\");\n\n  %translate([shellLength/2- 16, shellWidth + shiftLid*2 + -10, 0])\n      color(\"gray\")\n        linear_extrude(1) \n          text(\"RIGHT\"\n            , font=\"Liberation Mono:style=bold\"\n            , size=8\n            , direction=\"ltr\"\n            , halign=\"left\"\n            , valign=\"bottom\");\n            \n  %translate([shellLength/2+ 13, shellWidth + shiftLid*2 + (10+shellWidth), 0])\n    rotate([0,0,180])\n      color(\"gray\")\n        linear_extrude(1) \n          text(\"LEFT\"\n            , font=\"Liberation Mono:style=bold\"\n            , size=8\n            , direction=\"ltr\"\n            , halign=\"left\"\n            , valign=\"bottom\");    \n  }\n} //-- showOrientation()\n\n\n//===========================================================\n//-- negative pinRadius flips the fillet in the Z \n//-- negative filletRadius makes it an internal fillet\nmodule pinFillet(pinRadius, filletRadius) \n{\n  //-- Error checking for internal fillet bigger than the hole\n  filletRad = ((filletRadius<0) && (-filletRadius > abs(pinRadius))) ? -abs(pinRadius + 0.001): filletRadius;\n  \n  fr = abs(filletRad);\n\n  voffset = (pinRadius < 0) ? -fr : fr;\n  voffset2 = (pinRadius < 0) ? 0 : -fr;  \n  \n  xoffset = (filletRad < 0) ? -fr : 0;\n  voffset3 = (filletRad < 0) ? (fr*2) : 0;\n  pr = (pinRadius < 0) ? -pinRadius : pinRadius;\n  //-- Change to simplier fillet calculation\n  translate([0,0, voffset])\n    rotate_extrude()\n      translate([-fr-pr+voffset3, 0, 0])\n        difference()\n        {\n          translate([xoffset, voffset2]) square(fr);\n          circle(fr);\n        }\n} //-- pinFillet()\n\n\n//===========================================================\nmodule boxFillet (boxSize, filletRadius) \n{\n  fr = filletRadius;\n  voffset = (boxSize < 0) ? 0 : fr;\n  voffset2 = (boxSize < 0) ? -fr : 0;\n  bs = (boxSize < 0) ? -boxSize : boxSize;\n  translate([0,0, voffset2])\n  difference()\n  {\n    difference()\n    {\n      translate([0,0, fr/2]) cube(size=[(bs+fr)*2,(bs+fr)*2,fr], center=true);\n      for(dr=[0:90:270])\n        rotate([0,0,dr])\n        translate([bs+fr,0, voffset]) \n        rotate([90,0,0]) cylinder(h=bs*5,\n        r=fr, center=true);\n    }\n    translate([0,0, fr]) cube(size=[(bs*2)-.04,(bs*2)-.04,fr*3], center=true);\n  }\n} //-- boxFillet()\n\n\n//===========================================================\nmodule linearFillet(length, radius, rotation)\n{\n  //-- Spin it to the desired rotation\n  rotate([rotation,0,0])\n  //-- Bring it to normal orientation\n  translate([length,0,0])  // x, Y, Z\n  rotate ([0,-90,0]) \n  difference()\n  {\n    translate([-0.05,-0.05,0]) \n      cube([radius+0.05, radius+0.05, length], center=false);\n    translate([radius,radius,-0.1]) \n      cylinder(h=length+0.2, r=radius, center=false);\n  }\n} //-- linearFillet()\n\n\n//===========================================================\n//-- Set boxWidth to negative to invert the fillet in the Z axis\n//-- Orientation  (0 = Normal 1= Flip in Z, 2 = flip inside\nmodule rectangleFillet (boxWidth, boxLength, filletRadius, orientation=0)\n{  \n  flipZ = (orientation % 2 >= 1 ) ? 1 : 0;\n  outside = (orientation % 4 >= 2);\n\n  fr = abs(filletRadius);\n  voffset = (boxWidth < 0) ? 0 : fr;\n  voffset2 = (boxWidth < 0) ? -fr : 0;\n  bx = (boxWidth < 0) ? -boxWidth/2 : boxWidth/2;\n  by = boxLength/2;\n  boxRatio = bx/by;\n  \n  mirror([0,0,flipZ])\n  \n  if (!outside) \n  {\n    translate([0,0, voffset2])\n    difference()\n    {\n      difference()\n      {\n        translate([0,0, fr/2]) cube(size=[(bx+fr)*2,(by+fr)*2,fr], center=true);\n        for(dr=[0,180])\n          rotate([0,0,dr])\n            translate([bx+fr,0, voffset]) \n              rotate([90,0,0]) \n                cylinder(h=by*2 + (fr*5), r=fr, center=true);\n        for(dr=[90,270])\n          rotate([0,0,dr])\n            translate([by+fr,0, voffset]) \n              rotate([90,0,0]) \n                cylinder(h=bx*2 + (fr*5), r=fr, center=true);\n      }\n      translate([0,0, fr]) cube(size=[(bx*2)-.04,(by*2)-.04,fr*3], center=true);\n    }\n  }\n  else\n  {\n    translate([0,0, voffset2])\n    //-- front/back\n    for(dr=[0,180])\n    {\n      rotate([0,0,dr])\n      difference() \n      {\n        translate([bx - (fr/2),0, fr/2]) \n        cube(size=[fr, by*2, fr], center=true);\n          translate([bx-fr,0, voffset]) \n            rotate([90,0,0]) \n              cylinder(h=by*2 + (fr*5), r=fr, center=true);\n      }\n    }\n    //-- left right\n    for(dr=[90,270])\n    {\n      rotate([0,0,dr])\n      difference() \n      {\n        translate([by - (fr/2),0, fr/2]) \n        cube(size=[fr, bx*2, fr], center=true);\n          translate([by-fr,0, voffset]) \n            rotate([90,0,0]) \n              cylinder(h=bx*2 + (fr*5), r=fr, center=true);\n      }\n    }\n  }\n} //-- rectangleFillet()\n\n\n//===========================================================\nmodule roundedRectangle2D(width,length,radius)\n{\n  if (radius > width/2 || radius > length/2) \n  {\n      echo(\"Warning radius too large\");\n  }\n  hull() \n  {\n    translate ([(-width/2) + radius, (-length/2) + radius,0]) circle(r=radius);\n    translate ([(+width/2) - radius, (-length/2) + radius,0]) circle(r=radius);\n    translate ([(-width/2) + radius, (+length/2) - radius,0]) circle(r=radius);\n    translate ([(+width/2) - radius, (+length/2) - radius,0]) circle(r=radius);\n  }\n} //-- roundedRectangle2D()\n\n\n//===========================================================\nmodule chamferedRectangle2D(x,y,clip)\n{\n  if (clip > x/2 || clip > y/2) \n  {\n      echo(\"Warning radius too large\");\n  }\n  \n  translate([-x/2,-y/2,0])\n  polygon([[clip,0],\n    [x-clip,0],\n    [x,clip],\n    [x,y-clip],\n    [x-clip,y],\n    [clip,y],\n    [0,y-clip],\n    [0,clip],\n    [clip,0]\n]);\n  \n} //-- roundedRectangle2D()\n\n\nmodule chamferCube3D(x,y,z,clip_x,clip_y,clip_z)\n{\n  translate([-x/2,-y/2,-z/2])\n  \n  polyhedron\n    (points = [\n\t    [clip_x, clip_y, 0], [x-clip_x, clip_y, 0], [x-clip_x, y-clip_y, 0], [clip_x, y-clip_y, 0], // bottom face\n\t    [clip_x, clip_y, z], [x-clip_x, clip_y, z], [x-clip_x, y-clip_y, z], [clip_x, y-clip_y, z], // top face\n\n\t    [0, clip_y, clip_z], [0, y-clip_y, clip_z], [0, y-clip_y, z-clip_z], [0, clip_y, z-clip_z], // left face\n\t    [x, clip_y, clip_z], [x, y-clip_y, clip_z], [x, y-clip_y, z-clip_z], [x, clip_y, z-clip_z], // right face\n\n\t    [clip_x, 0, clip_z], [x-clip_x, 0, clip_z], [x-clip_x, 0, z-clip_z], [clip_x, 0, z-clip_z], // front face\n\t    [clip_x, y, clip_z], [x-clip_x, y, clip_z], [x-clip_x, y, z-clip_z], [clip_x, y, z-clip_z], // back face\n\t   ], \n     faces = [\n\t\t  [0,1,2,3],  // Bottom\n\t\t  [7,6,5,4],  // top\n\t\t  [8,9,10,11],  // left\n\t\t  [15,14,13,12],  // right\n\t\t  [19,18,17,16],  // front\n\t\t  [20,21,22,23],  // back\n  \n  \t  [0,3,9,8],  // bottom/left\n  \t  [11,10,7,4],  // top/left\n  \n  \t  [12,13,2,1],  // bottom/right\n  \t  [5,6,14,15],  // top/right\n\n  \t  [16,17,1,0],  // bottom/front\n  \t  [18,19,4,5],  // top/front\n\n  \t  [3,2,21,20],  // bottom/back\n  \t  [23,22,6,7],  // top/back\n  \n  \t  [20,23,10,9],  // back/left\n  \t  [22,21,13,14],  // back/right\n\n  \t  [17,18,15,12],  // front/right\n  \t  [19,16,8,11],  // front/left\n \n      [4,19,11],  // front/left/top\n      [8,16,0],  // front/left/bottom\n\n      [5,15,18],  // front/right/top\n      [1,17,12],  // front/right/bottom\n\n      [6,22,14],  // back/right/top\n      [2,13,21],  // back/right/bottom\n\n      [7,10,23],  // back/left/top\n      [3,20,9],  // back/left/bottom\n  \t ]\n  );\n} //chamferCube3D \n\n//===========================================================\nmodule generateShapeFillet (Shape, useCenter, Width, Length, Depth, filletTop, filletBorrom, Radius, Rotation, Polygon=undef, expand=0)\n//-- Creates a shape centered at 0,0 in the XY and from 0-thickness in the Z with a fillet on the top and bottom (optional)\n{ \n  Thickness = Depth;\n  filletRadiusTop = filletTop; \n  filletRadiusBottom = filletBorrom; \n  \n  rotate([0,0,Rotation])\n  {\n    extrudeWithRadius(Thickness,filletRadiusBottom,-filletRadiusTop,Thickness/printerLayerHeight)  \n    {\n      offset(expand)\n      { \n        if (Shape == yappCircle)\n        {\n          translate([(useCenter) ? 0 : Radius,(useCenter) ? 0 : Radius,0])\n          circle(r=Radius);\n        } \n        else if (Shape == yappRing)\n        {\n          connectorCount=(Width==0) ? 0 : (Width>0) ? 1 : 2; \n          connectorWidth=abs(Width);\n          translate([(useCenter) ? 0 : Radius,(useCenter) ? 0 : Radius,0])\n            difference() {\n                difference() {\n                    circle(r=Radius);\n                    circle(r=Length);\n                }\n                if (connectorCount>0) \n                {\n                  square([connectorWidth, Radius*2], center=true);\n                  if (connectorCount>1) \n                  {\n                    rotate([0,0,90])\n                    square([connectorWidth, Radius*2], center=true);\n                  }\n                }\n            }\n        } \n        else if (Shape == yappRectangle)\n        {\n          translate([(useCenter) ? 0 : Width/2,(useCenter) ? 0 : Length/2,0])\n          {\n            square([Width,Length], center=true); \n          }\n        } \n        else if (Shape == yappRoundedRect)\n        {\n          {\n            translate([(useCenter) ? 0 : Width/2,(useCenter) ? 0 : Length/2,0])\n            roundedRectangle2D(Width,Length,Radius);\n          }\n        }\n        else if (Shape == yappPolygon)\n        {\n          translate([(useCenter) ? 0 : Width/2,(useCenter) ? 0 : Length/2,0])\n          scale([Width,Length,0])\n          {\n            polygon(Polygon);\n          }\n        }\n        else if (Shape == yappCircleWithFlats)\n        {\n          translate([(useCenter) ? 0 : Radius,(useCenter) ? 0 : Radius,0])\n          {\n            intersection()\n            { \n              circle(r=Radius);    \n              square([Width, Radius*2], center=true);\n            }\n          }\n        }\n        else if (Shape == yappCircleWithKey)\n        {\n          translate([(useCenter) ? 0 : Radius,(useCenter) ? 0 : Radius,0])\n          {\n            intersect = Radius - sqrt(Radius^2 - (Width/2)^2);  \n            depth = Length;\n            //--Add the Actual Key\n            if (depth <= 0) \n            {\n              //-- Create the circle with the flat for the key\n              difference()\n              {\n                circle(r=Radius); \n                  translate ([Radius ,0,0]) \n                    square([intersect*2, Width ], center=true);\n              }\n              //-- Add the outer cut\n             translate ([Radius - intersect + 0,0,0]) \n                square([abs(depth*2), Width ], center=true);\n            }\n            else if (depth > 0) \n            {\n              //-- Create the circle with the flat for the key\n              difference()\n              {\n                circle(r=Radius);  \n                //-- Remove the flat\n                translate ([Radius - depth/2,0,0]) \n                  square([intersect*2 + depth, Width ], center=true);\n              }\n            }\n          }\n        } // if yappCircleWithKey\n\n      }\n    }\n  }\n} //-- generateShape()\n\n\n//===========================================================\nmodule generateShape (Shape, useCenter, Width, Length, Thickness, Radius, Rotation, Polygon, expand=0)\n// Creates a shape centered at 0,0 in the XY and from 0-thickness in the Z\n{ \n  rotate([0,0,Rotation])\n  {\n    //-- Sphere cutout handled as a 3d object not a 2d Extruded \n    if (Shape == yappSphere) {\n      //translate([0,0,(Thickness-0.08)/2]) \n      {\n        intersection() \n        {\n          translate([0,0,(Thickness/2)+.02]) // adjust to center \n        //  translate([0,0,0.04])\n            cube([Radius*3,Radius*3,Thickness], center=true);\n          \n          //translate([0,0,Width+(Radius/2)-((Thickness-0.08)/2)])\n          translate([0,0,Width+(Thickness/2)])\n            sphere(r=Radius);\n          \n        } //intersection\n      } //translate\n    } else {\n      linear_extrude(height = Thickness)\n      { \n        offset(expand)\n        { \n          if (Shape == yappCircle)\n          {\n            translate([(useCenter) ? 0 : Radius,(useCenter) ? 0 : Radius,0])\n            circle(r=Radius);\n          } \n          else if (Shape == yappRing)\n          {\n            connectorCount=(Width==0) ? 0 : (Width>0) ? 1 : 2; \n            connectorWidth=abs(Width);\n            translate([(useCenter) ? 0 : Radius,(useCenter) ? 0 : Radius,0])\n              difference() {\n                  difference() {\n                      circle(r=Radius);\n                      circle(r=Length);\n                  }\n                  if (connectorCount>0) \n                  {\n                    square([connectorWidth, Radius*2], center=true);\n                    if (connectorCount>1) \n                    {\n                      rotate([0,0,90])\n                      square([connectorWidth, Radius*2], center=true);\n                    }\n                  }\n              }\n          } \n          else if (Shape == yappRectangle)\n          {\n            translate([(useCenter) ? 0 : Width/2,(useCenter) ? 0 : Length/2,0])\n            {\n              square([Width,Length], center=true); \n            }\n          } \n          else if (Shape == yappRoundedRect)\n          {\n            {\n              translate([(useCenter) ? 0 : Width/2,(useCenter) ? 0 : Length/2,0])\n              roundedRectangle2D(Width,Length,Radius);\n            }\n          }\n          else if (Shape == yappPolygon)\n          {\n            translate([(useCenter) ? 0 : Width/2,(useCenter) ? 0 : Length/2,0])\n            scale([Width,Length,0]){\n              polygon(Polygon);\n            }\n          }\n          else if (Shape == yappCircleWithFlats)\n          {\n            translate([(useCenter) ? 0 : Radius,(useCenter) ? 0 : Radius,0])\n            {\n              intersection()\n              { \n                circle(r=Radius);    \n                square([Width, Radius*2], center=true);\n              }\n            }\n          }\n          else if (Shape == yappCircleWithKey)\n          {\n            translate([(useCenter) ? 0 : Radius,(useCenter) ? 0 : Radius,0])\n            {\n              intersect = Radius - sqrt(Radius^2 - (Width/2)^2);   \n              depth = Length;\n              //--Add the Actual Key\n              if (depth <= 0) \n              {\n                //-- Create the circle with the flat for the key\n                difference()\n                {\n                  circle(r=Radius); \n                    translate ([Radius ,0,0]) \n                      square([intersect*2, Width ], center=true);\n                }\n                //-- Add the outer cut\n               translate ([Radius - intersect + 0,0,0]) \n                  square([abs(depth*2), Width ], center=true);\n              }\n              else if (depth > 0) \n              {\n                //-- Create the circle with the flat for the key\n                difference()\n                {\n                  circle(r=Radius);  \n                  //-- Remove the flat\n                  translate ([Radius - depth/2,0,0]) \n                    square([intersect*2 + depth, Width ], center=true);\n                }\n              }\n            }\n          } // if yappCircleWithKey\n        } // offset\n      } // extrude\n    } // if (Shape == yappSphere)\n  } // Rotate\n} //-- generateShape()\n\n\n//===========================================================\nmodule genMaskfromParam(params, width, height, depth, hOffset, vOffset, addRot) \n{  \n  if (printMessages) echo(\"Mask\");\n  //get the Polygon if listed\n  thePolygon = getVector(yappPolygonDef, params);\n  genMask(\n    params[0], //pattern, \n    width,     // Needed width\n    height,    // Needed height\n    hOffset, //    params[1], //hoffset, \n    vOffset, //    params[2], //voffset, \n    depth+0.08, //    params[3], //thickness, \n    (params[1]==0) ? width : params[1], //hRepeat, \n    (params[2]==0) ? height : params[2], //vRepeat, \n    params[3]+addRot, //rotation, \n    params[4], //openingShape, \n    params[5], //openingWidth, \n    params[6], //openingLength, \n    params[7], //openingRadius, \n    params[8], //openingRotation, \n    thePolygon //polygon)\n    );\n  \n} //-- genMaskfromParam()\n\n\n//===========================================================\nmodule genMask(pattern, width, height, hOffset, vOffset, thickness, hRepeat, vRepeat, rotation, openingShape, openingWidth, openingLength, openingRadius, openingRotation, polygon)\n{\n  \n  if (printMessages) echo(\"genMask\",pattern=pattern);\n  if (printMessages) echo(\"genMask\",width=width);\n  if (printMessages) echo(\"genMask\",height=height);\n  if (printMessages) echo(\"genMask\",hOffset=hOffset);\n  if (printMessages) echo(\"genMask\",vOffset=vOffset);\n  if (printMessages) echo(\"genMask\",thickness=thickness);\n  if (printMessages) echo(\"genMask\",hRepeat=hRepeat);\n  if (printMessages) echo(\"genMask\",vRepeat=vRepeat);\n  if (printMessages) echo(\"genMask\",rotation=rotation);\n  if (printMessages) echo(\"genMask\",openingShape=openingShape);\n  if (printMessages) echo(\"genMask\",openingWidth=openingWidth);\n  if (printMessages) echo(\"genMask\",openingLength=openingLength);\n  if (printMessages) echo(\"genMask\",openingRadius=openingRadius);\n  if (printMessages) echo(\"genMask\",openingRotation=openingRotation);\n  if (printMessages) echo(\"genMask\",polygon=polygon);\n  \n  rotatedHeight = ((sin((360+rotation)%90) * width) + (cos((360+rotation)%90) * height));\n  rotatedWidth = ((sin((360+rotation)%90) * height) + (cos((360+rotation)%90) * width));\n\n  rotate([0,0,rotation])\n  translate([-rotatedWidth/2, -rotatedHeight/2,-0.02])\n  {\n    if (pattern == yappPatternSquareGrid) \n    {\n      for(hpos=[-hRepeat:hRepeat:rotatedWidth+hRepeat])\n      {\n        for(vpos=[-vRepeat:vRepeat:rotatedHeight+vRepeat])\n        {\n          translate([hpos + hOffset,vpos+vOffset]) \n          {\n            generateShape (openingShape, true, \n            (openingWidth==0) ? width :openingWidth, \n            (openingLength==0) ? height : openingLength, \n            thickness+0.04, openingRadius, openingRotation, polygon);\n          }\n        }\n      }\n    } else if (pattern == yappPatternHexGrid) \n    {\n      hexRepeatH = hRepeat;\n      hexRepeatV = (sqrt(3) * hRepeat/2);\n\n      for(hpos=[-hexRepeatH:hexRepeatH:rotatedWidth+hexRepeatH])\n      {\n        for(vpos=[-hexRepeatV:hexRepeatV*2:rotatedHeight+hexRepeatV*2])\n        {\n          translate([hpos + hOffset,vpos+vOffset,0]) \n          {\n            generateShape (openingShape, true, \n            (openingWidth==0) ? width :openingWidth, \n            (openingLength==0) ? height : openingLength, \n            thickness, openingRadius,openingRotation, polygon);\n          }\n          translate([hpos-(hexRepeatH/2)+ hOffset,vpos+hexRepeatV+vOffset,0]) \n          {\n            generateShape (openingShape, true,\n            (openingWidth==0) ? width :openingWidth, \n            (openingLength==0) ? height : openingLength, \n            thickness, openingRadius,openingRotation, polygon);\n          }\n        }\n      }\n    } \n  }\n} //-- genMask()\n\n\n//===========================================================\nmodule drawLid() \n{\n  difference()\n  {\n    union() //(t2)\n    {\n    //-- Draw objects not cut by the lid\n    //-- Comment out difference() to see objects instead of cutting them from the lid for debugging\n    //-- xxxxx        \n      difference()  // (t1) \n      {\n        union() {\n        //-- Draw the lid\n          lidShell();\n        }\n        //-- new for 3.1\n        addDisplayMounts(0);  //-- Do the Cutout in the lid\n      } //  difference(t1)\n      \n      //-- Post cutouts operations\n      posZ00 = lidWallHeight+lidPlaneThickness;\n      translate([(shellLength/2), (shellWidth/2), (posZ00*-1)])\n      {\n        minkowskiBox(yappPartLid, shellInsideLength,shellInsideWidth, lidWallHeight, roundRadius, lidPlaneThickness, wallThickness, false);\n      }\n    \n      //-- new for 3.1\n      addDisplayMounts(1); //-- Generate the Mount\n\n      //-- Add the text\n      translate([shellLength-15, -15, 0])\n        linear_extrude(1) \n          mirror([1,0,0])\n            %text(\"LEFT\"\n                  , font=\"Liberation Mono:style=bold\"\n                  , size=8\n                  , direction=\"ltr\"\n                  , halign=\"left\"\n                  , valign=\"bottom\");\n    } //union (t2)\n    \n    //-- Remove parts of it\n    lightTubeCutout();\n    buttonCutout();\n          \n    //-- Do all of the face cuts\n    makeCutouts(yappPartLid);\n    shellConnectors(yappPartLid, true);\n    makeRidgeExt(yappPartLid,true);\n  \n    printSnapJoins(yappPartLid);\n\n    //-- Draw the labels that are carved into the case\n    color(\"Red\") drawLabels(yappPartLid, true);\n    color(\"Red\") drawImages(yappPartLid, true);\n  } //difference\n} //-- drawLid()\n\n\n//===========================================================\nmodule drawCenterMarkers()\n{\n  if (showMarkersCenter) \n  {\n    if (printMessages) echo(\"Showing center markers\");\n    //-- Left\n    color(\"Magenta\")\n      translate([shellLength/2,0,shellHeight/2])\n        rotate([0,0,45])\n          cube([1,1,shellHeight], center=true);\n    color(\"Magenta\")\n      translate([shellLength/2,0,shellHeight/2])\n        rotate([0,90,0])\n        rotate([0,0,45])\n          cube([1,1,shellLength], center=true);\n    //-- Right\n    color(\"Magenta\")\n      translate([shellLength/2,shellWidth,shellHeight/2])\n        rotate([0,0,45])\n          cube([1,1,shellHeight], center=true);\n    color(\"Magenta\")\n      translate([shellLength/2,shellWidth,shellHeight/2])\n        rotate([0,90,0])\n        rotate([0,0,45])\n          cube([1,1,shellLength], center=true);\n    //-- Front\n    color(\"Magenta\")\n      translate([shellLength,shellWidth/2,shellHeight/2])\n        rotate([0,0,45])\n          cube([1,1,shellHeight], center=true);\n    color(\"Magenta\")\n      translate([shellLength,shellWidth/2,shellHeight/2])\n        rotate([90,0,0])\n        rotate([0,0,45])\n          cube([1,1,shellWidth], center=true);\n    //-- Back\n    color(\"Magenta\")\n      translate([0,shellWidth/2,shellHeight/2])\n        rotate([0,0,45])\n          cube([1,1,shellHeight], center=true);\n    color(\"Magenta\")\n      translate([0,shellWidth/2,shellHeight/2])\n        rotate([90,0,0])\n        rotate([0,0,45])\n          cube([1,1,shellWidth], center=true);\n    //-- Top\n    color(\"Magenta\")\n      translate([shellLength/2,shellWidth/2,shellHeight])\n        rotate([0,90,0])\n        rotate([0,0,45])\n          cube([1,1,shellLength], center=true);\n    color(\"Magenta\")\n      translate([shellLength/2,shellWidth/2,shellHeight])\n        rotate([0,90,90])\n        rotate([0,0,45])\n          cube([1,1,shellWidth], center=true);\n    //-- Bottom\n    color(\"Magenta\")\n      translate([shellLength/2,shellWidth/2,0])\n        rotate([0,90,0])\n        rotate([0,0,45])\n          cube([1,1,shellLength], center=true);\n    color(\"Magenta\")\n      translate([shellLength/2,shellWidth/2,0])\n        rotate([0,90,90])\n        rotate([0,0,45])\n          cube([1,1,shellWidth], center=true);\n  }\n}//-- drawCenterMarkers()\n\n//===========================================================\nmodule genOriginBars(color1, color2, coordSystem)\n{\n  // Main origins on base\n  genOriginPart(color1, color2, coordSystem);\n  \n  if (showSideBySide) \n  {\n    translate([0,(shellWidth+shiftLid)*2 ,shellHeight])\n    rotate([180,0,0])\n    genOriginPart(color1, color2, coordSystem);\n  }    \n}//-- genOriginBars()\n\n\n//===========================================================\nmodule genOriginPart(color1, color2, coordSystem)\n{\n  origin=(coordSystem[0]==yappCoordBox) ? [0,0,0]\n          : (coordSystem[0]==yappCoordBoxInside) ? [wallThickness,wallThickness,basePlaneThickness]\n          : (coordSystem[0]==yappCoordPCB) ? [getPCB_X(coordSystem[2]),getPCB_Y(coordSystem[2]),getPCB_Z(coordSystem[2])]\n          : undef;\n  \n  translate(origin)\n  union()\n  {\n    translate([-origin[0],0,0])\n    rotate([0,90,0])\n      genMarkerBar(color1, color2, \"X\");\n    translate([0,-origin[1],0])\n    rotate([-90,0,0])\n      genMarkerBar(color1, color2, \"Y\");\n    //-- Z doesn't need to rotate \n    translate([0,0,-origin[2]])\n    genMarkerBar(color1, color2, \"Z\");\n  }\n}//-- genOriginPart()\n\n\n//===========================================================\nmodule genMarkerBar(color1, color2, axis )\n{\n    barLength= (axis == \"X\") ? shellLength\n              :(axis == \"Y\") ? shellWidth\n              :(axis == \"Z\") ? shellHeight + ((!showSideBySide) ? onLidGap : 0)\n              : undef;\n  \n  union()\n  {\n    color(color1)\n      translate([0,0,barLength/2]) \n    cylinder(\n              d = 1,\n              h = barLength,\n              center = true);\n    color(color2)\n      translate([0,0,-5])  \n        cylinder(\n              d = 1,\n              h = 10,\n              center = true);\n    color(color2)\n      translate([0,0,barLength+5])  \n        cylinder(\n              d = 1,\n              h = 10,\n              center = true);\n  }\n}//-- genMarkerBar()\n\n\n//===========================================================\nmodule YAPPgenerate()\n//===========================================================\n{\n  echo(\"YAPP==========================================\");\n  echo(\"YAPP:PCB(s):\");\n  for (thePCB=pcb)\n  {\n    echo(str(\"YAPP:   pcbLength(\\\"\",thePCB[0],\"\\\") = \", pcbLength(thePCB[0])));\n    echo(str(\"YAPP:   pcbWidth(\\\"\",thePCB[0],\"\\\") = \", pcbWidth(thePCB[0])));\n    echo(str(\"YAPP:   pcbThickness(\\\"\",thePCB[0],\"\\\") = \", pcbThickness(thePCB[0])));\n    echo(str(\"YAPP:   standoffHeight(\\\"\",thePCB[0],\"\\\") = \", standoffHeight(thePCB[0])));\n    echo(str(\"YAPP:   standoffPinDiameter(\\\"\",thePCB[0],\"\\\") = \", standoffPinDiameter(thePCB[0])));\n    echo(str(\"YAPP:   standoffDiameter(\\\"\",thePCB[0],\"\\\") = \", standoffDiameter(thePCB[0])));\n    echo(str(\"YAPP:   standoffHoleSlack(\\\"\",thePCB[0],\"\\\") = \", standoffHoleSlack(thePCB[0])));\n   echo(\"YAPP------------------------------------------\");\n }  \n  echo(\"YAPP==========================================\");\n  echo(\"YAPP:\", paddingFront=paddingFront);\n  echo(\"YAPP:\", paddingBack=paddingBack);\n  echo(\"YAPP:\", paddingRight=paddingRight);\n  echo(\"YAPP:\", paddingLeft=paddingLeft);\n  echo(\"YAPP==========================================\");\n  echo(\"YAPP:\", buttonWall=buttonWall);\n  echo(\"YAPP:\", buttonPlateThickness=buttonPlateThickness);\n  echo(\"YAPP:\", buttonSlack=buttonSlack);\n  echo(\"YAPP==========================================\");\n  echo(\"YAPP:\", baseWallHeight=baseWallHeight);\n  echo(\"YAPP:\", lidWallHeight=lidWallHeight);\n  echo(\"YAPP:\", wallThickness=wallThickness);\n  echo(\"YAPP:\", basePlaneThickness=basePlaneThickness);\n  echo(\"YAPP:\", lidPlaneThickness=lidPlaneThickness);\n  echo(\"YAPP:\", ridgeHeight=ridgeHeight);\n  echo(\"YAPP:\", ridgeSlack=ridgeSlack);\n  echo(\"YAPP:\", ridgeGap=ridgeGap);\n  echo(\"YAPP:\", roundRadius=roundRadius);\n  echo(\"YAPP:\", boxType=boxType);\n  echo(\"YAPP==========================================\");\n  echo(\"YAPP:\", shellLength=shellLength);\n  echo(\"YAPP:\", shellInsideLength=shellInsideLength);\n  echo(\"YAPP:\", shellWidth=shellWidth);\n  echo(\"YAPP:\", shellInsideWidth=shellInsideWidth);\n  echo(\"YAPP:\", shellHeight=shellHeight);\n  echo(\"YAPP:\", shellInsideHeight=shellInsideHeight);\n  echo(\"YAPP==========================================\");\n  echo(\"YAPP:\", shiftLid=shiftLid);\n  echo(\"YAPP:\", onLidGap=onLidGap);\n  echo(\"YAPP==========================================\");\n  echo(str(\"YAPP: Version:\", Version));\n  echo(\"YAPP:   copyright by Willem Aandewiel\");\n  echo(\"YAPP==========================================\");\n  echo(\"YAPP:  Predefined Shapes:\");\n  \n  for (shape=preDefinedShapes)\n  {\n     echo(str(\"YAPP:    \",shape[0]));\n  }\n  echo(\"YAPP:  Predefined Masks:\");\n  \n  for (mask=preDefinedMasks)\n  {\n     echo(str(\"YAPP:    \",mask[0]));\n  }\n  echo(\"YAPP==========================================\");\n\n  $fn=facetCount;\n  \n  //-- Perform sanity checks\n\n  assert((baseWallHeight >= ridgeHeight), str(\"ridgeHeight \", ridgeHeight, \" must be less than or equal to baseWallHeight \", baseWallHeight) );\n  \n  sanityCheckList(pcbStands, \"pcbStands\", 2);\n  sanityCheckList(connectors, \"connectors\", 7);\n  sanityCheckList(cutoutsBase, \"cutoutsBase\", 6, 5, [yappRectangle, yappCircle, yappPolygon, yappRoundedRect, yappCircleWithFlats, yappCircleWithKey]);\n  sanityCheckList(cutoutsBase, \"cutoutsLid\", 6, 5, [yappRectangle, yappCircle, yappPolygon, yappRoundedRect, yappCircleWithFlats, yappCircleWithKey]);\n  sanityCheckList(cutoutsBase, \"cutoutsFront\", 6, 5, [yappRectangle, yappCircle, yappPolygon, yappRoundedRect, yappCircleWithFlats, yappCircleWithKey]);\n  sanityCheckList(cutoutsBase, \"cutoutsBack\", 6, 5, [yappRectangle, yappCircle, yappPolygon, yappRoundedRect, yappCircleWithFlats, yappCircleWithKey]);\n  sanityCheckList(cutoutsBase, \"cutoutsLeft\", 6, 5, [yappRectangle, yappCircle, yappPolygon, yappRoundedRect, yappCircleWithFlats, yappCircleWithKey]);\n  sanityCheckList(cutoutsBase, \"cutoutsRight\", 6, 5, [yappRectangle, yappCircle, yappPolygon, yappRoundedRect, yappCircleWithFlats, yappCircleWithKey]);\n  sanityCheckList(snapJoins, \"snapJoins\", 3, 2, [yappLeft, yappRight, yappFront, yappBack]);\n  sanityCheckList(lightTubes, \"lightTubes\", 7, 6, [yappCircle, yappRectangle]);\n  sanityCheckList(pushButtons, \"pushButtons\", 9);\n  sanityCheckList(boxMounts, \"boxMounts\", 5);\n  sanityCheckList(labelsPlane, \"labelsPlane\", 8, 4, [yappLeft, yappRight, yappFront, yappBack, yappLid, yappBase]);\n  sanityCheckList(imagesPlane, \"imagesPlane\", 6, 4, [yappLeft, yappRight, yappFront, yappBack, yappLid, yappBase]);\n\n  // Show the origins as needed\n  if ($preview && showOriginCoordBox)\n  {\n    genOriginBars(\"red\", \"darkRed\", [yappCoordBox]);\n  } // showOriginCoordBox\n  if ($preview && showOriginCoordBoxInside)\n  {\n    genOriginBars(\"green\", \"darkgreen\", [yappCoordBoxInside]);\n  } // showOriginCoordBoxInside\n  \n  if ($preview && showOriginCoordPCB)\n  {\n    // Loop through the PCB's\n    for ( thePCB = pcb ) {\n      genOriginBars(\"blue\", \"darkblue\", [yappCoordPCB, undef, thePCB[0]]);\n    }  \n    //qwqw\n  } // showOriginCoordPCB\n\n  difference() // Inspection cuts\n  {\n    union()\n    {\n      if (printBaseShell) \n      {        \n        if ($preview && showPCB)\n        {\n          showPCBs();\n        }\n        if (printMessages) echo (\"* Print base *\");\n// ****************************************************************               \n// xxxxx\n// Comment out difference() to see objects instead of cutting them from the base for debugging\n        difference()  // (a)\n        {\n          // Draw the base shell\n          baseShell();\n\n          // Remove parts of it\n          makeRidgeExt(yappPartBase,true);\n          makeCutouts(yappPartBase);\n          \n          shellConnectors(yappPartBase, true);\n    \n          // Draw the labels that are carved into the case\n          color(\"Red\") drawLabels(yappPartBase, true);\n          color(\"Red\") drawImages(yappPartBase, true);\n        } //  difference(a)\n        \n        // Draw the post base hooks\n        posZ00 = (baseWallHeight) + basePlaneThickness;\n        translate([(shellLength/2), shellWidth/2, posZ00])\n        {\n          minkowskiBox(yappPartBase, shellInsideLength, shellInsideWidth, baseWallHeight, roundRadius, basePlaneThickness, wallThickness, false);\n        }\n        \n      } // if printBaseShell ..\n      \n      if ($preview && showOrientation) \n      {\n        showOrientation();\n      }\n                  \n     if (printMessages) echo (\"* Print lid *\");\n     if (showSideBySide || !$preview)\n      {\n        if (printMessages) echo (\"***  Side by side  ***\");\n        //-- lid side-by-side\n        mirror([0,0,1])\n        {\n          mirror([0,1,0])\n          {\n            translate([0, (5 + shellWidth+(shiftLid/2))*-2, 0])\n            {\n              if (printLidShell)\n              {\n                drawLid();\n              } // printLidShell()\n              // Add button extenders\n              buildButtons(false);\n              addDisplayMounts(2); //-- Generate the clips\n            } // translate\n          } //  mirror  \n        } //  mirror  \n      }\n      else  // lid on base\n      {\n        if (printMessages) echo (\"***  Print lid on base  ***\");\n        translate([0, 0, (baseWallHeight+basePlaneThickness+\n                          lidWallHeight+lidPlaneThickness+onLidGap)])\n        {\n          if (printLidShell)\n          {\n            drawLid();\n          } // printLidShell()\n          // Add button extenders\n          buildButtons(false);\n        } //  translate ..\n      } // lid on top off Base  \n    } //union\n      \n    if ($preview) \n    {\n      //--- show inspection cut\n      if (inspectX != 0)\n      {\n        maskLength = shellLength * 3;\n        maskWidth = shellWidth * 3;\n        maskHeight = (baseWallHeight + lidWallHeight+ ridgeHeight) *2;\n        color(\"Salmon\",1)\n        if (!inspectXfromBack)\n        {\n          translate([inspectX, -shellWidth/2,-maskHeight/4])\n          cube([maskLength, maskWidth, maskHeight]);\n        }\n        else\n        {\n          translate([-maskLength + inspectX, -shellWidth/2,-maskHeight/4])\n          cube([maskLength, maskWidth, maskHeight]);\n        }\n      } //inspectX\n     \n      //--- show inspection cut\n      if (inspectY != 0)\n      {\n        maskLength = shellLength * 3;\n        maskWidth = shellWidth * 3;\n        maskHeight = (baseWallHeight + lidWallHeight+ ridgeHeight) *2;\n        color(\"Salmon\",1)\n        if (!inspectYfromLeft)\n        {\n          translate([-shellLength/2, inspectY, -maskHeight/4])\n          cube([maskLength, maskWidth, maskHeight]);\n        }\n        else\n        {\n          translate([-shellLength/2,-maskWidth + inspectY,-maskHeight/4])\n          cube([maskLength, maskWidth, maskHeight]);\n        }\n      } //inspectY\n\n      //--- show inspection cut\n      if (inspectZ != 0)\n      {\n        maskLength = shellLength * 3;\n        maskWidth = shellWidth * 3;\n        maskHeight = (baseWallHeight + lidWallHeight+ ridgeHeight) *2;\n        \n        color(\"Salmon\",1)\n        if (inspectZfromBottom)\n        {\n          translate([-shellLength/2, -shellWidth/2, inspectZ])\n          cube([maskLength, maskWidth, maskHeight]);\n        }\n        else\n        {\n          translate([-shellLength/2,-shellWidth/2,-maskHeight + inspectZ])\n          cube([maskLength, maskWidth, maskHeight]);\n        }\n      } //inspectZ\n    } // $preview\n  }// Inspection cuts \n} //-- YAPPgenerate()\n\n\n//===========================================================\nmodule makeSwitchExtender(shape, capLength, capWidth, capRadius, thickness, poleDiam, extHeight, aboveLid, thePolygon, buttonSlack)\n{\n  \n  //   -->|            |<-- shape=circle : Diameter=capWidth shape=square : capLength x capWidth\n  //\n  //      +------------+        - \n  //      |            |        ^ \n  //      |            |        | [-- thickness\n  //      |            |        v \n  //      +---+    +---+     ----\n  //          |    |         ^\n  //          |    |         |\n  //          |    |         |\n  //          |    |         |\n  //          |    |         |  [-- extHeight\n  //          |    |         |\n  //          |    |         |\n  //          |    |         |\n  //          |    |         v\n  //          +----+         -\n  //\n  //       -->|    |<-- poleDiam\n\n    translate([0,0,-thickness])\n      color(\"red\")\n        generateShape (shape, true, capLength, capWidth, thickness, capRadius, 0, thePolygon);\n      \n    //--- pole\n    translate([0, 0, (extHeight/-2)-thickness]) \n      color(\"orange\")\n        cylinder(d=(poleDiam-(buttonSlack)), h=extHeight, center=true);\n} //-- makeSwitchExtender()\n\n\n//===========================================================\n//-- switch Plate -----------\nmodule makeSwitchPlate(poleDiam, thickness, buttonSlack, snapSlack)\n{               \n                //      <---(7mm)----> \n                //      +---+    +---+  ^\n                //      |   |    |   |  | \n                //      |   |____|   |  |>-- thickness\n                //      |            |  | \n                //      +------------+  v \n                //          >----<------- poleDiam\n                //       \n  \n  difference()\n  {\n    color(\"green\")\n      cylinder(h=thickness, d=poleDiam+3, center=true);\n    translate([0,0,-0.5])\n      color(\"blue\")\n        cylinder(h=thickness, d=poleDiam-buttonSlack+snapSlack, center=true);\n  }    \n} //-- makeSwitchPlate\n\n\n//===========================================================\nmodule drawSwitchOnPCB(thePCB)\n{\n  if (len(pushButtons) > 0)\n  {\n    for(i=[0:len(pushButtons)-1])  \n    {\n      b=pushButtons[i];\n      \n      // Get the desired coordinate system    \n      // Calculate based on the Coordinate system\n      coordSystem = getCoordSystem(b, yappCoordPCB);\n      \n      // Check if the Switch is on this PCB\n      if (coordSystem[2] == thePCB[0])\n      {\n        posX   = b[0];\n        posY   = b[1];\n        \n        btnHeight = b[6];\n        btnTravel = min(b[7],0.5);\n        \n        posZb=basePlaneThickness + ((btnHeight-btnTravel)/2);\n        posZt=basePlaneThickness + btnHeight -(btnTravel/2);//+b[5]/2;\n        //-- Switch base - as a cube\n        translate([posX, posY, posZb])\n          color(\"black\") cube([5, 5, btnHeight-btnTravel], center=true);\n        //-- switchTravel indicator\n        translate([posX, posY, posZt]) \n          color(\"white\") cylinder(h=btnTravel, d=4, center=true);\n        }\n    }\n  }\n} //-- drawSwitchOnPCB\n\n\n//===========================================================\n// Display Mount \n// new Feature for v3.1\n\nmodule clip (capDiameter, capSlack, pinDiameter, pcbThickness, count)\n{\n  for(i = [0:1:count-1]) {\n    translate([i*(capDiameter+2),-10,-pcbThickness*1.5])\n    difference()\n    {\n    color (\"Yellow\")\n      translate([0,0,0])\n        cylinder (d=capDiameter, h=pcbThickness*1.5);\n    color (\"blue\")\n      //translate([0,0,(pcbThickness/2)+0.02])\n      translate([0,0,-0.01])\n       cylinder (d=pinDiameter+capSlack, h=(pcbThickness*1.5)+0.02);\n    } //difference\n  } // for loop\n} //clip\n\n//===========================================================\n//-- Create the Cutout through the lid and add the display mount \nmodule addDisplayMounts(mode)\n{\n  //for(displayMount=displayMounts)\n  //{\n    \n  if (len(displayMounts) > 0)\n  {\n    for(i=[0:len(displayMounts)-1])  \n    {\n      displayMount=displayMounts[i];\n\n\n\n    //-- Get the desired coordinate system    \n    theCoordSystem = getCoordSystem(displayMount, yappCoordBox);    \n    useCenter = (isTrue(yappCenter, displayMount));\n      \n    xPos = translate2Box_X (displayMount[0], yappLid, theCoordSystem);\n    yPos = translate2Box_Y (displayMount[1], yappLid, theCoordSystem);\n\n    displayWidth = displayMount[2];\n    displayHeight = displayMount[3];\n    pinInsetH= displayMount[4];\n    pinInsetV= displayMount[5];\n    pinDiameter = displayMount[6];\n    postOverhang  = pinDiameter;\n    postOffset = displayMount[7];\n    walltoPCBGap = displayMount[8];\n    pcbThickness  = displayMount[9];\n    windowWidth = displayMount[10];\n    windowHeight= displayMount[11];\n    windowOffsetH = displayMount[12];\n    windowOffsetV = displayMount[13];\n    bevel = displayMount[14];\n    rotation = getParamWithDefault(displayMount[15],0);         //-- Display rotation\n    capDiameter = getParamWithDefault(displayMount[16],pinDiameter*2);         //-- Display rotation\n    wallThickness = getParamWithDefault(displayMount[17],lidPlaneThickness);\n    \n    capSlack = getParamWithDefault(displayMount[18],0);         //-- capSlack\n    \n    useSelfThreading = isTrue(yappSelfThreading, displayMount) ? 1 : \n      isTrue(yappHalfSelfThreading, displayMount) ? 2 : 0;\n\n    \n\n    faceWidth = max(displayWidth + ((pinInsetH-pinDiameter/2 - postOverhang) * -2), windowWidth+(wallThickness*2));\n    faceHeight = max(displayHeight + ((pinInsetV-pinDiameter/2 - postOverhang) * -2), windowHeight+(wallThickness*2));\n\n    offsetX = (useCenter) ? 0 : faceWidth/2;\n    offsetY = (useCenter) ? 0 : faceHeight/2;\n        \n   echo(xPos=xPos, yPos=yPos, displayWidth=displayWidth, faceWidth=faceWidth, faceHeight=faceHeight, offsetX=offsetX, offsetY=offsetY);\n   \n   if (mode == 0) \n   {\n    //-- Do the Cutout in the lid\n    tmpArray = [[0, 0, faceWidth, faceHeight, 0, yappRectangle, 0, 0, yappCoordBox, (useCenter) ?yappCenter : undef]];\n    translate([xPos,yPos,0])\n    {\n      color(\"green\")\n      rotate([0,0,rotation])\n      processFaceList(yappLid, tmpArray, yappPartLid, \"cutout\", true);\n    }// translate\n   }//(mode == 0)\n   \n   if (mode == 1) \n   //-- Generate the Mount\n   {\n     //-- Add the Mount\n     translate([xPos+offsetX,yPos+offsetY,0])\n     rotate([0,0,rotation])\n      displayMount(\n        displayWidth,\n        displayHeight,\n        wallThickness,\n        pinInsetH,\n        pinInsetV,\n        pinDiameter,\n        postOverhang,\n        walltoPCBGap,\n        pcbThickness,\n        windowWidth,\n        windowHeight,\n        windowOffsetH,\n        windowOffsetV,\n        bevel,\n        postOffset/2,\n        useSelfThreading);\n   }//(mode == 1)\n   if (mode == 2) \n   //-- Generate the clips\n   {\n    // if ((printDisplayClips) && (!useSelfThreading))\n     if (printDisplayClips)\n     {\n       translate ([0,i*-10,0])\n        clip (capDiameter, capSlack,  pinDiameter, pcbThickness, 1);\n     }\n   }//(mode == 2)\n  } //-- for displayMounts\n}\n} //-- addDisplayMounts()\n\nmodule displayMount(\n          displayWidth,\n          displayHeight,\n          wallThickness,\n          pinInsetH,\n          pinInsetV,\n          pinDiameter,\n          postOverhang,\n          walltoPCBGap,\n          pcbThickness,\n          windowWidth,\n          windowHeight,\n          windowOffsetH,\n          windowOffsetV,\n          bevel,\n          postOffset,\n          useSelfThreading,\n        ) \n{\n  mirror([0,0,1])\n  {\n    translate([-(displayWidth)/2,-(displayHeight)/2, 0])//1.5*5/2])\n    {\n      difference()\n      {\n        union()\n        {\n          color(\"green\") \n          {\n            //-- Stands\n            translate([pinInsetH - postOffset,pinInsetV - postOffset,walltoPCBGap/2+wallThickness ])\n              cube([pinDiameter+postOverhang,pinDiameter+postOverhang,walltoPCBGap], center=true);\n\n            translate([displayWidth-(pinInsetH-postOffset),(pinInsetV-postOffset),walltoPCBGap/2+wallThickness])\n              cube([pinDiameter+postOverhang,pinDiameter+postOverhang,walltoPCBGap], center=true);\n            \n            //-- Stands\n            translate([(pinInsetH-postOffset),displayHeight-(pinInsetV-postOffset),walltoPCBGap/2+wallThickness])\n              cube([pinDiameter+postOverhang,pinDiameter+postOverhang,walltoPCBGap], center=true);\n\n            translate([displayWidth-(pinInsetH-postOffset),displayHeight-(pinInsetV-postOffset),walltoPCBGap/2+wallThickness])\n              cube([pinDiameter+postOverhang,pinDiameter+postOverhang,walltoPCBGap], center=true);\n          }// color\n\n          if (useSelfThreading == 0)\n          {\n            echo(\"Display Pins\", pinDiameter=pinDiameter);\n            color(\"blue\")\n            {\n              //--pins\n              translate([pinInsetH,pinInsetV,walltoPCBGap+lidPlaneThickness])\n                cylinder (d=pinDiameter, h=pcbThickness*2);\n\n              translate([pinInsetH,displayHeight-pinInsetV,walltoPCBGap+lidPlaneThickness])\n                cylinder (d=pinDiameter, h=pcbThickness*2);\n\n              translate([displayWidth-pinInsetH,pinInsetV,walltoPCBGap+lidPlaneThickness])\n                cylinder (d=pinDiameter, h=pcbThickness*2);\n\n              translate([displayWidth-pinInsetH,displayHeight-pinInsetV,walltoPCBGap+lidPlaneThickness])\n                cylinder (d=pinDiameter, h=pcbThickness*2);\n            }// color\n          } // not Self Threading\n          \n          if (useSelfThreading == 2)\n        {\n          //--echo(\"***** Add the two needed pins *****\");\n          color(\"blue\")\n          {\n            //--pins\n              translate([pinInsetH,displayHeight-pinInsetV,walltoPCBGap+lidPlaneThickness])\n                cylinder (d=pinDiameter, h=pcbThickness*2);\n\n              translate([displayWidth-pinInsetH,pinInsetV,walltoPCBGap+lidPlaneThickness])\n                cylinder (d=pinDiameter, h=pcbThickness*2);\n\n                }// color\n        } // if(useSelfThreading=2)\n          \n          \n        }// Union\n//qqqqq\n        if (useSelfThreading == 1)\n        {\n          //--echo(\"***** Add the self tapping holes *****\");\n          color(\"blue\")\n          {\n            //--pins\n            translate([pinInsetH,pinInsetV,lidPlaneThickness])\n            self_forming_screw(\n                d=pinDiameter,\n                h=walltoPCBGap + 0.02, \n                center=false);   \n\n            translate([pinInsetH,displayHeight-pinInsetV,lidPlaneThickness])\n            self_forming_screw(\n                d=pinDiameter,\n                h=walltoPCBGap + 0.02, \n                center=false);   \n\n            translate([displayWidth-pinInsetH,pinInsetV,lidPlaneThickness])\n            self_forming_screw(\n                d=pinDiameter,\n                h=walltoPCBGap + 0.02, \n                center=false);   \n\n            translate([displayWidth-pinInsetH,displayHeight-pinInsetV,lidPlaneThickness])\n            self_forming_screw(\n                d=pinDiameter,\n                h=walltoPCBGap + 0.02, \n                center=false);   \n          }// color\n        } // if(useSelfThreading=1)\n\n          if (useSelfThreading == 2)\n        {\n          //--echo(\"***** Add the self tapping holes *****\");\n          color(\"blue\")\n          {\n            //--Self Forming holes\n            translate([pinInsetH,pinInsetV,lidPlaneThickness])\n            self_forming_screw(\n                d=pinDiameter,\n                h=walltoPCBGap + 0.02, \n                center=false);   \n\n            translate([displayWidth-pinInsetH,displayHeight-pinInsetV,lidPlaneThickness])\n            self_forming_screw(\n                d=pinDiameter,\n                h=walltoPCBGap + 0.02, \n                center=false);   \n\n                }// color\n        } // if(useSelfThreading=2)\n\n        } //difference\n    }// translate\n    \n    faceWidth = max(displayWidth + ((pinInsetH-pinDiameter/2 - postOverhang) * -2), windowWidth+(wallThickness*2))+0.1;\n    faceHeight = max(displayHeight + ((pinInsetV-pinDiameter/2 - postOverhang) * -2), windowHeight+(wallThickness*2))+0.1;\n    \n    xScale = (bevel) ? 1 + (((wallThickness+ 0.00)*2)/windowWidth) : 1;\n    yScale = (bevel) ? 1 + (((wallThickness+ 0.00)*2)/windowHeight) : 1;\n    \n    // Beveled Faceplate\n    difference()\n    {\n      //-- faceplate\n      color(\"Grey\")\n      translate([0,0, wallThickness/2])\n        cube([faceWidth,faceHeight, wallThickness],center=true);\n      \n      //-- Cutout Opening\n      translate([windowOffsetH, windowOffsetV, wallThickness + 0.02]) \n      {\n        rotate([180,0,0])\n        // Bevel out at a either 90 or 45deg angle based on bevel parameter\n        linear_extrude(wallThickness + 0.04, scale = [xScale,yScale])\n          square([windowWidth,windowHeight],center=true);\n      }// translate \n    }// difference\n  }// mirror\n} //displayMount\n\n\n//===========================================================\n//===========================================================\n// General functions\n//===========================================================\n//===========================================================\nfunction getMinRad(p1, wall) = \n  p1<wall ? 1      // if Radius is < wall then return 1\n  : (p1==wall ? 1 // if they are equal then return 1\n  : p1 - wall);    // otherwise return the difference \n\n// Check the first 21 elements in an array (I don't think any will be over 21)\nfunction isTrue(constantValue, setArray) = (\n  (   setArray[0] == constantValue \n   || setArray[1] == constantValue \n   || setArray[2] == constantValue \n   || setArray[3] == constantValue \n   || setArray[4] == constantValue \n   || setArray[5] == constantValue \n   || setArray[6] == constantValue \n   || setArray[7] == constantValue \n   || setArray[8] == constantValue \n   || setArray[9] == constantValue \n   || setArray[10] == constantValue \n   || setArray[11] == constantValue \n   || setArray[12] == constantValue \n   || setArray[13] == constantValue \n   || setArray[14] == constantValue \n   || setArray[15] == constantValue \n   || setArray[16] == constantValue \n   || setArray[17] == constantValue \n   || setArray[18] == constantValue \n   || setArray[19] == constantValue ) ? 1 : 0);  \n   \n//===========================================================\n \nfunction minOutside(ins, outs) = ((((ins*1.5)+0.2)>=outs) ? (ins*1.5)+0.2 : outs);  \n\nfunction countersinkHeight(conn) = (conn[4] / 2) / tan (countersinkAngle / 2);\n\nfunction maxLength(v, i = 0, r = 0) = i < len(v) ? maxLength(v, i + 1, max(r, v[i][1] + v[i][3])) : r;\nfunction maxWidth(v, i = 0, r = 0) = i < len(v) ? maxWidth(v, i + 1, max(r, v[i][2] + v[i][4])) : r;\n\nfunction pcbByName(pcbName=\"Main\") = getVectorBase(pcbName, pcb);\n\nfunction getPCBInfo(yappPCBName, vector) = (getVector(yappPCBName, vector) == false) ? pcbByName(\"Main\") : pcbByName(getVector(yappPCBName, vector));\n\nfunction getPCBName(yappPCBName, vector) = (getVector(yappPCBName, vector) == false) ? \"Main\" : pcbByName(getVector(yappPCBName, vector))[0];\n\n//-- Change to reference the top of the PCB not the bottom\nfunction getPCB_X(pcbName=\"Main\") = pcbX(pcbName) + wallThickness + paddingBack; \nfunction getPCB_Y(pcbName=\"Main\") = pcbY(pcbName) + wallThickness + paddingLeft; \nfunction getPCB_Z(pcbName=\"Main\") = standoffHeight(pcbName) + pcbThickness(pcbName) +  basePlaneThickness; \n\nfunction pcbLength(pcbName=\"Main\") = (getVectorBase(pcbName, pcb))[1]; \nfunction pcbWidth(pcbName=\"Main\") = (getVectorBase(pcbName, pcb))[2]; \nfunction pcbThickness(pcbName=\"Main\") = (getVectorBase(pcbName, pcb))[5]; \nfunction pcbX(pcbName=\"Main\") = (getVectorBase(pcbName, pcb))[3]; \nfunction pcbY(pcbName=\"Main\") = (getVectorBase(pcbName, pcb))[4]; \n//-- Change to allow for negative to reference the distance above the PCB\nfunction standoffHeight(pcbName=\"Main\") = \n  ((getVectorBase(pcbName, pcb))[6] < 0) \n    ? shellInsideHeight - pcbThickness(pcbName) + (getVectorBase(pcbName, pcb))[6]\n    : (getVectorBase(pcbName, pcb))[6]; \n\nfunction standoffDiameter(pcbName=\"Main\") = (getVectorBase(pcbName, pcb))[7]; \nfunction standoffPinDiameter(pcbName=\"Main\") = (getVectorBase(pcbName, pcb))[8]; \nfunction standoffHoleSlack(pcbName=\"Main\") = (getVectorBase(pcbName, pcb))[9]; \n\nfunction getParamWithDefault (theParam, theDefault) =\n(\n  (theParam==undef) ? theDefault :\n  (is_list(theParam)) ? theDefault :\n  (theParam<= -30000) ? theDefault :\n    theParam\n);\n\n\nfunction getShapeWithDefault (theParam, theDefault) =\n(\n  (theParam==undef) ? theDefault :\n  (is_list(theParam)) ? theDefault :\n  (theParam<= -30100) ? theDefault :\n    theParam\n);\n\nfunction getYappValueWithDefault (theParam, theDefault) =\n(\n  (theParam==undef) ? theDefault :\n  (is_list(theParam)) ? theDefault :\n  (theParam > -30000) ? theDefault :\n    theParam\n);\n\nfunction getPartName(face) = \n  (face==yappPartBase) ? \"yappPartBase\" :\n  (face==yappPartLid) ? \"yappPartLid\" :\n  (face==yappLeft) ? \"yappLeft\" :\n  (face==yappRight) ? \"yappRight\" :\n  (face==yappFront) ? \"yappFront\" :\n  (face==yappBack) ? \"yappBack\" :\n  (face==yappLid) ? \"yappLid\" :\n  (face==yappBase) ? \"yappBase\" : \"\";\n\n  \n// Return vector that starts with Identifier\nfunction getVectorBase(identifier, setArray) = \n  ( setArray[0][0] == identifier) ? setArray[0] : \n  ( setArray[1][0] == identifier) ? setArray[1] : \n  ( setArray[2][0] == identifier) ? setArray[2] : \n  ( setArray[3][0] == identifier) ? setArray[3] : \n  ( setArray[4][0] == identifier) ? setArray[4] : \n  ( setArray[5][0] == identifier) ? setArray[5] : \n  ( setArray[6][0] == identifier) ? setArray[6] : \n  ( setArray[7][0] == identifier) ? setArray[7] : \n  ( setArray[8][0] == identifier) ? setArray[8] : \n  ( setArray[9][0] == identifier) ? setArray[9] : \n  ( setArray[10][0] == identifier) ? setArray[10] : \n  ( setArray[11][0] == identifier) ? setArray[11] : \n  ( setArray[12][0] == identifier) ? setArray[12] : \n  ( setArray[13][0] == identifier) ? setArray[13] : \n  ( setArray[14][0] == identifier) ? setArray[14] : \n  ( setArray[15][0] == identifier) ? setArray[15] : \n  ( setArray[16][0] == identifier) ? setArray[16] : \n  ( setArray[17][0] == identifier) ? setArray[17] : \n  ( setArray[18][0] == identifier) ? setArray[18] : \n  ( setArray[19][0] == identifier) ? setArray[19] : false ;\n  \n  \n  \n// Return vector that starts with Identifier\nfunction getVector(identifier, setArray) = \n  ( setArray[0][0] == identifier) ? setArray[0][1] : \n  ( setArray[1][0] == identifier) ? setArray[1][1] : \n  ( setArray[2][0] == identifier) ? setArray[2][1] : \n  ( setArray[3][0] == identifier) ? setArray[3][1] : \n  ( setArray[4][0] == identifier) ? setArray[4][1] : \n  ( setArray[5][0] == identifier) ? setArray[5][1] : \n  ( setArray[6][0] == identifier) ? setArray[6][1] : \n  ( setArray[7][0] == identifier) ? setArray[7][1] : \n  ( setArray[8][0] == identifier) ? setArray[8][1] : \n  ( setArray[9][0] == identifier) ? setArray[9][1] : \n  ( setArray[10][0] == identifier) ? setArray[10][1] : \n  ( setArray[11][0] == identifier) ? setArray[11][1] : \n  ( setArray[12][0] == identifier) ? setArray[12][1] : \n  ( setArray[13][0] == identifier) ? setArray[13][1] : \n  ( setArray[14][0] == identifier) ? setArray[14][1] : \n  ( setArray[15][0] == identifier) ? setArray[15][1] : \n  ( setArray[16][0] == identifier) ? setArray[16][1] : \n  ( setArray[17][0] == identifier) ? setArray[17][1] : \n  ( setArray[18][0] == identifier) ? setArray[18][1] : \n  ( setArray[19][0] == identifier) ? setArray[19][1] : false ;\n  \n  \n// Return vector that starts with Identifier\nfunction getVectorInVector(identifier, setArray) = \n  ( setArray[0][0][0] == identifier) ? setArray[0] : \n  ( setArray[1][0][0] == identifier) ? setArray[1] : \n  ( setArray[2][0][0] == identifier) ? setArray[2] : \n  ( setArray[3][0][0] == identifier) ? setArray[3] : \n  ( setArray[4][0][0] == identifier) ? setArray[4] : \n  ( setArray[5][0][0] == identifier) ? setArray[5] : \n  ( setArray[6][0][0] == identifier) ? setArray[6] : \n  ( setArray[7][0][0] == identifier) ? setArray[7] : \n  ( setArray[8][0][0] == identifier) ? setArray[8] : \n  ( setArray[9][0][0] == identifier) ? setArray[9] : \n  ( setArray[10][0][0] == identifier) ? setArray[10] : \n  ( setArray[11][0][0] == identifier) ? setArray[11] : \n  ( setArray[12][0][0] == identifier) ? setArray[12] : \n  ( setArray[13][0][0] == identifier) ? setArray[13] : \n  ( setArray[14][0][0] == identifier) ? setArray[14] : \n  ( setArray[15][0][0] == identifier) ? setArray[15] : \n  ( setArray[16][0][0] == identifier) ? setArray[16] : \n  ( setArray[17][0][0] == identifier) ? setArray[17] : \n  ( setArray[18][0][0] == identifier) ? setArray[18] : \n  ( setArray[19][0][0] == identifier) ? setArray[19] : false ;  \n  \n// Extract the Coordinate System from a list falling back to a default if none is found.  \nfunction getCoordSystem(list, default) =\n  [\n  isTrue(yappCoordPCB, list) ? yappCoordPCB \n  : isTrue(yappCoordBox, list) ? yappCoordBox \n  : isTrue(yappCoordBoxInside, list) ? yappCoordBoxInside\n  : default\n  ,\n  isTrue(yappAltOrigin, list) ? yappAltOrigin \n  : isTrue(yappGlobalOrigin, list) ? yappGlobalOrigin \n  : yappGlobalOrigin\n  ,\n  getPCBName(yappPCBName, list)\n  ];\n\n// Translate from PCB coordinates to Outside Box Coordinates\nfunction translate2Box_X (value, face, sourceSystem) =\n  (sourceSystem[0] == yappCoordPCB) && (face==yappLid)          ? value + getPCB_X(sourceSystem[2]) :\n  (sourceSystem[0] == yappCoordPCB) && (face==yappLeft)         ? value + getPCB_X(sourceSystem[2]) :\n  (sourceSystem[0] == yappCoordPCB) && (face==yappFront)        ? value + getPCB_Y(sourceSystem[2]) :\n  (sourceSystem[0] == yappCoordPCB) && (face==yappBase)         ? (sourceSystem[1] == yappAltOrigin) ? shellLength - (value  + getPCB_X(sourceSystem[2])) - wallThickness - paddingFront : value + getPCB_X(sourceSystem[2]) :\n  (sourceSystem[0] == yappCoordPCB) && (face==yappRight)        ? (sourceSystem[1] == yappAltOrigin) ? shellLength - (value  + getPCB_X(sourceSystem[2])) - wallThickness - paddingFront : value + getPCB_X(sourceSystem[2]) :\n  (sourceSystem[0] == yappCoordPCB) && (face==yappBack)         ? (sourceSystem[1] == yappAltOrigin) ? shellWidth  - (value  + getPCB_Y(sourceSystem[2])) - wallThickness - paddingRight : value + getPCB_Y(sourceSystem[2]) :\n  \n  (sourceSystem[0] == yappCoordBoxInside) && (face==yappBase)   ? value + wallThickness :\n  (sourceSystem[0] == yappCoordBoxInside) && (face==yappLeft)   ? value + wallThickness :\n  (sourceSystem[0] == yappCoordBoxInside) && (face==yappFront)  ? value + wallThickness :\n  (sourceSystem[0] == yappCoordBoxInside) && (face==yappLid)    ? (sourceSystem[1] == yappAltOrigin) ? shellInsideLength - value + wallThickness : value + wallThickness :\n  (sourceSystem[0] == yappCoordBoxInside) && (face==yappRight)  ? (sourceSystem[1] == yappAltOrigin) ? shellInsideLength - value + wallThickness : value + wallThickness :\n  (sourceSystem[0] == yappCoordBoxInside) && (face==yappBack)   ? (sourceSystem[1] == yappAltOrigin) ? shellWidth - value - wallThickness : value + wallThickness :\n\n  (sourceSystem[0] == yappCoordBox) && (face==yappLid)          ? (sourceSystem[1] == yappAltOrigin) ? shellLength - value : value :\n  (sourceSystem[0] == yappCoordBox) && (face==yappRight)        ? (sourceSystem[1] == yappAltOrigin) ? shellLength - value : value :\n  (sourceSystem[0] == yappCoordBox) && (face==yappBack)         ? (sourceSystem[1] == yappAltOrigin) ? shellWidth  - value : value :\n  value;\n  \nfunction translate2Box_Y (value, face, sourceSystem) =\n  (sourceSystem[0] == yappCoordPCB) && (face==yappBase)         ? value + getPCB_Y(sourceSystem[2]) :\n  (sourceSystem[0] == yappCoordPCB) && (face==yappLeft)         ? value + getPCB_Z(sourceSystem[2]) :\n  (sourceSystem[0] == yappCoordPCB) && (face==yappFront)        ? value + getPCB_Z(sourceSystem[2]) :\n  \n  (sourceSystem[0] == yappCoordPCB) && (face==yappLid)          ? value + getPCB_Y(sourceSystem[2]) :\n  (sourceSystem[0] == yappCoordPCB) && (face==yappRight)        ? value + getPCB_Z(sourceSystem[2]) :\n  (sourceSystem[0] == yappCoordPCB) && (face==yappBack)         ? value + getPCB_Z(sourceSystem[2]) :\n  \n  (sourceSystem[0] == yappCoordBoxInside) && (face==yappBase)   ? value + wallThickness :\n  (sourceSystem[0] == yappCoordBoxInside) && (face==yappLeft)   ? value + basePlaneThickness :\n  (sourceSystem[0] == yappCoordBoxInside) && (face==yappFront)  ? value + basePlaneThickness :\n  \n  (sourceSystem[0] == yappCoordBoxInside) && (face==yappLid)    ? value + wallThickness :\n  (sourceSystem[0] == yappCoordBoxInside) && (face==yappRight)  ? value + basePlaneThickness :\n  (sourceSystem[0] == yappCoordBoxInside) && (face==yappBack)   ? value + basePlaneThickness :\n  value;\n  \nfunction translate2Box_Z (value, face, sourceSystem) =\n  (sourceSystem[0] == yappCoordPCB) && (face==yappBase)         ? value + getPCB_Z(sourceSystem[2]) :\n  (sourceSystem[0] == yappCoordPCB) && (face==yappLeft)         ? value + getPCB_Y(sourceSystem[2])  :\n  (sourceSystem[0] == yappCoordPCB) && (face==yappFront)        ? value + getPCB_X(sourceSystem[2])  :\n  \n  (sourceSystem[0] == yappCoordPCB) && (face==yappLid)          ? value + getPCB_Z(sourceSystem[2]) :\n  (sourceSystem[0] == yappCoordPCB) && (face==yappRight)        ? value + getPCB_Y(sourceSystem[2])  :\n  (sourceSystem[0] == yappCoordPCB) && (face==yappBack)         ? value + getPCB_X(sourceSystem[2])  :\n  \n  (sourceSystem[0] == yappCoordBoxInside) && (face==yappBase)   ? value + basePlaneThickness :\n  (sourceSystem[0] == yappCoordBoxInside) && (face==yappLeft)   ? value + wallThickness :\n  (sourceSystem[0] == yappCoordBoxInside) && (face==yappFront)  ? value + wallThickness :\n  \n  (sourceSystem[0] == yappCoordBoxInside) && (face==yappLid)    ? value + basePlaneThickness :\n  (sourceSystem[0] == yappCoordBoxInside) && (face==yappRight)  ? value + wallThickness :\n  (sourceSystem[0] == yappCoordBoxInside) && (face==yappBack)   ? value + wallThickness :\n  value;\n\n\nfunction getLength(sourceSystem) =\n  (sourceSystem[0] == yappCoordPCB) ? pcbLength(sourceSystem[2]): //pcb_Length :\n  (sourceSystem[0] == yappCoordBoxInside) ? shellInsideLength :\n  (sourceSystem[0] == yappCoordBox) ? shellLength :\n  undef;\n\n\nfunction getWidth(sourceSystem) =\n  (sourceSystem[0] == yappCoordPCB) ? pcbWidth(sourceSystem[2]): //? pcb_Width :\n  (sourceSystem[0] == yappCoordBoxInside) ? shellInsideWidth :\n  (sourceSystem[0] == yappCoordBox) ? shellWidth :\n  undef;\n\n\nfunction getHeight(sourceSystem) =\n  (sourceSystem == yappCoordPCB) ? standoffHeight(sourceSystem[2]) + pcbThickness(sourceSystem[2]): //standoffHeight + pcb_Thickness :\n  (sourceSystem == yappCoordBoxInside) ? shellInsideHeight :\n  (sourceSystem == yappCoordBox) ? shellHeight :\n  undef;\n\n//===========================================================\n//===========================================================\n// End of General functions\n//===========================================================\n//===========================================================\n\n\n//===========================================================\n//===========================================================\n// Beginning of test modules \n//===========================================================\n//===========================================================\n \n//=========================================================== \nmodule TestCoordTranslations()\n{\n  module TestPCB2Box(x,y,z, face, sourceCoord)\n  {\n    X = translate2Box_X (x, face, sourceCoord);\n    Y = translate2Box_Y (y, face, sourceCoord);\n    Z = translate2Box_Y (z, face, sourceCoord);\n    echo (str(getPartName(face), \" sourceCoord\", sourceCoord, \" to Box Coord [X=\" , x, \", y=\", y, \", z=\", z, \"] -> [x=\" , X, \", y=\", Y, \", z=\", Z, \"] for PCB \"));\n  }\n  module TestX2LeftOrigin(x, face)\n  {\n    X = translateX2LeftOrigin (x, face);\n    echo (str(getPartName(face), \" X to LeftOrigin [\" , x, \"] -> [\" , X, \"]\"));\n  }\n  \n  TestPCB2Box(0,0,0, yappLeft, [yappCoordPCB, undef, \"Main\"]);\n  TestPCB2Box(0,0,0, yappRight, [yappCoordPCB, undef, \"Main\"]);\n  TestPCB2Box(0,0,0, yappFront, [yappCoordPCB, undef, \"Main\"]);\n  TestPCB2Box(0,0,0, yappBack, [yappCoordPCB, undef, \"Main\"]);\n  TestPCB2Box(0,0,0, yappLid, [yappCoordPCB, undef, \"Main\"]);\n  TestPCB2Box(0,0,0, yappBase, [yappCoordPCB, undef, \"Main\"]);\n  \n  /*\n  TestPCB2Box(0,0,0, yappLeft, [yappCoordPCB, yappAltOrigin]);\n  TestPCB2Box(0,0,0, yappRight, [yappCoordPCB, yappAltOrigin]);\n  TestPCB2Box(0,0,0, yappFront, [yappCoordPCB, yappAltOrigin]);\n  TestPCB2Box(0,0,0, yappBack, [yappCoordPCB, yappAltOrigin]);\n  TestPCB2Box(0,0,0, yappLid, [yappCoordPCB, yappAltOrigin]);\n  TestPCB2Box(0,0,0, yappBase, [yappCoordPCB, yappAltOrigin]);\n    \n  TestPCB2Box(0,0,0, yappLeft, [yappCoordBoxInside]);\n  TestPCB2Box(0,0,0, yappRight, [yappCoordBoxInside]);\n  TestPCB2Box(0,0,0, yappFront, [yappCoordBoxInside]);\n  TestPCB2Box(0,0,0, yappBack, [yappCoordBoxInside]);\n  TestPCB2Box(0,0,0, yappLid, [yappCoordBoxInside]);\n  TestPCB2Box(0,0,0, yappBase, [yappCoordBoxInside]);\n  \n  TestPCB2Box(0,0,0, yappLeft, [yappCoordBoxInside, yappAltOrigin]);\n  TestPCB2Box(0,0,0, yappRight, [yappCoordBoxInside, yappAltOrigin]);\n  TestPCB2Box(0,0,0, yappFront, [yappCoordBoxInside, yappAltOrigin]);\n  TestPCB2Box(0,0,0, yappBack, [yappCoordBoxInside, yappAltOrigin]);\n  TestPCB2Box(0,0,0, yappLid, [yappCoordBoxInside, yappAltOrigin]);\n  TestPCB2Box(0,0,0, yappBase, [yappCoordBoxInside, yappAltOrigin]);\n      \n  TestPCB2Box(0,0,0, yappLeft, [yappCoordBox]);\n  TestPCB2Box(0,0,0, yappRight, [yappCoordBox]);\n  TestPCB2Box(0,0,0, yappFront, [yappCoordBox]);\n  TestPCB2Box(0,0,0, yappBack, [yappCoordBox]);\n  TestPCB2Box(0,0,0, yappLid, [yappCoordBox]);\n  TestPCB2Box(0,0,0, yappBase, [yappCoordBox]);\n  \n  TestPCB2Box(0,0,0, yappLeft, [yappCoordBox, yappAltOrigin]);\n  TestPCB2Box(0,0,0, yappRight, [yappCoordBox, yappAltOrigin]);\n  TestPCB2Box(0,0,0, yappFront, [yappCoordBox, yappAltOrigin]);\n  TestPCB2Box(0,0,0, yappBack, [yappCoordBox, yappAltOrigin]);\n  TestPCB2Box(0,0,0, yappLid, [yappCoordBox, yappAltOrigin]);\n  TestPCB2Box(0,0,0, yappBase, [yappCoordBox, yappAltOrigin]);\n  */\n} //TestCoordTranslations\n\n//TestCoordTranslations();\n\n//===========================================================\n// Test module for making masks\nmodule SampleMask(theMask)\n{\n//genMaskfromParam(params,  width, height, depth, hOffset, vOffset, addRot)\n  genMaskfromParam(theMask[1], 100,   100,    2,     0,       0,       0);\n}\n//SampleMask( maskHoneycomb);\n\n//===========================================================\n// Test module for making Polygons\nmodule SamplePolygon(thePolygon)\n{\n  scale([100,100,1]){\n    linear_extrude(2)\n      polygon(thePolygon[1]);\n  }\n} // SamplePolygon\n\n// -- Sample test calls --\n//SamplePolygon( shape6ptStar);\n\n\n//===========================================================\n//===========================================================\n// End of test modules \n//===========================================================\n//===========================================================\n\n//---- This is where the magic happens ----\nif (debug) \n{\n  YAPPgenerate();\n}\n\n/*\n****************************************************************************\n*\n* Permission is hereby granted, free of charge, to any person obtaining a\n* copy of this software and associated documentation files (the\n* \"Software\"), to deal in the Software without restriction, including\n* without limitation the rights to use, copy, modify, merge, publish,\n* distribute, sublicense, and/or sell copies of the Software, and to permit\n* persons to whom the Software is furnished to do so, subject to the\n* following conditions:\n*\n* The above copyright notice and this permission notice shall be included\n* in all copies or substantial portions of the Software.\n*\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT\n* OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR\n* THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n* \n****************************************************************************\n*/\n\n// Other Libraries used\n\n/*\nround-anything\n\nCopyright 2020 Kurt Hutten\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n// Only part of round-anything is used\nfunction sq(x)=x*x;\n\n//===========================================================\nmodule extrudeWithRadius(length,r1=0,r2=0,fn=30){\n  n1=sign(r1);n2=sign(r2);\n  r1=abs(r1);r2=abs(r2);\n  translate([0,0,r1]){\n    linear_extrude(length-r1-r2){\n      children();\n    }\n  }\n  for(i=[0:fn]){\n    translate([0,0,i/fn*r1]){\n      linear_extrude(r1/fn+0.01){\n        offset(n1*sqrt(sq(r1)-sq(r1-i/fn*r1))-n1*r1){\n          children();\n        }\n      }\n    }\n    translate([0,0,length-r2+i/fn*r2]){\n      linear_extrude(r2/fn+0.01){\n        offset(n2*sqrt(sq(r2)-sq(i/fn*r2))-n2*r2){\n          children();\n        }\n      }\n    }\n  }\n} //-- extrudeWithRadius()\n\n\n//-- Self Forming thread functions - START\n\nmodule main_cylinder(height=10, diameter=3,center=false) {\n    cylinder(h=height, d=diameter, $fn=facetCount, center=center);\n}\n\n// Funkcia na výpočet priemeru výrezového valca\n// Function to calculate the diameter of the cutout cylinder\nfunction hole_diameter(main_diameter) = sqrt((2 / 4.5) * main_diameter * main_diameter);\n\n// Funkcia na výpočet vzdialenosti výrezových valcov od stredu\n// Function to calculate the distance of the cutout cylinders from the center\nfunction hole_distance(main_diameter) = (main_diameter / 2.31) + (hole_diameter(main_diameter) / 2);\n\n// Funkcia na výpočet výšky valca bez zaoblenia\n// Function to calculate the height of a cylinder without rounding\nfunction cylinder_height(main_height, hole_diameter) = main_height - hole_diameter/2;\n\n// Modul pre výrezový valec so zaoblenými koncami\n// Module for a cutout cylinder with rounded ends\nmodule rounded_hole_cylinder(main_height, main_diameter) {\n    hole_d = hole_diameter(main_diameter);\n    cylinder_h = cylinder_height(main_height, hole_d);\n\n    union() {\n        // Valec\n        // Cylinder\n        translate([0, 0, hole_d / 4])\n            cylinder(h=cylinder_h, d=hole_d, $fn=facetCount);\n        // Horná guľa pre zaoblenie\n        // Top ball for rounding\n        translate([0, 0, hole_d / 4 + cylinder_h ])\n            sphere(r=hole_d / 2, $fn=facetCount);\n        // Dolná guľa pre zaoblenie\n        // Bottom ball for rounding\n     //   translate([0, 0, hole_d /2 ])\n        translate([0, 0, hole_d /4 ])\n            sphere(r=hole_d / 2, $fn=facetCount);\n    }\n}\n\n//Hlavny modul\n//Main module\nmodule self_forming_screw(h=10, d=3,center=false) {\n    main_height=h;\n    main_diameter=d;\n    difference() {\n        main_cylinder(main_height, main_diameter,center=center);\n        // Vytvorenie troch výrezov do valca\n        // Create three cutouts in the cylinder\n        for (i = [0 : 2]) {\n            rotate([0, 0, i * 120])\n            translate([hole_distance(main_diameter), 0, 0])\n                rounded_hole_cylinder(main_height, main_diameter);\n        }\n    }\n}\n\n// Volanie hlavneho modulu s parametrami\n// Calling the main module with parameters\n//--self_forming_screw(h=15, d=6,center=false);\n//-- Self Forming thread functions - END\n"
  },
  {
    "path": "examples/ESP32-CAM-USB-FISH_v30.scad",
    "content": "//---------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for ESP32-CAM\n//\n//  Version 1.1 (12-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//---------------------------------------------------------\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n      padding-back|<------pcb length --->|<padding-front\n                            RIGHT\n        0    X-as ---> \n        +----------------------------------------+   ---\n        |                                        |    ^\n        |                                        |   padding-right \n        |                                        |    v\n        |    -5,y +----------------------+       |   ---              \n B    Y |         | 0,y              x,y |       |     ^              F\n A    - |         |                      |       |     |              R\n C    a |         |                      |       |     | pcb width    O\n K    s |         |                      |       |     |              N\n        |         | 0,0              x,0 |       |     v              T\n      ^ |   -5,0  +----------------------+       |   ---\n      | |                                        |    padding-left\n      0 +----------------------------------------+   ---\n        0    X-as --->\n                          LEFT\n*/\n\nprintBaseShell      = true;\nprintLidShell       = true;\n\n// Edit these parameters for your own board dimensions\nwallThickness       = 1.4;\nbasePlaneThickness  = 1.8;\nlidPlaneThickness   = 1.8;\n\nbaseWallHeight      = 15;\nlidWallHeight       =  6;\n\n// Total height of box = basePlaneThickness + lidPlaneThickness \n//                     + baseWallHeight + lidWallHeight\npcbLength           = 40;\npcbWidth            = 27.5;\npcbThickness        = 13.5;\n                            \n// padding between pcb and inside wall\npaddingFront        = 0.3;\npaddingBack         = 0.3;\npaddingRight        = 0.3;\npaddingLeft         = 0.3;\n\n// ridge where base and lid off box can overlap\n// Make sure this isn't less than lidWallHeight\nridgeHeight         = 3;\nridgeSlack          = 0.2;\n\nroundRadius         = 2.0;\n\n// How much the PCB needs to be raised from the base\n// to leave room for solderings and whatnot\nstandoffHeight      = 11.0;\nstandoffPinDiameter = 0.5;\nstandoffHoleSlack   = 0.1;\nstandoffDiameter    = 3.5;\n\n\n// Set the layer height of your printer\nprinterLayerHeight  = 0.2;\n\n\n//-- C O N T R O L ---------------//-> Default -----------------------------\nshowSideBySide        = true;     //-> true\npreviewQuality        = 5;        //-> from 1 to 32, Default = 5\nrenderQuality         = 6;        //-> from 1 to 32, Default = 8\nonLidGap              = 3;\nshiftLid              = 5;\ncolorLid              = \"YellowGreen\";   \nalphaLid              = 1;\ncolorBase             = \"BurlyWood\";\nalphaBase             = 1;\nhideLidWalls          = false;    //-> false\nhideBaseWalls         = false;    //-> false\nshowOrientation       = true;\nshowPCB               = false;\nshowSwitches          = false;\nshowMarkersBoxOutside = false;\nshowMarkersBoxInside  = false;\nshowMarkersPCB        = false;\nshowMarkersCenter     = false;\ninspectX              = 0;        //-> 0=none (>0 from Back)\ninspectY              = 0;        //-> 0=none (>0 from Right)\ninspectZ              = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack      = true;     //-> View from the inspection cut foreward\ninspectYfromLeft      = true;     //-> View from the inspection cut to the right\ninspectZfromTop       = false;    //-> View from the inspection cut down\n//-- C O N T R O L -----------------------------------------------------------\n\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//   Optional:\n//    p(2) = Height to bottom of PCB : Default = standoffHeight\n//    p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    p(4) = standoffDiameter    Default = standoffDiameter;\n//    p(5) = standoffPinDiameter Default = standoffPinDiameter;\n//    p(6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    p(7) = filletRadius (0 = auto size)\n//    n(a) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    n(b) = { <yappPin>, yappHole } // Baseplate support treatment\n//    n(c) = { <yappAllCorners>, yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { yappNoFillet }\n//-------------------------------------------------------------------\npcbStands = \n[\n    [1, 1, 2, undef, yappBoth, yappHole, yappNoFillet] \n];     \n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//----------------------+-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be\n//                      |                       |               | provided\n//----------------------+-----------------------+---------------+------------------------------------\n//\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces\n//-------------------------------------------------------------------\ncutoutsLid =  \n[\n    [9,  ((pcbWidth/2)+0.5), 0, 0, 6.5, yappCircle, yappCenter]   // lens\n   ,[30, pcbWidth-3, 6, 6, 1, yappRoundedRect, yappCenter]        // flash LED\n];\n\n//===================================================================\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces\n//-------------------------------------------------------------------\ncutoutsBase =   \n[\n    [(pcbLength/2), (pcbWidth/2),  35, 20, 0, yappPolygon, shapeHexagon, [maskBars, 0, 0, 90], yappCenter]\n];\n\n//-- front plane  -- origin is pcb[0,0,0]\n// (0) = posy\n// (1) = posz\ncutoutsFront =  \n[\n    [13, -19, 12, 8, 0, yappRectangle, yappCenter] // USB\n];\n\n//===================================================================\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces\n//-------------------------------------------------------------------\ncutoutsBack =   \n[\n    [13, -9, 15, 6, 0, yappRectangle, yappCenter] // SD card\n];\n\n//-- left plane   -- origin is pcb[0,0,0]\n// (0) = posx\n// (1) = posz\ncutoutsLeft =   \n[\n    [pcbLength-6, -20, 6.5, 4, 0, yappRectangle, yappCenter] // button\n];\n\n//===================================================================\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces\n//-------------------------------------------------------------------\ncutoutsRight =  \n[\n    [pcbLength-6, -20, 6.5, 4, 0, yappRectangle, yappCenter] // button\n];\n\n///-- connectors \n//-- normal         : origen = box[0,0,0]\n//-- yappConnWithPCB: origen = pcb[0,0,0]\n// (0) = posx\n// (1) = posy\n// (1) = pcbStandHeight\n// (3) = screwDiameter\n// (4) = screwHeadDiameter\n// (5) = insertDiameter\n// (6) = outsideDiameter\n// (7) = flangeHeight\n// (8) = flangeDiam\n// (9) = { yappConnWithPCB }\n// (10) = { yappAllCorners | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\nconnectors   =  \n[\n];\n\n//-- base mounts -- origen = box[x0,y0]\n// (0) = posx | posy\n// (1) = screwDiameter\n// (2) = width\n// (3) = height\n// (4..7) = yappLeft / yappRight / yappFront / yappBack (one or more)\n// (5) = { yappCenter }\nboxMounts   = \n[\n];\n\n//-- snap Joins -- origen = box[x0,y0]\n// (0) = posx | posy\n// (1) = width\n// (2..5) = yappLeft / yappRight / yappFront / yappBack (one or more)\n// (n) = { yappSymmetric }\nsnapJoins   =     \n[\n    [2,               5, yappLeft, yappRight]\n   ,[(shellWidth/2)-2.5, 5, yappFront]\n];\n               \n//-- origin of labels is box [0,0,0]\n// (0) = posx\n// (1) = posy/z\n// (2) = orientation\n// (3) = plane {lid | base | left | right | front | back }\n// (4) = font\n// (5) = size\n// (6) = \"label text\"\nlabelsPlane =  \n[\n];\n               \nmodule hookBaseOutside()\n{\n  translate([(shellLength/2)-7.5,(shellWidth-wallThickness)-3,1])\n  {\n    difference()\n    {\n      union()\n      {\n        cube([15,10,10]);\n        translate([0,10,5])\n          rotate([0,90,0])\n            cylinder(d=10, h=15);\n      }\n      translate([-1,10,5])\n      {\n        rotate([0,90,0])\n          color(\"red\") cylinder(d=4.5, h=17);\n      }\n      translate([4.8,0,-0.5])\n        cube([5.4,16,11]);\n    }\n  \n  } // translate\n  \n} //  hookBaseOutside()\n\nmodule hookLidInside()\n{\n  translate([9,  ((pcbWidth/2)+0.5), 0])\n  {\n    difference()\n    {\n      cylinder(h=4, r=8, center=true);\n      cylinder(h=5, r=6.5, center=true);\n    }\n  }\n  translate([30, pcbWidth-3, -1])\n  {\n    difference()\n    {\n      cube([8, 8, 7], center=true);\n      cube([6, 6, 8], center=true);\n    }\n  }  \n  \n} //  lidHook()\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/ESP32-CAM-USB_v30.scad",
    "content": "//---------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for ESP32-CAM\n//\n//  Version 1.1 (12-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//---------------------------------------------------------\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n      padding-back|<------pcb length --->|<padding-front\n                            RIGHT\n        0    X-as ---> \n        +----------------------------------------+   ---\n        |                                        |    ^\n        |                                        |   padding-right \n        |                                        |    v\n        |    -5,y +----------------------+       |   ---              \n B    Y |         | 0,y              x,y |       |     ^              F\n A    - |         |                      |       |     |              R\n C    a |         |                      |       |     | pcb width    O\n K    s |         |                      |       |     |              N\n        |         | 0,0              x,0 |       |     v              T\n      ^ |   -5,0  +----------------------+       |   ---\n      | |                                        |    padding-left\n      0 +----------------------------------------+   ---\n        0    X-as --->\n                          LEFT\n*/\n\nprintBaseShell      = true;\nprintLidShell       = true;\n\n// Edit these parameters for your own board dimensions\nwallThickness       = 1.4;\nbasePlaneThickness  = 1.8;\nlidPlaneThickness   = 1.8;\n\nbaseWallHeight      = 15;\nlidWallHeight       =  6;\n\n// Total height of box = basePlaneThickness + lidPlaneThickness \n//                     + baseWallHeight + lidWallHeight\npcbLength           = 40;\npcbWidth            = 27.5;\npcbThickness        = 13.5;\n                            \n// padding between pcb and inside wall\npaddingFront        = 0.3;\npaddingBack         = 0.3;\npaddingRight        = 0.3;\npaddingLeft         = 0.3;\n\n// ridge where base and lid off box can overlap\n// Make sure this isn't less than lidWallHeight\nridgeHeight         = 3;\nridgeSlack          = 0.2;\n\nroundRadius         = 2.0;\n\n// How much the PCB needs to be raised from the base\n// to leave room for solderings and whatnot\nstandoffHeight      = 11.0;\nstandoffPinDiameter = 0.5;\nstandoffHoleSlack   = 0.1;\nstandoffDiameter    = 3.5;\n\n\n// Set the layer height of your printer\nprinterLayerHeight  = 0.2;\n\n\n//-- C O N T R O L ---------------//-> Default -----------------------------\nshowSideBySide        = true;     //-> true\npreviewQuality        = 5;        //-> from 1 to 32, Default = 5\nrenderQuality         = 6;        //-> from 1 to 32, Default = 8\nonLidGap              = 3;\nshiftLid              = 5;\ncolorLid              = \"YellowGreen\";   \nalphaLid              = 1;\ncolorBase             = \"BurlyWood\";\nalphaBase             = 1;\nhideLidWalls          = false;    //-> false\nhideBaseWalls         = false;    //-> false\nshowOrientation       = true;\nshowPCB               = false;\nshowSwitches          = false;\nshowMarkersBoxOutside = false;\nshowMarkersBoxInside  = false;\nshowMarkersPCB        = false;\nshowMarkersCenter     = false;\ninspectX              = 0;        //-> 0=none (>0 from Back)\ninspectY              = 0;        //-> 0=none (>0 from Right)\ninspectZ              = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack      = true;     //-> View from the inspection cut foreward\ninspectYfromLeft      = true;     //-> View from the inspection cut to the right\ninspectZfromTop       = false;    //-> View from the inspection cut down\n//-- C O N T R O L -----------------------------------------------------------\n\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//   Optional:\n//    p(2) = Height to bottom of PCB : Default = standoffHeight\n//    p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    p(4) = standoffDiameter    Default = standoffDiameter;\n//    p(5) = standoffPinDiameter Default = standoffPinDiameter;\n//    p(6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    p(7) = filletRadius (0 = auto size)\n//    n(a) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    n(b) = { <yappPin>, yappHole } // Baseplate support treatment\n//    n(c) = { <yappAllCorners>, yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { yappNoFillet }\n//-------------------------------------------------------------------\npcbStands = \n[\n    [1, 1, 2, undef, yappBoth, yappHole, yappNoFillet] \n];     \n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//----------------------+-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be\n//                      |                       |               | provided\n//----------------------+-----------------------+---------------+------------------------------------\n//\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces\n//-------------------------------------------------------------------\ncutoutsLid =  \n[\n    [8,  ((pcbWidth/2)+0.5), 0, 0, 4.5, yappCircle, yappCenter]   // lens\n   ,[9,  ((pcbWidth/2)+0.5), 0, 0, 4.5, yappCircle, yappCenter]   // lens\n   ,[10, ((pcbWidth/2)+0.5), 0, 0, 4.5, yappCircle, yappCenter]   // lens\n   ,[30, pcbWidth-3, 6, 6, 1, yappRoundedRect, yappCenter]        // flash LED\n];\n\n//===================================================================\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces\n//-------------------------------------------------------------------\ncutoutsBase =   \n[\n    [(pcbLength/2), (pcbWidth/2),  35, 20, 0, yappPolygon, shapeHexagon, [maskBars, 0, 0, 90], yappCenter]\n];\n\n//-- front plane  -- origin is pcb[0,0,0]\n// (0) = posy\n// (1) = posz\ncutoutsFront =  \n[\n    [13, -19, 12, 8, 0, yappRectangle, yappCenter] // USB\n];\n\n//===================================================================\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces\n//-------------------------------------------------------------------\ncutoutsBack =   \n[\n    [13, -9, 15, 6, 0, yappRectangle, yappCenter] // SD card\n];\n\n//-- left plane   -- origin is pcb[0,0,0]\n// (0) = posx\n// (1) = posz\ncutoutsLeft =   \n[\n    [pcbLength-6, -20, 6.5, 4, 0, yappRectangle, yappCenter] // button\n];\n\n//===================================================================\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces\n//-------------------------------------------------------------------\ncutoutsRight =  \n[\n    [pcbLength-6, -20, 6.5, 4, 0, yappRectangle, yappCenter] // button\n];\n\n///-- connectors \n//-- normal         : origen = box[0,0,0]\n//-- yappConnWithPCB: origen = pcb[0,0,0]\n// (0) = posx\n// (1) = posy\n// (1) = pcbStandHeight\n// (3) = screwDiameter\n// (4) = screwHeadDiameter\n// (5) = insertDiameter\n// (6) = outsideDiameter\n// (7) = flangeHeight\n// (8) = flangeDiam\n// (9) = { yappConnWithPCB }\n// (10) = { yappAllCorners | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\nconnectors   =  \n[\n];\n\n//-- base mounts -- origen = box[x0,y0]\n// (0) = posx | posy\n// (1) = screwDiameter\n// (2) = width\n// (3) = height\n// (4..7) = yappLeft / yappRight / yappFront / yappBack (one or more)\n// (5) = { yappCenter }\nboxMounts   = \n[\n];\n\n//-- snap Joins -- origen = box[x0,y0]\n// (0) = posx | posy\n// (1) = width\n// (2..5) = yappLeft / yappRight / yappFront / yappBack (one or more)\n// (n) = { yappSymmetric }\nsnapJoins   =     \n[\n    [2,               5, yappLeft, yappRight]\n   ,[(shellWidth/2)-2.5, 5, yappFront]\n];\n               \n//-- origin of labels is box [0,0,0]\n// (0) = posx\n// (1) = posy/z\n// (2) = orientation\n// (3) = plane {lid | base | left | right | front | back }\n// (4) = font\n// (5) = size\n// (6) = \"label text\"\nlabelsPlane =  \n[\n];\n               \nmodule hookBaseOutside()\n{\n  translate([(shellLength/2)-7.5,(shellWidth-wallThickness)-3,1])\n  {\n    difference()\n    {\n      union()\n      {\n        cube([15,10,10]);\n        translate([0,10,5])\n          rotate([0,90,0])\n            cylinder(d=10, h=15);\n      }\n      translate([-1,10,5])\n      {\n        rotate([0,90,0])\n          color(\"red\") cylinder(d=4.5, h=17);\n      }\n      translate([4.8,0,-0.5])\n        cube([5.4,16,11]);\n    }\n  \n  } // translate\n  \n} //  hookBaseOutside()\n\nmodule lidHook()\n{\n  \n} //  lidHook()\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/GateAlarm_Sample_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0 (01-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  for many or complex cutouts you might need to adjust\n//  the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\n\n//-- pcb dimensions -- very important!!!\n// Electro cookie 30 row\npcbLength           = 88.9; // Front to back\npcbWidth            = 52.1; // Side to side\npcbThickness        = 1.7;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 3;\npaddingBack         = 3;\npaddingRight        = 3;\npaddingLeft         = 3;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 1.5;\nlidPlaneThickness   = 1.5;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 12;\nlidWallHeight       = 11;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.3;\nroundRadius         = 3.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 10.0;  //-- used only for pushButton and showPCB\nstandoffPinDiameter = 1.7;\nstandoffHoleSlack   = 0.4;\nstandoffDiameter    = 4.0;\n\n\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = true;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 12;       //-> from 1 to 32, Default = 8\nonLidGap            = 10;\nshiftLid            = 5;\ncolorLid            = \"YellowGreen\";   \nalphaLid            = 1;//0.25;   \ncolorBase           = \"BurlyWood\";\nalphaBase           = 1;//0.25;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\nshowOrientation     = true;\nshowPCB             = false;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from back)\ninspectY            = 0;        //-> 0=none (>0 from right)\ninspectXfromBack    = false;    // View from the inspection cut foreward\ninspectYfromLeft    = true;     // View from the inspection cut to the right\ninspectZfromTop     = true;\n//-- C O N T R O L ---------------------------------------\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx\n//    (1) = posy\n//   Optional:\n//    (2) = Height to bottom of PCB : Default = standoffHeight\n//    (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    (4) = standoffDiameter    Default = standoffDiameter;\n//    (5) = standoffPinDiameter Default = standoffPinDiameter;\n//    (6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    (7) = filletRadius (0 = auto size)\n//    (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    (n) = { yappHole, <yappPin> } // Baseplate support treatment\n//    (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    (n) = { yappCoordBox, <yappCoordPCB> }  \n//    (n) = { yappNoFillet }\n//-------------------------------------------------------------------\n\npcbStands = [\n  // Electro cookie 30 row\n  [5.1, 8.25]\n];\n\n\n//===================================================================\n//  *** Connectors ***\n//  Standoffs with hole through base and socket in lid for screw type connections.\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//  \n//  Parameters:\n//   Required:\n//    (0) = posx\n//    (1) = posy\n//    (2) = pcbStandHeight\n//    (3) = screwDiameter\n//    (4) = screwHeadDiameter (don't forget to add extra for the fillet)\n//    (5) = insertDiameter\n//    (6) = outsideDiameter\n//   Optional:\n//    (7) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    (8) = filletRadius : Default = 0/Auto(0 = auto size)\n//    (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    (n) = { <yappCoordBox>, yappCoordPCB }\n//    (n) = { yappNoFillet }\n//-------------------------------------------------------------------\n\nconnectors   =\n  [\n  //  [9, 15, 10, 2.5, 6 + 1.25, 4.0, 9, 0, yappFrontRight]\n  // ,[9, 15, 10, 2.5, 6+ 1.25, 4.0, 9, 0, yappFrontLeft]\n  // ,[34, 15, 10, 2.5, 6+ 1.25, 4.0, 9, 0, yappFrontRight]\n  // ,[34, 15, 10, 2.5, 6+ 1.25, 4.0, 9, 0, yappFrontLeft]\n  ];\n\n//===================================================================\n//  *** Base Mounts ***\n//    Mounting tabs on the outside of the box\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = pos\n//    (1) = screwDiameter\n//    (2) = width\n//    (3) = height\n//   Optional:\n//    (4) = filletRadius : Default = 0/Auto(0 = auto size)\n//    (n) = yappLeft / yappRight / yappFront / yappBack (one or more)\n//    (n) = { yappNoFillet }\n//-------------------------------------------------------------------\n\nbaseMounts =\n[\n//  [shellWidth/2, 3, 10, 3, yappFront, yappBack]//, yappCenter]\n //  [[10,10], 3, 0, 3, yappFront, yappBack]\n];\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase, cutoutsLid, cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//                      +-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be provided\n//\n//  Parameters:\n//   Required:\n//    (0) = from Back\n//    (1) = from Left\n//    (2) = width\n//    (3) = length\n//    (4) = radius\n//    (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    (7) = angle : Default = 0\n//    (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.\n//    (n) = { [yappMaskDef, hOffset, vOffset, rotations] } : If a list for a mask is added it will be used as a mask for the cutout. With the Rotation and offsets applied. THis can be used to fine tune the mask placement in the opening.\n//    (n) = { yappCoordBox | <yappCoordPCB> }\n//    (n) = { <yappOrigin>, yappCenter }\n//  (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top, Back and Right Faces\n//-------------------------------------------------------------------\n\ncutoutsBase = \n[\n  // Vent\n//  [shellLength/2,shellWidth/2 ,55,55, 5, yappPolygon, shapeHexagon, [maskBars,1,1.5], yappCenter]\n];\n\ncutoutsLid  = \n[\n  // Cutout for piezo buzzer\n  [25,shellWidth/2 ,0,0, 29.8/2, yappCircle ,yappCenter, yappCoordBox] \n];\n\ncutoutsFront =  \n[\n\n];\n\n\ncutoutsBack = \n[\n  // Cutout for USB\n [pcbWidth/2, -5 -pcbThickness ,12.5,7.0, 2, yappRoundedRect , yappCenter]\n];\n\ncutoutsLeft =   \n[\n\n];\n\ncutoutsRight =  \n[\n  //Cutout for cable\n//  [35,6 ,0,0, 3.25, yappCircle,yappCenter]\n  // Make the hole thru the end of the ridge extansion\n  [35+3.25,6, 0,  0,  3.25, yappCircle, yappCenter, yappCoordBox]\n\n];\n\n\n//===================================================================\n//  *** Snap Joins ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx | posy\n//    (1) = width\n//    (n) = yappLeft / yappRight / yappFront / yappBack (one or more)\n//   Optional:\n//    (n) = { <yappOrigin> | yappCenter }\n//    (n) = { yappSymmetric }\n//    (n) = { yappRectangle } == Make a diamond shape snap\n//-------------------------------------------------------------------\n\nsnapJoins =   \n[\n  [(shellWidth/2),     10, yappFront,yappBack, yappCenter]\n //,[25,  10, yappBack, yappBack, yappSymmetric, yappCenter]\n ,[(shellLength/2),    10, yappLeft, yappRight, yappCenter]\n];\n\n//===================================================================\n//  *** Light Tubes ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx\n//    (1) = posy\n//    (2) = tubeLength\n//    (3) = tubeWidth\n//    (4) = tubeWall\n//    (5) = gapAbovePcb\n//    (6) = tubeType    {yappCircle|yappRectangle}\n//   Optional:\n//    (7) = lensThickness (how much to leave on the top of the lid for the light to shine through 0 for open hole : Default = 0/Open\n//    (8) = Height to top of PCB : Default = standoffHeight+pcbThickness\n//    (9) = filletRadius : Default = 0/Auto \n//    (n) = { yappCoordBox, <yappCoordPCB> }\n//    (n) = { yappNoFillet }\n//-------------------------------------------------------------------\n\nlightTubes =\n[\n  \n  [pcbLength-(8.820),(pcbWidth/2)-3.810, // Pos\n    6, 6,                 // W,L\n    1.0,                      // wall thickness\n    2,                      // Gap above PCB\n    yappCircle,          // tubeType (Shape)\n    undef,undef,1\n  ]\n ,[pcbLength-(8.820+(2.54*3)),(pcbWidth/2)-1.27 - (2.54*1), // Pos\n    6, 6,                 // W,L\n    1.0,                      // wall thickness\n    2,                      // Gap above PCB\n    yappCircle,          // tubeType (Shape)\n    undef,undef,1\n  ]\n ,[pcbLength-(8.820+(2.54*6)),(pcbWidth/2)-3.810, // Pos\n    6, 6,                 // W,L\n    1.0,                      // wall thickness\n    2,                      // Gap above PCB\n    yappCircle,          // tubeType (Shape)\n    undef,undef,1\n  ]\n ,[pcbLength-(8.820+(2.54*9)),(pcbWidth/2)-3.810, // Pos\n    6, 6,                 // W,L\n    1.0,                      // wall thickness\n    2,                      // Gap above PCB\n    yappCircle,          // tubeType (Shape)\n    undef,undef,1\n  ]\n ,[pcbLength-(8.820),(pcbWidth/2)+3.810, // Pos\n    6, 6,                 // W,L\n    1.0,                      // wall thickness\n    2,                      // Gap above PCB\n    yappCircle,          // tubeType (Shape)\n    undef,undef,1\n  ]\n ,[pcbLength-(8.820+(2.54*3)),(pcbWidth/2)+3.810, // Pos\n    6, 6,                 // W,L\n    1.0,                      // wall thickness\n    2,                      // Gap above PCB\n    yappCircle,          // tubeType (Shape)\n    undef,undef,1\n  ]\n];\n\n//===================================================================\n//  *** Push Buttons ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx\n//    (1) = posy\n//    (2) = capLength for yappRectangle, capDiameter for yappCircle\n//    (3) = capWidth for yappRectangle, not used for yappCircle\n//    (4) = capAboveLid\n//    (5) = switchHeight\n//    (6) = switchTravel\n//    (7) = poleDiameter\n//   Optional:\n//    (8) = Height to top of PCB : Default = standoffHeight + pcbThickness\n//    (9) = buttonType  {yappCircle|<yappRectangle>} : Default = yappRectangle\n//    (10) = filletRadius : Default = 0/Auto \n//-------------------------------------------------------------------\n\npushButtons = \n[\n    [pcbLength-(8.820+(2.54*8.5)),(pcbWidth/2)+3.810+(2.54*2), \n    8, // cap Diameter\n    0, // Unused\n    1, // Cap above Lid\n    3, // Switch Height\n    1, // Switch travel\n    3.5, // Pole Diameter\n    undef, // Height to top of PCB\n    yappCircle, // Shape\n    0\n    ]\n];\n    \n\n//===================================================================\n//  *** Ridge Extension ***\n//    Extension from the lid into the case for adding split opening at various heights\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = pos\n//    (1) = width\n//    (2) = height : Where to relocate the seam : yappCoordPCB = Above (positive) the PCB\n//                                                yappCoordBox = Above (positive) the bottom of the shell (outside)\n//   Optional:\n//    (n) = { <yappOrigin>, yappCenter } \n//    (n) = { yappCoordBox, <yappCoordPCB> }\n//    (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces\n\n// Note: use ridgeExtTop to reference the top of the extension for cutouts.\n// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.\n//-------------------------------------------------------------------\nridgeExtFront =\n[\n\n];\n\nridgeExtBack =\n[\n\n];\n\nridgeExtLeft =\n[\n\n];\n\nridgeExtRight =\n[\n  // Make a ridge extension 6mm wide 10mm below the top of the ridge\n  [35, 6.5, 6, yappCoordBox]\n ];\n\n    \n//===================================================================\n//  *** Labels ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   (0) = posx\n//   (1) = posy/z\n//   (2) = rotation degrees CCW\n//   (3) = depth : positive values go into case (Remove) negative valies are raised (Add)\n//   (4) = plane {yappLeft | yappRight | yappFront | yappBack | yappTop | yappBottom}\n//   (5) = font\n//   (6) = size\n//   (7) = \"label text\"\n//-------------------------------------------------------------------\n\nlabelsPlane =\n[\n    [5, 18, -90, 1, yappLid, \"Liberation Mono:style=bold\", 6, \"DMR\" ]\n\n    ,[83.5,           22,   -90, 1, yappLid, \"Liberation Mono:style=bold\", 4, \"Front\" ]\n    ,[83.5-(2.54*3),  22,   -90, 1, yappLid, \"Liberation Mono:style=bold\", 4, \"Drive\" ]\n    ,[83.5-(2.54*6),  22,   -90, 1, yappLid, \"Liberation Mono:style=bold\", 4, \"Rear\" ]\n    ,[83.5-(2.54*9),  22,   -90, 1, yappLid, \"Liberation Mono:style=bold\", 4, \"Pool\" ]\n    ,[83.5,           57,   -90, 1, yappLid, \"Liberation Mono:style=bold\", 4, \"Alarm\" ]\n    ,[83.5-(2.54*3),  57,   -90, 1, yappLid, \"Liberation Mono:style=bold\", 4, \"Muted\" ]\n    ,[83.5-(2.54*12), 47,   -90, 1, yappLid, \"Liberation Mono:style=bold\", 4, \"Mute\" ]\n];\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/Multiple_PCB_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0.1 (2024-01-15)\n//\n// This design is parameterized based on the size of a PCB.\n//\n// For many/complex cutoutGrills, you might need to adjust\n//  the max number of elements in OpenSCAD:\n//\n//      Preferences->Advanced->Turn off rendering at 250000 elements\n//                                                   ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n//---------------------------------------------------------\n// This design is parameterized based on the size of a PCB.\n//---------------------------------------------------------\n// Note: length/lengte refers to X axis, \n//       width/breedte refers to Y axis,\n//       height/hoogte refers to Z axis\n\n/*\n      padding-back|<------pcb length --->|<padding-front\n                            RIGHT\n        0    X-axis ---> \n        +----------------------------------------+   ---\n        |                                        |    ^\n        |                                        |   padding-right \n      Y |                                        |    v\n      | |    -5,y +----------------------+       |   ---              \n B    a |         | 0,y              x,y |       |     ^              F\n A    x |         |                      |       |     |              R\n C    i |         |                      |       |     | pcb width    O\n K    s |         |                      |       |     |              N\n        |         | 0,0              x,0 |       |     v              T\n      ^ |    -5,0 +----------------------+       |   ---\n      | |                                        |    padding-left\n      0 +----------------------------------------+   ---\n        0    X-as --->\n                          LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\n\n\n// ********************************************************************\n// The Following will be used as the first element in the pbc array\npcbLength           = 88.9; // Front to back\npcbWidth            = 52.1; // Side to side\npcbThickness        = 1.6;\nstandoffHeight      = 3.0;  //-- How much the PCB needs to be raised from the base to leave room for solderings and whatnot\nstandoffDiameter    = 7;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\n\n//===================================================================\n// *** PCBs ***\n// Printed Circuit Boards\n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : yappCoordBoxInside[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = name\n//    p(1) = length\n//    p(2) = width\n//    p(3) = posx\n//    p(4) = posy\n//    p(5) = Thickness\n//    p(6) = standoffHeight\n//    p(7) = standoffDiameter\n//    p(8) = standoffPinDiameter\n//    p(9) = standoffHoleSlack (default to 0.4)\n//   Optional:\n\n//The following can be used to get PCB values elsewhere in the script - not in pcb definition. \n//If \"PCB Name\" is omitted then \"Main\" is used\n//  pcbLength           --> pcbLength(\"PCB Name\")\n//  pcbWidth            --> pcbWidth(\"PCB Name\")\n//  pcbThickness        --> pcbThickness(\"PCB Name\") \n//  standoffHeight      --> standoffHeight(\"PCB Name\") \n//  standoffDiameter    --> standoffDiameter(\"PCB Name\") \n//  standoffPinDiameter --> standoffPinDiameter(\"PCB Name\") \n//  standoffHoleSlack   --> standoffHoleSlack(\"PCB Name\") \n\npcb = \n[\n  [\"Main\",              pcbLength,pcbWidth,    0,0,    pcbThickness,  standoffHeight, standoffDiameter, standoffPinDiameter, standoffHoleSlack]\n ,[\"Voltage Detect 1\",  15.1,71.5+3,  pcbLength + 2,        0,  1.6,  3, 7, 2.4]\n ,[\"Voltage Detect 2\",  15.1,71.5+3,  pcbLength + 4 + 15.1, 0,  1.6,  3, 7, 2.4]\n];\n\n//-------------------------------------------------------------------\n\n\n\n\n  \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 1.5;\nlidPlaneThickness   = 1.5;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 6;\nlidWallHeight       = 20;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.2;\nroundRadius         = 3.0;\n\n\n// Set the layer height of your printer\nprinterLayerHeight  = 0.2;\n\n\n\n\n\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n// -- Render --\nrenderQuality             = 8;          //-> from 1 to 32, Default = 8\n\n// --Preview --\npreviewQuality            = 5;          //-> from 1 to 32, Default = 5\nshowSideBySide            = true;       //-> Default = true\nonLidGap                  = 0;  // tip don't override to animate the lid opening\ncolorLid                  = \"YellowGreen\";   \nalphaLid                  = 1;\ncolorBase                 = \"BurlyWood\";\nalphaBase                 = 1;\nhideLidWalls              = false;      //-> Remove the walls from the lid : only if preview and showSideBySide=true \nhideBaseWalls             = false;      //-> Remove the walls from the base : only if preview and showSideBySide=true  \nshowOrientation           = true;       //-> Show the Front/Back/Left/Right labels : only in preview\nshowPCB                   = true;      //-> Show the PCB in red : only in preview \nshowSwitches              = true;      //-> Show the switches (for pushbuttons) : only in preview \nshowButtonsDepressed      = false;      //-> Should the buttons in the Lid On view be in the pressed position\nshowOriginCoordBox        = false;      //-> Shows red bars representing the origin for yappCoordBox : only in preview \nshowOriginCoordBoxInside  = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowOriginCoordPCB        = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowMarkersPCB            = false;      //-> Shows black bars corners of the PCB : only in preview \nshowMarkersCenter         = false;      //-> Shows magenta bars along the centers of all faces  \ninspectX                  = 0;          //-> 0=none (>0 from Back)\ninspectY                  = 0;          //-> 0=none (>0 from Right)\ninspectZ                  = 0;          //-> 0=none (>0 from Bottom)\ninspectXfromBack          = true;       //-> View from the inspection cut foreward\ninspectYfromLeft          = true;       //-> View from the inspection cut to the right\ninspectZfromBottom        = true;       //-> View from the inspection cut up\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n\n//-------------------------------------------------------------------\n//-------------------------------------------------------------------\n// Start of Debugging config (used if not overridden in template)\n// ------------------------------------------------------------------\n// ------------------------------------------------------------------\n\n//==================================================================\n//  *** Shapes ***\n//------------------------------------------------------------------\n//  There are a view pre defines shapes and masks\n//  shapes:\n//      shapeIsoTriangle, shapeHexagon, shape6ptStar\n//\n//  masks:\n//      maskHoneycomb, maskHexCircles, maskBars, maskOffsetBars\n//\n//------------------------------------------------------------------\n// Shapes should be defined to fit into a 1x1 box (+/-0.5 in X and Y) - they will \n// be scaled as needed.\n// defined as a vector of [x,y] vertices pairs.(min 3 vertices)\n// for example a triangle could be [yappPolygonDef,[[-0.5,-0.5],[0,0.5],[0.5,-0.5]]];\n// To see how to add your own shapes and mask see the YAPPgenerator program\n//------------------------------------------------------------------\n\n\n// Show sample of a Mask\n//SampleMask(maskHoneycomb);\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//   Optional:\n//    p(2) = Height to bottom of PCB : Default = standoff_Height\n//    p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcb_Thickness, yappCoordBox=0\n//    p(4) = standoff_Diameter    Default = standoff_Diameter;\n//    p(5) = standoff_PinDiameter Default = standoff_PinDiameter;\n//    p(6) = standoff_HoleSlack   Default = standoff_HoleSlack;\n//    p(7) = filletRadius (0 = auto size)\n//    n(a) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    n(b) = { <yappPin>, yappHole } // Baseplate support treatment\n//    n(c) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { yappNoFillet }\n//    n(f) = [yappPCBName, \"XXX\"] : {Specify a PCB defaults to \"Main\"\n//-------------------------------------------------------------------\npcbStands = \n[\n//- Add stands 5mm from each corner of the PCB\n    [5, 5, yappAllCorners]\n//-   Add posts 25mm from the corners of the box, with a custon height,diameter, Pin Size, hole\n//-   slack and filler radius.\n//  [25, 25, 10, 10, 3.3, 0.9, 5, yappCoordBox] \n//  [5,5, yappAllCorners]\n\n  // Voltage Dector boards have 2 offset pins\n ,[ 8.5,15.4, undef, undef, 5, 2.5, [yappPCBName, \"Voltage Detect 1\"]]\n ,[12.5,55.7, undef, undef, 5, 2.5, [yappPCBName, \"Voltage Detect 1\"]]\n\n ,[ 8.5,15.4, undef, undef, 5, 2.5, [yappPCBName, \"Voltage Detect 2\"]]\n ,[12.5,55.7, undef, undef, 5, 2.5, [yappPCBName, \"Voltage Detect 2\"]]\n\n\n];\n\n\n//===================================================================\n//  *** Connectors ***\n//  Standoffs with hole through base and socket in lid for screw type connections.\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//  \n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = pcbStandHeight\n//    p(3) = screwDiameter\n//    p(4) = screwHeadDiameter (don't forget to add extra for the fillet)\n//    p(5) = insertDiameter\n//    p(6) = outsideDiameter\n//   Optional:\n//    p(7) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    p(8) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = { <yappAllCorners>, yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    n(b) = { <yappCoordBox> | yappCoordPCB |  yappCoordBoxInside }\n//    n(c) = { yappNoFillet }\n//    n(d) = [yappPCBName, \"XXX\"] : {XXX = the PCB name: Default \"Main\"}\n//-------------------------------------------------------------------\nconnectors   =\n[\n//  [9, 15, standoffHeight(\"PCB3\"), 2.5, 6 + 1.25, 4.0, 9, yappAllCorners, [yappPCBName, \"PCB3\"]]\n];\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//----------------------+-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be\n//                      |                       |               | provided\n//----------------------+-----------------------+---------------+------------------------------------\n//\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                     | yappCircleWithFlats | yappCircleWithKey }\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces\n//    n(g) = [yappPCBName, \"XXX\"] : {Specify a PCB defaults to \"Main\"\n//-------------------------------------------------------------------\ncutoutsBase = \n[\n  [pcbLength()/2,shellWidth/2 ,55,55, 5, yappPolygon ,0 ,0, yappCenter, shapeHexagon, [maskHoneycomb,0,1.5,0], ]\n// , [0, 0, 10, 10, 0, yappRectangle, maskHexCircles, [yappPCBName, \"PCB3\"]]\n// , [shellLength*2/3,shellWidth/2 ,0, 30, 20, yappCircleWithFlats, yappCenter]\n// , [shellLength/2,shellWidth/2 ,10, 5, 20, yappCircleWithKey,yappCenter]\n];\n\ncutoutsLid  = \n[\n];\n\ncutoutsFront =  \n[\n];\n\ncutoutsBack = \n[\n  // Cutout for USB\n [pcbWidth()/2, 13 -pcbThickness() ,12.5,7.0, 2, yappRoundedRect , yappCenter]\n];\n\ncutoutsLeft =   \n[\n  // Cutout for AC 1\n  [pcbLength(\"Voltage Detect 1\")/2, pcbThickness(\"Voltage Detect 1\") + 3 ,11,7.0, 2, yappRoundedRect , yappCenter, [yappPCBName, \"Voltage Detect 1\"]]\n  // Cutout for AC 2\n ,[pcbLength(\"Voltage Detect 2\")/2, pcbThickness(\"Voltage Detect 2\") + 3 ,11,7.0, 2, yappRoundedRect , yappCenter, [yappPCBName, \"Voltage Detect 2\"]]\n\n];\n\ncutoutsRight =  \n[\n [pcbLength()/2, pcbThickness() + 3 ,12.5,7.0, 2, yappRoundedRect , yappCenter]\n\n];\n\n\n\n//===================================================================\n//  *** Snap Joins ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx | posy\n//    p(1) = width\n//    p(2) = { yappLeft | yappRight | yappFront | yappBack } : one or more\n//   Optional:\n//    n(a) = { <yappOrigin>, yappCenter }\n//    n(b) = { yappSymmetric }\n//    n(c) = { yappRectangle } == Make a diamond shape snap\n//-------------------------------------------------------------------\nsnapJoins   =   \n[\n    [15, 10, yappFront, yappCenter, yappSymmetric]\n   ,[15, 10, yappBack,  yappCenter, yappSymmetric]\n   ,[30, 10, yappRight, yappCenter, yappSymmetric]\n   ,[45, 10, yappLeft,  yappCenter, yappSymmetric]\n];\n\n//===================================================================\n//  *** Box Mounts ***\n//    Mounting tabs on the outside of the box\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X.\n//                    Position is to center of mounting screw in leftmost position in slot\n//    p(1) = screwDiameter\n//    p(2) = width of opening in addition to screw diameter \n//                    (0=Circular hole screwWidth = hole twice as wide as it is tall)\n//    p(3) = height\n//   Optional:\n//    p(4) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = { yappLeft | yappRight | yappFront | yappBack } : one or more\n//    n(b) = { yappNoFillet }\n//    n(c) = { <yappBase>, yappLid }\n//    n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of \n//                            the left of the opening\n//    n(e) = { <yappGlobalOrigin>, yappLeftOrigin } : Only affects Back and Right Faces\n//-------------------------------------------------------------------\nboxMounts =\n[\n];\n\n//===================================================================\n//  *** Light Tubes ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = tubeLength\n//    p(3) = tubeWidth\n//    p(4) = tubeWall\n//    p(5) = gapAbovePcb\n//    p(6) = { yappCircle | yappRectangle } : tubeType    \n//   Optional:\n//    p(7) = lensThickness (how much to leave on the top of the lid for the \n//           light to shine through 0 for open hole : Default = 0/Open\n//    p(8) = Height to top of PCB : Default = standoffHeight+pcbThickness\n//    p(9) = filletRadius : Default = 0/Auto \n//    n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside } \n//    n(b) = { <yappGlobalOrigin>, yappLeftOrigin }\n//    n(c) = { yappNoFillet }\n//    n(d) = [yappPCBName, \"XXX\"] : {Specify a PCB defaults to \"Main\"\n//-------------------------------------------------------------------\nlightTubes =\n[\n// ESP Power Light\n  [12.5 + 3, (pcbWidth()/2)+7.0,    // [0,1] Pos\n    3, 3,                   // [2,3] Length, Width\n    0.8,                      // [4]   wall thickness\n    standoffHeight() + pcbThickness() + 12, // [5] Gap above base bottom\n    yappCircle,          // [6]   tubeType (Shape)\n    0,                    // [7]   lensThickness\n    yappCoordPCB            // [n1]\n  ]\n  \n// Voltage Detect 1 power indicator\n ,[pcbLength(\"Voltage Detect 1\")/2, 30,    // [0,1] Pos\n    6, 6,                   // [2,3] Length, Width\n    0.8,                      // [4]   wall thickness\n    5, // [5] gapAbovePcb\n    yappCircle,          // [6]   tubeType (Shape)\n    0,                    // [7]   lensThickness\n    yappCoordPCB            // [n1]\n    ,[yappPCBName, \"Voltage Detect 1\"]\n  ]\n  \n// Voltage Detect 2 power indicator\n ,[pcbLength(\"Voltage Detect 2\")/2, 30,    // [0,1] Pos\n    6, 6,                   // [2,3] Length, Width\n    0.8,                      // [4]   wall thickness\n    5, // [5] Gap above base bottom\n    yappCircle,          // [6]   tubeType (Shape)\n    0,                    // [7]   lensThickness\n    yappCoordPCB            // [n1]\n    ,[yappPCBName, \"Voltage Detect 2\"]\n  ]\n  \n];\n\n//===================================================================\n//  *** Push Buttons ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = capLength \n//    p(3) = capWidth \n//    p(4) = capRadius \n//    p(5) = capAboveLid\n//    p(6) = switchHeight\n//    p(7) = switchTravel\n//    p(8) = poleDiameter\n//   Optional:\n//    p(9) = Height to top of PCB : Default = standoffHeight + pcbThickness\n//    p(10) = { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey } : Shape, Default = yappRectangle\n//    p(11) = angle : Default = 0\n//    p(12) = filletRadius          : Default = 0/Auto \n//    p(13) = buttonWall            : Default = 2.0;\n//    p(14) = buttonPlateThickness  : Default= 2.5;\n//    p(15) = buttonSlack           : Default= 0.25;\n//    n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside } \n//    n(b) = { <yappGlobalOrigin>,  yappLeftOrigin }\n//    n(c) = { yappNoFillet }\n//    n(d) = [yappPCBName, \"XXX\"] : {Specify a PCB defaults to \"Main\"\n//-------------------------------------------------------------------\npushButtons = \n[\n  // ESP Reset Button\n  [2.54 + 3, (pcbWidth()/2)+7.0, \n    8, // Width\n    8, // Length\n    2, // Radius\n    0, // Cap above Lid\n    15, // Switch Height\n    0.5, // Switch travel\n    3, // Pole Diameter\n    undef, // Height to top of PCB\n    yappRoundedRect // Shape\n   ] \n    \n//-                 0,   1,  2,  3, 4, 5,   6, 7, 8\n//   [(pcbLength()/2)+10, 65, 15, 10, 0, 3,   5, 1, 3]\n//  ,[                10, 10, 10, 10, 4, 2.0, 4, 1, 4, standoffHeight(), yappCircle, [yappPCBName, \"PCB3\"]]\n];\n             \n//===================================================================\n//  *** Labels ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   p(0) = posx\n//   p(1) = posy/z\n//   p(2) = rotation degrees CCW\n//   p(3) = depth : positive values go into case (Remove) negative valies are raised (Add)\n//   p(4) = { yappLeft | yappRight | yappFront | yappBack | yappLid | yappBaseyappLid } : plane\n//   p(5) = font\n//   p(6) = size\n//   p(7) = \"label text\"\n//  Optional:\n//   p(8) = Expand : Default = 0 : mm to expand text by (making it bolder) \n//-------------------------------------------------------------------\nlabelsPlane =\n[\n    [5, 5, 0, 1, yappLid, \"Liberation Mono:style=bold\", 5, \"YAPP\" ]\n];\n\n\n//===================================================================\n//  *** Ridge Extension ***\n//    Extension from the lid into the case for adding split opening at various heights\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = pos\n//    p(1) = width\n//    p(2) = height : Where to relocate the seam : yappCoordPCB = Above (positive) the PCB\n//                                                yappCoordBox = Above (positive) the bottom of the shell (outside)\n//   Optional:\n//    n(a) = { <yappOrigin>, yappCenter } \n//    n(b) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(c) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces\n//    n(d) = [yappPCBName, \"XXX\"] : {Specify a PCB defaults to \"Main\"\n//\n// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.\n//-------------------------------------------------------------------\nridgeExtLeft =\n[\n  [pcbLength(\"Voltage Detect 1\")/2, 11, pcbThickness(\"Voltage Detect 1\") + 3, [yappPCBName, \"Voltage Detect 1\"], yappCenter]\n ,[pcbLength(\"Voltage Detect 2\")/2, 11, pcbThickness(\"Voltage Detect 2\") + 3, [yappPCBName, \"Voltage Detect 2\"], yappCenter]\n];\n\nridgeExtRight =\n[\n  [pcbLength()/2, 12.5, pcbThickness() + 3 , yappCenter]\n\n];\n\nridgeExtFront =\n[\n];\n\nridgeExtBack =\n[\n  [pcbWidth()/2, 12.5, 13,yappCoordPCB, yappCenter]\n];\n\n\n\n//========= HOOK functions ============================\n  \n// Hook functions allow you to add 3d objects to the case.\n// Lid/Base = Shell part to attach the object to.\n// Inside/Outside = Join the object from the midpoint of the shell to the inside/outside.\n// Pre = Attach the object Pre before doing Cutouts/Stands/Connectors. \n\n\n//===========================================================\n// origin = box(0,0,0)\nmodule hookLidInside()\n{\n  //if (printMessages) echo(\"hookLidInside() ..\");\n  \n} // hookLidInside()\n  \n\n//===========================================================\n// origin = box(0,0,shellHeight)\nmodule hookLidOutside()\n{\n  //if (printMessages) echo(\"hookLidOutside() ..\");\n  \n} // hookLidOutside()\n\n//===========================================================\n//===========================================================\n// origin = box(0,0,0)\nmodule hookBaseInside()\n{\n  //if (printMessages) echo(\"hookBaseInside() ..\");\n  \n} // hookBaseInside()\n\n//===========================================================\n// origin = box(0,0,0)\nmodule hookBaseOutside()\n{\n  //if (printMessages) echo(\"hookBaseOutside() ..\");\n  \n} // hookBaseInside()\n\n// **********************************************************\n// **********************************************************\n// **********************************************************\n// *************** END OF TEMPLATE SECTION ******************\n// **********************************************************\n// **********************************************************\n// **********************************************************\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/PoolMonitor_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0 (01-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  for many or complex cutouts you might need to adjust\n//  the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\npcb2X = 95;\npcb2Y = 6;\npcb2MountInset = 2.5;\npcb2HoleDiameter = 3;\npcb2Length = 26;\npcb2Width = 50;\npcb2Thickness = 1.7; \npcb2Height = 4;\n//44.8  \ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = false;\nprintSwitchExtenders  = false;\n\n//-- pcb dimensions -- very important!!!\n// Electro cookie 30 row\npcbLength           = 88.9; // Front to back\npcbWidth            = 52.1; // Side to side\npcbThickness        = 1.7;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 32;\npaddingBack         = 3;\npaddingRight        = 3;\npaddingLeft         = 27;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 1.5;\nlidPlaneThickness   = 1.5;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 12;\nlidWallHeight       = 16;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.3;\nroundRadius         = 3.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 4.0;  //-- used only for pushButton and showPCB\nstandoffPinDiameter = 1.7;\nstandoffHoleSlack   = 0.4;\nstandoffDiameter    = 4.0;\n\n\n\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n// -- Render --\nrenderQuality             = 8;          //-> from 1 to 32, Default = 8\n\n// --Preview --\npreviewQuality            = 5;          //-> from 1 to 32, Default = 5\nshowSideBySide            = true;       //-> Default = true\nonLidGap                  = 0;  // tip don't override to animate the lid opening\n//onLidGap                  = ((ridgeHeight) - (ridgeHeight * abs(($t-0.5)*2)))*2;  // tip don't override to animate the lid opening/closing\ncolorLid                  = \"YellowGreen\";   \nalphaLid                  = 1;\ncolorBase                 = \"BurlyWood\";\nalphaBase                 = 1;\nhideLidWalls              = false;      //-> Remove the walls from the lid : only if preview and showSideBySide=true \nhideBaseWalls             = false;      //-> Remove the walls from the base : only if preview and showSideBySide=true  \nshowOrientation           = true;       //-> Show the Front/Back/Left/Right labels : only in preview\nshowPCB                   = true;      //-> Show the PCB in red : only in preview \nshowSwitches              = true;      //-> Show the switches (for pushbuttons) : only in preview \nshowButtonsDepressed      = false;      //-> Should the buttons in the Lid On view be in the pressed position\nshowOriginCoordBox        = false;      //-> Shows red bars representing the origin for yappCoordBox : only in preview \nshowOriginCoordBoxInside  = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowOriginCoordPCB        = true;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowMarkersPCB            = false;      //-> Shows black bars corners of the PCB : only in preview \nshowMarkersCenter         = false;      //-> Shows magenta bars along the centers of all faces  \ninspectX                  = 0;          //-> 0=none (>0 from Back)\ninspectY                  = 0;          //-> 0=none (>0 from Right)\ninspectZ                  = 0;          //-> 0=none (>0 from Bottom)\ninspectXfromBack          = true;       //-> View from the inspection cut foreward\ninspectYfromLeft          = true;       //-> View from the inspection cut to the right\ninspectZfromBottom        = true;       //-> View from the inspection cut up\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx\n//    (1) = posy\n//   Optional:\n//    (2) = Height to bottom of PCB : Default = standoffHeight\n//    (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    (4) = standoffDiameter    Default = standoffDiameter;\n//    (5) = standoffPinDiameter Default = standoffPinDiameter;\n//    (6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    (7) = filletRadius (0 = auto size)\n//    (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    (n) = { yappHole, <yappPin> } // Baseplate support treatment\n//    (n) = { yappAllCorners | yappFrontLeft | yappFrontRight | <yappBackLeft> | yappBackRight }\n//    (n) = { yappCoordBox, <yappCoordPCB> }  \n//    (n) = { yappNoFillet }\n//-------------------------------------------------------------------\n\n/*\npcb2X = 90;\npcb2Y = 6;\npcb2Length = 26;\npcb2Width = 50;\npcb2MountInset = 2.5;\npcb2HoleDiameter = 3;\npcb2Thickness = 1.7; \npcb2Height = 4;\n*/\n\npcbStands = [\n  // Electro cookie 30 row\n  [5.1, 8.25, yappAllCorners]\n  // Relay module\n ,[pcb2X + pcb2MountInset, pcb2Y             + pcb2MountInset,  pcb2Height, pcb2Thickness, 5, 2.8, yappCoordBox]\n ,[pcb2X + pcb2MountInset, pcb2Y + pcb2Width - pcb2MountInset,  pcb2Height, pcb2Thickness, 5, 2.8, yappCoordBox]\n ,[pcb2X + pcb2Length - pcb2MountInset, pcb2Y             + pcb2MountInset,  pcb2Height, pcb2Thickness, 5, 2.8, yappCoordBox]\n ,[pcb2X + pcb2Length - pcb2MountInset, pcb2Y + pcb2Width - pcb2MountInset,  pcb2Height, pcb2Thickness, 5, 2.8, yappCoordBox]\n];\n\n\n//===================================================================\n//  *** Connectors ***\n//  Standoffs with hole through base and socket in lid for screw type connections.\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//  \n//  Parameters:\n//   Required:\n//    (0) = posx\n//    (1) = posy\n//    (2) = pcbStandHeight\n//    (3) = screwDiameter\n//    (4) = screwHeadDiameter (don't forget to add extra for the fillet)\n//    (5) = insertDiameter\n//    (6) = outsideDiameter\n//   Optional:\n//    (7) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    (8) = filletRadius : Default = 0/Auto(0 = auto size)\n//    (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    (n) = { <yappCoordBox>, yappCoordPCB }\n//    (n) = { yappNoFillet }\n//-------------------------------------------------------------------\n\nconnectors   =\n  [\n  //  [9, 15, 10, 2.5, 6 + 1.25, 4.0, 9, 0, yappFrontRight]\n  // ,[9, 15, 10, 2.5, 6+ 1.25, 4.0, 9, 0, yappFrontLeft]\n  // ,[34, 15, 10, 2.5, 6+ 1.25, 4.0, 9, 0, yappFrontRight]\n  // ,[34, 15, 10, 2.5, 6+ 1.25, 4.0, 9, 0, yappFrontLeft]\n  ];\n\n//===================================================================\n//  *** Box Mounts ***\n//  Mounting tabs on the outside of the box\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X.\n//                    Position is to center of mounting screw in leftmost position in slot\n//    p(1) = screwDiameter\n//    p(2) = width of opening in addition to screw diameter \n//                    (0=Circular hole screwWidth = hole twice as wide as it is tall)\n//    p(3) = height\n//   Optional:\n//    p(4) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = { yappLeft | yappRight | yappFront | yappBack } : one or more\n//    n(b) = { yappNoFillet }\n//    n(c) = { <yappBase>, yappLid }\n//    n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of \n//                            the left of the opening\n//    n(e) = { <yappGlobalOrigin>, yappLeftOrigin } : Only affects Back and Right Faces\n//-------------------------------------------------------------------\nboxMounts =\n[\n  [shellWidth/2, 3, 10, 3, yappCenter, yappFront, yappBack]//, yappCenter]\n //  [[10,10], 3, 0, 3, yappFront, yappBack]\n];\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase, cutoutsLid, cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//                      +-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be provided\n//\n//  Parameters:\n//   Required:\n//    (0) = from Back\n//    (1) = from Left\n//    (2) = width\n//    (3) = length\n//    (4) = radius\n//    (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    (7) = angle : Default = 0\n//    (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.\n//    (n) = { [yappMaskDef, hOffset, vOffset, rotations] } : If a list for a mask is added it will be used as a mask for the cutout. With the Rotation and offsets applied. THis can be used to fine tune the mask placement in the opening.\n//    (n) = { yappCoordBox | <yappCoordPCB> }\n//    (n) = { <yappOrigin>, yappCenter }\n//  (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top, Back and Right Faces\n//-------------------------------------------------------------------\n\ncutoutsBase = \n[\n  // Vent\n//  [shellLength/2,shellWidth/2 ,55,55, 5, yappPolygon, shapeHexagon, [maskBars,1,1.5], yappCenter]\n];\n\ncutoutsLid  = \n[\n// OLED Screen\n  [35,25 ,22,32, 0, yappRectangle ,yappCenter, yappCoordBox] \n\n];\n\ncutoutsFront =  \n[\n//  [68, 12, 14,  5,  2.5, yappRoundedRect, yappCenter, yappCoordBox]\n\n];\n\n\ncutoutsBack = \n[\n  // Cutout for USB\n [pcbWidth/2, 13, 13,7.5, 2, yappRoundedRect , yappCenter]\n];\n\ncutoutsLeft =   \n[\n [70, 13, 0,0, 3, yappCircle , yappCenter]\n,[103, 3, 0,0, 3, yappCircle , yappCenter]\n\n];\n\ncutoutsRight =  \n[\n  //Cutout for cable\n//  [35,6 ,0,0, 3.25, yappCircle,yappCenter]\n  // Make the hole thru the end of the ridge extansion\n  [38, 12, 14,  5,  2.5, yappRoundedRect, yappCenter, yappCoordBox]\n ,[80, 12, 14,  4,  2,   yappRoundedRect, yappCenter, yappCoordBox]\n\n];\n\n\n//===================================================================\n//  *** Snap Joins ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx | posy\n//    (1) = width\n//    (n) = yappLeft / yappRight / yappFront / yappBack (one or more)\n//   Optional:\n//    (n) = { <yappOrigin> | yappCenter }\n//    (n) = { yappSymmetric }\n//    (n) = { yappRectangle } == Make a diamond shape snap\n//-------------------------------------------------------------------\n\nsnapJoins =   \n[\n  [(shellWidth/2),     10, yappFront, yappCenter]\n ,[(shellWidth/2-28),     10, yappBack, yappSymmetric, yappCenter]\n //,[25,  10, yappBack, yappBack, yappSymmetric, yappCenter]\n ,[(shellLength/4),    10, yappLeft, yappSymmetric, yappCenter]\n ,[(shellLength/2-5),    10, yappRight, yappCenter]\n];\n\n//===================================================================\n//  *** Light Tubes ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx\n//    (1) = posy\n//    (2) = tubeLength\n//    (3) = tubeWidth\n//    (4) = tubeWall\n//    (5) = gapAbovePcb\n//    (6) = tubeType    {yappCircle|yappRectangle}\n//   Optional:\n//    (7) = lensThickness (how much to leave on the top of the lid for the light to shine through 0 for open hole : Default = 0/Open\n//    (8) = Height to top of PCB : Default = standoffHeight+pcbThickness\n//    (9) = filletRadius : Default = 0/Auto \n//    (n) = { yappCoordBox, <yappCoordPCB> }\n//    (n) = { yappNoFillet }\n//-------------------------------------------------------------------\n\nlightTubes =\n[\n];\n\n//===================================================================\n//  *** Push Buttons ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = capLength \n//    p(3) = capWidth \n//    p(4) = capRadius \n//    p(5) = capAboveLid\n//    p(6) = switchHeight\n//    p(7) = switchTravel\n//    p(8) = poleDiameter\n//   Optional:\n//    p(9) = Height to top of PCB : Default = standoffHeight + pcbThickness\n//    p(10) = Shape  {yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey} : Default = yappRectangle\n//    p(11) = angle : Default = 0\n//    p(12) = filletRadius          : Default = 0/Auto \n//    p(13) = buttonWall            : Default = 2.0;\n//    p(14) = buttonPlateThickness  : Default= 2.5;\n//    p(15) = buttonSlack           : Default= 0.25;\n//    n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside } \n//    n(b) = { yappLeftOrigin, <yappGlobalOrigin> }\n//    n(c) = { yappNoFillet }\n//-------------------------------------------------------------------\npushButtons = \n[\n  // Reset button\n    [(8.820+(2.54*1)),(pcbWidth/2)+(3.810+(2.54*1.5)), \n    8, // Length\n    8, // Width\n    1, // Radius Diameter\n    1, // Cap above Lid\n    14.3, // Switch Height\n    0.5, // Switch travel\n    3.5, // Pole Diameter\n    undef, // Height to top of PCB\n    yappRoundedRect, // Shape\n    0\n    ]\n];\n    \n\n//===================================================================\n//  *** Ridge Extension ***\n//    Extension from the lid into the case for adding split opening at various heights\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = pos\n//    (1) = width\n//    (2) = height : Where to relocate the seam : yappCoordPCB = Above (positive) the PCB\n//                                                yappCoordBox = Above (positive) the bottom of the shell (outside)\n//   Optional:\n//    (n) = { <yappOrigin>, yappCenter } \n//    (n) = { yappCoordBox, <yappCoordPCB> }\n//    (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces\n\n// Note: use ridgeExtTop to reference the top of the extension for cutouts.\n// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.\n//-------------------------------------------------------------------\nridgeExtFront =\n[\n//  [68, 14, 12, yappCoordBox, yappCenter]\n\n];\n\nridgeExtBack =\n[\n  [pcbWidth/2, 13, 12, yappCenter]\n\n];\n\nridgeExtLeft =\n[\n [75, 6, 13+5.6+1.5, yappCoordBox, yappCenter]\n,[108, 6, 3+5.6+1.5, yappCoordBox, yappCenter]\n\n];\n\nridgeExtRight =\n[\n  // Make a ridge extension 6mm wide 10mm below the top of the ridge\n  [38, 14, 12, yappCoordBox, yappCenter]\n ,[80, 14, 12, yappCoordBox, yappCenter]\n ];\n\n    \n//===================================================================\n//  *** Labels ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   (0) = posx\n//   (1) = posy/z\n//   (2) = rotation degrees CCW\n//   (3) = depth : positive values go into case (Remove) negative valies are raised (Add)\n//   (4) = plane {yappLeft | yappRight | yappFront | yappBack | yappTop | yappBottom}\n//   (5) = font\n//   (6) = size\n//   (7) = \"label text\"\n//-------------------------------------------------------------------\n\nlabelsPlane =\n[\n    [5, 5, 0, 1, yappLid, \"Liberation Mono:style=bold\", 6, \"DMR\" ]\n\n//    ,[83.5,           22,   -90, 1, yappLid, \"Liberation Mono\", 4, \"Front\" ,0.15]\n//    ,[83.5-(2.54*3),  22,   -90, 1, yappLid, \"Liberation Mono\", 4, \"Drive\" ,0.15]\n//    ,[83.5-(2.54*6),  22,   -90, 1, yappLid, \"Liberation Mono\", 4, \"Rear\" ,0.15 ]\n//    ,[83.5-(2.54*9),  22,   -90, 1, yappLid, \"Liberation Mono\", 4, \"Pool\" ,0.15 ]\n//    ,[83.5,           57,   -90, 1, yappLid, \"Liberation Mono\", 4, \"Alarm\" ,0.15 ]\n//    ,[83.5-(2.54*3),  57,   -90, 1, yappLid, \"Liberation Mono\", 4, \"Muted\" ,0.15 ]\n//    ,[83.5-(2.54*12), 47,   -90, 1, yappLid, \"Liberation Mono\", 4, \"Mute\" ,0.15 ]\n\n];\n\n\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();\ntranslate([48,(shellWidth + shiftLid*2)+47,0])\nrotate([0,0,90])\nimport(\"C:/Users/rosen/OneDrive/Documents/3d Models/OLED mount-hook.stl\", convexity=3);\n"
  },
  {
    "path": "examples/RidgeExtDemo_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for Ridge Edge Demo\n//\n//  Version 3.0 (12-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n//---------------------------------------------------------\n// This design is parameterized based on the size of a PCB.\n//---------------------------------------------------------\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n      padding-back|<------pcb length --->|<padding-front\n                            RIGHT\n        0    X-axis ---> \n        +----------------------------------------+   ---\n        |                                        |    ^\n        |                                        |   padding-right \n      Y |                                        |    v\n      | |    -5,y +----------------------+       |   ---              \n B    a |         | 0,y              x,y |       |     ^              F\n A    x |         |                      |       |     |              R\n C    i |         |                      |       |     | pcb width    O\n K    s |         |                      |       |     |              N\n        |         | 0,0              x,0 |       |     v              T\n      ^ |    -5,0 +----------------------+       |   ---\n      | |                                        |    padding-left\n      0 +----------------------------------------+   ---\n        0    X-as --->\n                          LEFT\n*/\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 150; // Front to back\npcbWidth            = 100; // Side to side\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 4.0;\nbasePlaneThickness  = 1.5;\nlidPlaneThickness   = 1.5;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//                       + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 25;\nlidWallHeight       = 25;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight \n//     or 1.8x wallThickness if using snaps\nridgeHeight         = 10.0;\nridgeSlack          = 0.2;\n\n//-- Radius of the shell corners\nroundRadius         = 3;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 10.0;  //-- used for PCB Supports, Push Button and showPCB\nstandoffDiameter    = 7;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = false;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 8;        //-> from 1 to 32, Default = 8\nonLidGap            = 12;\nshiftLid            = 5;\ncolorLid            = \"YellowGreen\";   \nalphaLid            = 1;\ncolorBase           = \"BurlyWood\";\nalphaBase           = 1;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\nshowOrientation     = true;\nshowPCB             = false;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack    = true;     //-> View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = false;    //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//                      +-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be provided\n//\n//  Parameters:\n//   Required:\n//    (0) = from Back\n//    (1) = from Left\n//    (2) = width\n//    (3) = length\n//    (4) = radius\n//    (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    (7) = angle : Default = 0\n//    (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.\n//    (n) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added it will be used as a mask for the cutout. With the Rotation and offsets applied. This can be used to fine tune the mask placement within the opening.\n//    (n) = { <yappCoordBox> | yappCoordPCB }\n//    (n) = { <yappOrigin>, yappCenter }\n//  (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces\n\n//    (n) = { <yappBoth> | yappLidOnly | yappBaseOnly } : What part of the shell to cut (only affects Left/Right/Front/Back\n\n\n//-------------------------------------------------------------------\n\ncutoutsBase = \n[\n];\n\ncutoutsLid  = \n[\n];\n\ncutoutsFront =  \n[\n//  1,                         2,  3,  4,  5, 6..\n  // This can only have a cable put through it after the case is assembled\n  // This could be used as a locking pin\n  [75,ridgeExtTop-(ridgeHeight/2), 0,  0,  1, yappCircle, yappCenter, yappCoordBox]\n  \n  // Make the hole thru the end of the ridge extansion\n ,[85,ridgeExtTop-ridgeHeight-3, 0,  0,  3, yappCircle, yappCoordBox]\n \n  // In the Middle of the Ridge\n ,[95+3,ridgeExtTop-(ridgeHeight/2), 0,  0,  2.5, yappCircle, yappCenter, yappCoordBox]\n\n  // Make the hole thru the end of the ridge extansion\n ,[25,ridgeExtTop-10-3, 0,  0,  3, yappCircle, yappCoordBox]\n\n  // Make the rounded rect thru the end of the ridge extansion\n ,[45,ridgeExtTop - 15-3, 20, 6,  3, yappRoundedRect, yappCoordBox]\n\n  // Make the hexagonal thru the end of the ridge extansion\n ,[38,ridgeExtTop - 15, 6, 6,  0, yappPolygon, 0, 30, shapeHexagon, yappCenter, yappCoordBox]\n\n\n];\n\n/***\ncutoutsBack = \n[\n  // Make the hole thru the end of the ridge extansion\n  [25,ridgeExtTop-10-3, 0,  0,  3, yappCircle]\n\n  // Make the hole thru the end of the ridge extansion\n ,[25,ridgeExtTop-10-3, 6,  6,  0, yappPolygon, shape6ptStar, yappLeftOrigin]\n\n  // Make the rounded rect thru the end of the ridge extansion\n ,[45,ridgeExtTop - 15-3, 20, 6,  3, yappRoundedRect]\n\n  // Make the hexagonal thru the end of the ridge extansion\n ,[38,ridgeExtTop - 15, 6, 6,  0, yappPolygon, 0, 30, shapeHexagon, yappCenter]\n\n\n];\n\ncutoutsLeft =   \n[\n  // Make the hole thru the end of the ridge extansion\n  // Height = ridgeExtTop - height of the ext - the diameter of the circle\n  [25,ridgeExtTop-10-3, 0,  0,  3, yappCircle]\n\n  // Make the rounded rect thru the end of the ridge extansion\n ,[45,ridgeExtTop - 15-3, 10, 6,  3, yappRoundedRect]\n\n  // Make the hexagonal thru the end of the ridge extansion\n ,[38,ridgeExtTop - 15, 6, 6,  0, yappPolygon, 0, 30, shapeHexagon, yappCenter]\n\n\n];\n\ncutoutsRight =  \n[\n  // Make the hole thru the end of the ridge extansion\n  [25,ridgeExtTop-10-3, 0,  0,  3, yappCircle]\n\n  // Make the hole thru the end of the ridge extansion\n ,[25,ridgeExtTop-10-3, 6,  6,  0, yappPolygon, shape6ptStar, yappLeftOrigin]\n\n  // Make the rounded rect thru the end of the ridge extansion\n ,[45,ridgeExtTop - 15-3, 20, 6,  3, yappRoundedRect]\n\n  // Make the hexagonal thru the end of the ridge extansion\n ,[38,ridgeExtTop - 15, 6, 6,  0, yappPolygon, 0, 30, shapeHexagon, yappCenter]\n\n\n];\n\n***/\n\n//===================================================================\n//  *** Ridge Extension ***\n//    Extension from the lid into the case for adding split opening at various heights\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = pos\n//    (1) = width\n//    (2) = height : Distance below the ridge : Negative to move into lid\n//   Optional:\n//    (n) = { <yappOrigin>, yappCenter } \n//    (n) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces\n\n// Note: use ridgeExtTop to reference the top of the extension for cutouts.\n// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.\n//-------------------------------------------------------------------\nridgeExtFront =\n[\n [85, 6, ridgeHeight]\n  \n  // Make a ridge extension 6mm wide in the middle of the ridge \n ,[95, 6, 5]\n   \n  // Make a ridge extension 6mm wide 10mm below the top of the ridge\n ,[25, 6, 10]\n  \n  // Make a ridge extension 20mm wide 15mm below the top of the ridge\n ,[45, 20, 15]\n \n // Make a ridge extension 6mm wide 15mm below the top of the ridge\n ,[35, 6, 15]\n];\n\nridgeExtBack =\n[\n  // Make a ridge extension 6mm wide 10mm below the top of the ridge\n  [25, 6, 10]\n  \n  // Make a ridge extension 6mm wide 10mm below the top of the ridge from the left edge\n ,[25, 6, 10, yappLeftOrigin]\n  \n  // Make a ridge extension 20mm wide 15mm below the top of the ridge\n ,[45, 20, 15]\n \n // Make a ridge extension 6mm wide 15mm below the top of the ridge\n ,[35, 6, 15]\n];\n\nridgeExtLeft =\n[\n  // Make a ridge extension 6mm wide 10mm below the top of the ridge\n  [25, 6, 10]\n  // Make a ridge extension 6mm wide 15mm below the top of the ridge\n ,[35, 6, 15]\n  // Make a ridge extension 20mm wide 15mm below the top of the ridge\n ,[45, 10, 15]\n \n\n\n // Make a ridge extension 6mm wide 15mm below the top of the ridge\n ,[60, 5, (ridgeHeight/10)* -14]\n ,[70, 5, (ridgeHeight/10)* -10]\n ,[80, 5, (ridgeHeight/10)* -6]\n ,[90, 5, (ridgeHeight/10)* -2]\n ,[100, 5,(ridgeHeight/10)*  2]\n ,[110, 5,(ridgeHeight/10)* 6]\n ,[120, 5,(ridgeHeight/10)* 10]\n ,[130, 5,(ridgeHeight/10)* 14]\n ,[140, 5,(ridgeHeight/10)* 18]\n ,[150, 5,(ridgeHeight/10)* 22]\n];\n\nridgeExtRight =\n[\n  // Make a ridge extension 6mm wide 10mm below the top of the ridge\n  [25, 6, 10]\n  \n  // Make a ridge extension 6mm wide 10mm below the top of the ridge from the left edge\n ,[25, 6, 10, yappLeftOrigin]\n  \n  // Make a ridge extension 20mm wide 15mm below the top of the ridge\n ,[45, 20, 15]\n \n // Make a ridge extension 6mm wide 15mm below the top of the ridge\n ,[35, 6, 15]\n];\n\n\n  \n  \n//===================================================================\n//  *** Labels ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   (0) = posx\n//   (1) = posy/z\n//   (2) = rotation degrees CCW\n//   (3) = depth : positive values go into case (Remove) negative valies are raised (Add)\n//   (4) = plane {yappLeft | yappRight | yappFront | yappBack | yappTop | yappBottom}\n//   (5) = font\n//   (6) = size\n//   (7) = \"label text\"\n//-------------------------------------------------------------------\nlabelsPlane =\n[\n];\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();"
  },
  {
    "path": "examples/WaterHeaterMonitor_v3.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0.1 (2024-01-15)\n//\n// This design is parameterized based on the size of a PCB.\n//\n// For many/complex cutoutGrills, you might need to adjust\n//  the max number of elements in OpenSCAD:\n//\n//      Preferences->Advanced->Turn off rendering at 250000 elements\n//                                                   ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n//---------------------------------------------------------\n// This design is parameterized based on the size of a PCB.\n//---------------------------------------------------------\n// Note: length/lengte refers to X axis, \n//       width/breedte refers to Y axis,\n//       height/hoogte refers to Z axis\n\n/*\n      padding-back|<------pcb length --->|<padding-front\n                            RIGHT\n        0    X-axis ---> \n        +----------------------------------------+   ---\n        |                                        |    ^\n        |                                        |   padding-right \n      Y |                                        |    v\n      | |    -5,y +----------------------+       |   ---              \n B    a |         | 0,y              x,y |       |     ^              F\n A    x |         |                      |       |     |              R\n C    i |         |                      |       |     | pcb width    O\n K    s |         |                      |       |     |              N\n        |         | 0,0              x,0 |       |     v              T\n      ^ |    -5,0 +----------------------+       |   ---\n      | |                                        |    padding-left\n      0 +----------------------------------------+   ---\n        0    X-as --->\n                          LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\n\n\n// ********************************************************************\n// The Following will be used as the first element in the pbc array\npcbLength           = 88.9; // Front to back\npcbWidth            = 52.1; // Side to side\npcbThickness        = 1.6;\nstandoffHeight      = 3.0;  //-- How much the PCB needs to be raised from the base to leave room for solderings and whatnot\nstandoffDiameter    = 7;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\n\n//===================================================================\n// *** PCBs ***\n// Printed Circuit Boards\n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : yappCoordBoxInside[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = name\n//    p(1) = length\n//    p(2) = width\n//    p(3) = posx\n//    p(4) = posy\n//    p(5) = Thickness\n//    p(6) = standoffHeight\n//    p(7) = standoffDiameter\n//    p(8) = standoffPinDiameter\n//    p(9) = standoffHoleSlack (default to 0.4)\n//   Optional:\n\n//The following can be used to get PCB values elsewhere in the script - not in pcb definition. \n//If \"PCB Name\" is omitted then \"Main\" is used\n//  pcbLength           --> pcbLength(\"PCB Name\")\n//  pcbWidth            --> pcbWidth(\"PCB Name\")\n//  pcbThickness        --> pcbThickness(\"PCB Name\") \n//  standoffHeight      --> standoffHeight(\"PCB Name\") \n//  standoffDiameter    --> standoffDiameter(\"PCB Name\") \n//  standoffPinDiameter --> standoffPinDiameter(\"PCB Name\") \n//  standoffHoleSlack   --> standoffHoleSlack(\"PCB Name\") \n\npcb = \n[\n  [\"Main\",              pcbLength,pcbWidth,    0,34,    pcbThickness,  standoffHeight, standoffDiameter, standoffPinDiameter, standoffHoleSlack]\n ,[\"Voltage Detect 1\",  ,71.5, 15.1,  5,0,        1.6,  3, 5, 2.5]\n ,[\"Voltage Detect 2\",  ,71.5, 15.1,  5,16.1,     1.6,  3, 5, 2.5]\n];\n\n//-------------------------------------------------------------------\n\n\n\n\n  \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.4;\nbasePlaneThickness  = 1.2;\nlidPlaneThickness   = 1.2;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 9;\nlidWallHeight       = 17;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.2;\nroundRadius         = 3.0;\n\n\n// Set the layer height of your printer\nprinterLayerHeight  = 0.2;\n\n\n\n\n\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n// -- Render --\nrenderQuality             = 8;          //-> from 1 to 32, Default = 8\n\n// --Preview --\npreviewQuality            = 5;          //-> from 1 to 32, Default = 5\nshowSideBySide            = true;       //-> Default = true\nonLidGap                  = 0;  // tip don't override to animate the lid opening\ncolorLid                  = \"YellowGreen\";   \nalphaLid                  = 1;\ncolorBase                 = \"BurlyWood\";\nalphaBase                 = 1;\nhideLidWalls              = false;      //-> Remove the walls from the lid : only if preview and showSideBySide=true \nhideBaseWalls             = false;      //-> Remove the walls from the base : only if preview and showSideBySide=true  \nshowOrientation           = true;       //-> Show the Front/Back/Left/Right labels : only in preview\nshowPCB                   = true;      //-> Show the PCB in red : only in preview \nshowSwitches              = true;      //-> Show the switches (for pushbuttons) : only in preview \nshowButtonsDepressed      = false;      //-> Should the buttons in the Lid On view be in the pressed position\nshowOriginCoordBox        = false;      //-> Shows red bars representing the origin for yappCoordBox : only in preview \nshowOriginCoordBoxInside  = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowOriginCoordPCB        = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowMarkersPCB            = false;      //-> Shows black bars corners of the PCB : only in preview \nshowMarkersCenter         = false;      //-> Shows magenta bars along the centers of all faces  \ninspectX                  = 0;          //-> 0=none (>0 from Back)\ninspectY                  = 0;          //-> 0=none (>0 from Right)\ninspectZ                  = 0;          //-> 0=none (>0 from Bottom)\ninspectXfromBack          = true;       //-> View from the inspection cut foreward\ninspectYfromLeft          = true;       //-> View from the inspection cut to the right\ninspectZfromBottom        = true;       //-> View from the inspection cut up\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n\n//-------------------------------------------------------------------\n//-------------------------------------------------------------------\n// Start of Debugging config (used if not overridden in template)\n// ------------------------------------------------------------------\n// ------------------------------------------------------------------\n\n//==================================================================\n//  *** Shapes ***\n//------------------------------------------------------------------\n//  There are a view pre defines shapes and masks\n//  shapes:\n//      shapeIsoTriangle, shapeHexagon, shape6ptStar\n//\n//  masks:\n//      maskHoneycomb, maskHexCircles, maskBars, maskOffsetBars\n//\n//------------------------------------------------------------------\n// Shapes should be defined to fit into a 1x1 box (+/-0.5 in X and Y) - they will \n// be scaled as needed.\n// defined as a vector of [x,y] vertices pairs.(min 3 vertices)\n// for example a triangle could be [yappPolygonDef,[[-0.5,-0.5],[0,0.5],[0.5,-0.5]]];\n// To see how to add your own shapes and mask see the YAPPgenerator program\n//------------------------------------------------------------------\n\n\n// Show sample of a Mask\n//SampleMask(maskHoneycomb);\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//   Optional:\n//    p(2) = Height to bottom of PCB : Default = standoff_Height\n//    p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcb_Thickness, yappCoordBox=0\n//    p(4) = standoff_Diameter    Default = standoff_Diameter;\n//    p(5) = standoff_PinDiameter Default = standoff_PinDiameter;\n//    p(6) = standoff_HoleSlack   Default = standoff_HoleSlack;\n//    p(7) = filletRadius (0 = auto size)\n//    n(a) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    n(b) = { <yappPin>, yappHole } // Baseplate support treatment\n//    n(c) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { yappNoFillet }\n//    n(f) = [yappPCBName, \"XXX\"] : {Specify a PCB defaults to \"Main\"\n//-------------------------------------------------------------------\npcbStands = \n[\n//- Add stands 5mm from each corner of the PCB\n    [5, 5, yappAllCorners]\n//-   Add posts 25mm from the corners of the box, with a custon height,diameter, Pin Size, hole\n//-   slack and filler radius.\n//  [25, 25, 10, 10, 3.3, 0.9, 5, yappCoordBox] \n//  [5,5, yappAllCorners]\n\n  // Voltage Dector boards have 2 offset pins\n ,[15.4,  6.5, undef, undef, 5, 2.5, [yappPCBName, \"Voltage Detect 1\"]]\n ,[55.7, 2.25, undef, undef, 5, 2.5, [yappPCBName, \"Voltage Detect 1\"]]\n\n ,[15.4,  6.5, undef, undef, 5, 2.5, [yappPCBName, \"Voltage Detect 2\"]]\n ,[55.7, 2.25, undef, undef, 5, 2.5, [yappPCBName, \"Voltage Detect 2\"]]\n\n\n];\n\n\n//===================================================================\n//  *** Connectors ***\n//  Standoffs with hole through base and socket in lid for screw type connections.\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//  \n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = pcbStandHeight\n//    p(3) = screwDiameter\n//    p(4) = screwHeadDiameter (don't forget to add extra for the fillet)\n//    p(5) = insertDiameter\n//    p(6) = outsideDiameter\n//   Optional:\n//    p(7) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    p(8) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = { <yappAllCorners>, yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    n(b) = { <yappCoordBox> | yappCoordPCB |  yappCoordBoxInside }\n//    n(c) = { yappNoFillet }\n//    n(d) = [yappPCBName, \"XXX\"] : {XXX = the PCB name: Default \"Main\"}\n//-------------------------------------------------------------------\nconnectors   =\n[\n//  [9, 15, standoffHeight(\"PCB3\"), 2.5, 6 + 1.25, 4.0, 9, yappAllCorners, [yappPCBName, \"PCB3\"]]\n];\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//----------------------+-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be\n//                      |                       |               | provided\n//----------------------+-----------------------+---------------+------------------------------------\n//\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                     | yappCircleWithFlats | yappCircleWithKey }\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces\n//    n(g) = [yappPCBName, \"XXX\"] : {Specify a PCB defaults to \"Main\"\n//-------------------------------------------------------------------\ncutoutsBase = \n[\n  [pcbLength()/2,pcbWidth()/2 ,55,55, 5, yappPolygon ,0 ,0, yappCenter, shapeHexagon, [maskHoneycomb,0,1.5,0], ]\n// , [0, 0, 10, 10, 0, yappRectangle, maskHexCircles, [yappPCBName, \"PCB3\"]]\n// , [shellLength*2/3,shellWidth/2 ,0, 30, 20, yappCircleWithFlats, yappCenter]\n// , [shellLength/2,shellWidth/2 ,10, 5, 20, yappCircleWithKey,yappCenter]\n];\n\ncutoutsLid  = \n[\n];\n\ncutoutsFront =  \n[\n];\n\ncutoutsBack = \n[\n  // Cutout for USB\n [pcbWidth()/2, 13 -pcbThickness() ,12.5,7.0, 2, yappRoundedRect , yappCenter]\n \n  // Cutout for AC 1\n ,[pcbWidth(\"Voltage Detect 1\")/2, pcbThickness(\"Voltage Detect 1\") + 3 ,11,7.0, 2, yappRoundedRect , yappCenter, [yappPCBName, \"Voltage Detect 1\"]]\n  // Cutout for AC 2\n ,[pcbWidth(\"Voltage Detect 2\")/2, pcbThickness(\"Voltage Detect 2\") + 3 ,11,7.0, 2, yappRoundedRect , yappCenter, [yappPCBName, \"Voltage Detect 2\"]]\n\n];\n\ncutoutsLeft =   \n[\n];\n\ncutoutsRight =  \n[\n [pcbLength()/2, pcbThickness() + 3 ,12.5,7.0, 2, yappRoundedRect , yappCenter]\n\n];\n\n\n\n//===================================================================\n//  *** Snap Joins ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx | posy\n//    p(1) = width\n//    p(2) = { yappLeft | yappRight | yappFront | yappBack } : one or more\n//   Optional:\n//    n(a) = { <yappOrigin>, yappCenter }\n//    n(b) = { yappSymmetric }\n//    n(c) = { yappRectangle } == Make a diamond shape snap\n//-------------------------------------------------------------------\nsnapJoins   =   \n[\n    [30, 10, yappFront, yappCenter, yappSymmetric]\n   ,[47, 10, yappBack,  yappCenter]\n   ,[30, 10, yappRight, yappCenter, yappSymmetric]\n   ,[30, 10, yappLeft,  yappCenter, yappSymmetric]\n];\n\n//===================================================================\n//  *** Box Mounts ***\n//    Mounting tabs on the outside of the box\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X.\n//                    Position is to center of mounting screw in leftmost position in slot\n//    p(1) = screwDiameter\n//    p(2) = width of opening in addition to screw diameter \n//                    (0=Circular hole screwWidth = hole twice as wide as it is tall)\n//    p(3) = height\n//   Optional:\n//    p(4) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = { yappLeft | yappRight | yappFront | yappBack } : one or more\n//    n(b) = { yappNoFillet }\n//    n(c) = { <yappBase>, yappLid }\n//    n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of \n//                            the left of the opening\n//    n(e) = { <yappGlobalOrigin>, yappLeftOrigin } : Only affects Back and Right Faces\n//-------------------------------------------------------------------\nboxMounts =\n[\n  [shellWidth/2,3,-3,4,yappFront, yappCenter]\n];\n\n//===================================================================\n//  *** Light Tubes ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = tubeLength\n//    p(3) = tubeWidth\n//    p(4) = tubeWall\n//    p(5) = gapAbovePcb\n//    p(6) = { yappCircle | yappRectangle } : tubeType    \n//   Optional:\n//    p(7) = lensThickness (how much to leave on the top of the lid for the \n//           light to shine through 0 for open hole : Default = 0/Open\n//    p(8) = Height to top of PCB : Default = standoffHeight+pcbThickness\n//    p(9) = filletRadius : Default = 0/Auto \n//    n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside } \n//    n(b) = { <yappGlobalOrigin>, yappLeftOrigin }\n//    n(c) = { yappNoFillet }\n//    n(d) = [yappPCBName, \"XXX\"] : {Specify a PCB defaults to \"Main\"\n//-------------------------------------------------------------------\nlightTubes =\n[\n// ESP Power Light\n  [12.5 + 3, (pcbWidth()/2)+7.0,    // [0,1] Pos\n    3, 3,                   // [2,3] Length, Width\n    0.8,                      // [4]   wall thickness\n    standoffHeight() + pcbThickness() + 12, // [5] Gap above base bottom\n    yappCircle,          // [6]   tubeType (Shape)\n    0,                    // [7]   lensThickness\n    yappCoordPCB            // [n1]\n  ]\n  \n// Voltage Detect 1 power indicator\n ,[30,pcbWidth(\"Voltage Detect 1\")/2,     // [0,1] Pos\n    6, 6,                   // [2,3] Length, Width\n    0.8,                      // [4]   wall thickness\n    5, // [5] gapAbovePcb\n    yappCircle,          // [6]   tubeType (Shape)\n    0,                    // [7]   lensThickness\n    yappCoordPCB            // [n1]\n    ,[yappPCBName, \"Voltage Detect 1\"]\n  ]\n  \n// Voltage Detect 2 power indicator\n ,[30,pcbWidth(\"Voltage Detect 2\")/2,     // [0,1] Pos\n    6, 6,                   // [2,3] Length, Width\n    0.8,                      // [4]   wall thickness\n    5, // [5] Gap above base bottom\n    yappCircle,          // [6]   tubeType (Shape)\n    0,                    // [7]   lensThickness\n    yappCoordPCB            // [n1]\n    ,[yappPCBName, \"Voltage Detect 2\"]\n  ]\n  \n];\n\n//===================================================================\n//  *** Push Buttons ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = capLength \n//    p(3) = capWidth \n//    p(4) = capRadius \n//    p(5) = capAboveLid\n//    p(6) = switchHeight\n//    p(7) = switchTravel\n//    p(8) = poleDiameter\n//   Optional:\n//    p(9) = Height to top of PCB : Default = standoffHeight + pcbThickness\n//    p(10) = { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey } : Shape, Default = yappRectangle\n//    p(11) = angle : Default = 0\n//    p(12) = filletRadius          : Default = 0/Auto \n//    p(13) = buttonWall            : Default = 2.0;\n//    p(14) = buttonPlateThickness  : Default= 2.5;\n//    p(15) = buttonSlack           : Default= 0.25;\n//    n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside } \n//    n(b) = { <yappGlobalOrigin>,  yappLeftOrigin }\n//    n(c) = { yappNoFillet }\n//    n(d) = [yappPCBName, \"XXX\"] : {Specify a PCB defaults to \"Main\"\n//-------------------------------------------------------------------\npushButtons = \n[\n  // ESP Reset Button\n  [2.54 + 3, (pcbWidth()/2)+7.0, \n    8, // Width\n    8, // Length\n    2, // Radius\n    0, // Cap above Lid\n    15, // Switch Height\n    0.5, // Switch travel\n    3, // Pole Diameter\n    undef, // Height to top of PCB\n    yappRoundedRect // Shape\n   ]  \n//  ,[ 5, 5, 10, 10, 4, 2.0, 4, 1, 4, standoffHeight(), yappCircle, [yappPCBName, \"Voltage Detect 1\"]]\n];\n             \n//===================================================================\n//  *** Labels ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   p(0) = posx\n//   p(1) = posy/z\n//   p(2) = rotation degrees CCW\n//   p(3) = depth : positive values go into case (Remove) negative valies are raised (Add)\n//   p(4) = { yappLeft | yappRight | yappFront | yappBack | yappLid | yappBaseyappLid } : plane\n//   p(5) = font\n//   p(6) = size\n//   p(7) = \"label text\"\n//  Optional:\n//   p(8) = Expand : Default = 0 : mm to expand text by (making it bolder) \n//   p(9) = Direction : { <yappTextLeftToRight>, yappTextRightToLeft, yappTextTopToBottom, yappTextBottomToTop }\n//   p(10) = Horizontal alignment : { <yappTextHAlignLeft>, yappTextHAlignCenter, yappTextHAlignRight }\n//   p(11) = Vertical alignment : {  yappTextVAlignTop, yappTextVAlignCenter, yappTextVAlignBaseLine, \n//   p(12) = Character Spacing : Default = 1 \n//-------------------------------------------------------------------\nlabelsPlane =\n[\n    [6.5, shellWidth-28, -90, 1, yappLid, \"Liberation Mono\", 5, \"RESET\" , 0.15]\n   ,[16.5, shellWidth-28, -90, 1, yappLid, \"Liberation Mono\", 5, \"POWER\" ,0.15 ]\n   ,[43, shellWidth-56, -90, 1, yappLid, \"Liberation Mono\", 5, \"Elements\" ,0.15 ]\n   ,[34, shellWidth-65.5, -90, 1, yappLid, \"Liberation Mono\", 5, \"UPPER\" ,0.15, yappTextTopToBottom, undef, undef, 1.1]\n   ,[34, shellWidth-82, -90, 1, yappLid, \"Liberation Mono\", 5, \"LOWER\" ,0.15, yappTextTopToBottom, undef, undef, 1.1]\n];\n\n\n//===================================================================\n//  *** Ridge Extension ***\n//    Extension from the lid into the case for adding split opening at various heights\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = pos\n//    p(1) = width\n//    p(2) = height : Where to relocate the seam : yappCoordPCB = Above (positive) the PCB\n//                                                yappCoordBox = Above (positive) the bottom of the shell (outside)\n//   Optional:\n//    n(a) = { <yappOrigin>, yappCenter } \n//    n(b) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(c) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces\n//    n(d) = [yappPCBName, \"XXX\"] : {Specify a PCB defaults to \"Main\"\n//\n// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.\n//-------------------------------------------------------------------\nridgeExtLeft =\n[\n];\n\nridgeExtRight =\n[\n  [pcbLength()/2, 12.5, pcbThickness() + 3 , yappCenter]\n\n];\n\nridgeExtFront =\n[\n];\n\nridgeExtBack =\n[\n  [pcbWidth()/2, 12.5, 13,yappCoordPCB, yappCenter]\n ,[pcbWidth(\"Voltage Detect 1\")/2, 11, pcbThickness(\"Voltage Detect 1\") + 3, [yappPCBName, \"Voltage Detect 1\"], yappCenter]\n ,[pcbWidth(\"Voltage Detect 2\")/2, 11, pcbThickness(\"Voltage Detect 2\") + 3, [yappPCBName, \"Voltage Detect 2\"], yappCenter]\n];\n\n\n\n//========= HOOK functions ============================\n  \n// Hook functions allow you to add 3d objects to the case.\n// Lid/Base = Shell part to attach the object to.\n// Inside/Outside = Join the object from the midpoint of the shell to the inside/outside.\n// Pre = Attach the object Pre before doing Cutouts/Stands/Connectors. \n\n\n//===========================================================\n// origin = box(0,0,0)\nmodule hookLidInside()\n{\n  //if (printMessages) echo(\"hookLidInside() ..\");\n  \n} // hookLidInside()\n  \n\n//===========================================================\n// origin = box(0,0,shellHeight)\nmodule hookLidOutside()\n{\n  //if (printMessages) echo(\"hookLidOutside() ..\");\n  \n} // hookLidOutside()\n\n//===========================================================\n//===========================================================\n// origin = box(0,0,0)\nmodule hookBaseInside()\n{\n  //if (printMessages) echo(\"hookBaseInside() ..\");\n  color(\"Red\")\n  translate([(shellLength-1)/2,33,0])\n  cube([shellLength-1,1,5], center=true);\n  \n} // hookBaseInside()\n\n//===========================================================\n// origin = box(0,0,0)\nmodule hookBaseOutside()\n{\n  //if (printMessages) echo(\"hookBaseOutside() ..\");\n  \n} // hookBaseInside()\n\n// **********************************************************\n// **********************************************************\n// **********************************************************\n// *************** END OF TEMPLATE SECTION ******************\n// **********************************************************\n// **********************************************************\n// **********************************************************\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_ArduinoClone_v30.scad",
    "content": "//---------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This will generate a projectbox for a \"Arduino UNO 'clone'\"\n//\n//  Version 3.0 (02-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//---------------------------------------------------------\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n      padding-back|<------pcb length --->|<padding-front\n                            RIGHT\n        0    X-as ---> \n        +----------------------------------------+   ---\n        |                                        |    ^\n        |                                        |   padding-right \n        |                                        |    v\n        |    -5,y +----------------------+       |   ---              \n B    Y |         | 0,y              x,y |       |     ^              F\n A    - |         |                      |       |     |              R\n C    a |         |                      |       |     | pcb width    O\n K    s |         |                      |       |     |              N\n        |         | 0,0              x,0 |       |     v              T\n      ^ |   -5,0  +----------------------+       |   ---\n      | |                                        |    padding-left\n      0 +----------------------------------------+   ---\n        0    X-as --->\n                          LEFT\n*/\n\n//-- which half do you want to print?\nprintBaseShell    = true;\nprintLidShell     = true;\n\n\nmyPcb = \"./STL/MODELS/Arduino_Uno_model.stl\";\n\nif (true)\n{\n  translate([900.5, -271, 2.6]) \n  {\n    rotate([0,0,0]) color(\"lightgray\") import(myPcb);\n  }\n}\n\n//-- Edit these parameters for your own board dimensions\nwallThickness       = 1.8;\nbasePlaneThickness  = 1.2;\nlidPlaneThickness   = 1.7;\n\n//-- Total height of box = basePlaneThickness + lidPlaneThickness \n//--                     + baseWallHeight + lidWallHeight\n//-- space between pcb and lidPlane :=\n//--      (baseWallHeight+lidWall_heigth) - (standoff_heigth+pcbThickness)\n//--      (6.2 + 4.5) - (3.5 + 1.5) ==> 5.7\nbaseWallHeight    = 6.5;\nlidWallHeight     = 5.5;\n\n//-- pcb dimensions\npcbLength         = 68.5;\npcbWidth          = 53.3;\npcbThickness      = 1.5;\n                            \n//-- padding between pcb and inside wall\npaddingFront      = 2;\npaddingBack       = 2;\npaddingRight      = 2;\npaddingLeft       = 2;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight       = 3.5;\nroundRadius       = 2.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight    = 3.5;\npinDiameter       = 3.0;\nstandoffDiameter  = 5.2;\n\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = false;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 8;        //-> from 1 to 32, Default = 8\nonLidGap            = 5;\nshiftLid            = 1;\nhideLidWalls        = false;    //-> false\ncolorLid            = \"yellow\";   \nhideBaseWalls       = false;    //-> false\ncolorBase           = \"gray\";\nshowPCB             = false;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack    = true;     //-> View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = false;    //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx\n//    (1) = posy\n//   Optional:\n//    (2) = Height to bottom of PCB : Default = standoffHeight\n//    (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    (4) = standoffDiameter    Default = standoffDiameter;\n//    (5) = standoffPinDiameter Default = standoffPinDiameter;\n//    (6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    (7) = filletRadius (0 = auto size)\n//    (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    (n) = { yappHole, <yappPin> } // Baseplate support treatment\n//    (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    (n) = { yappCoordBox, <yappCoordPCB> }  \n//    (n) = { yappNoFillet }\n//-------------------------------------------------------------------\npcbStands = \n[\n  [13.8, 1.75, yappBoth, yappBackLeft, yappNoFillet]                           // back-left\n ,[15,   2.7,  yappBaseOnly, yappBackRight]                                    // back-right\n ,[14.5, 8,    undef, undef, 4, 0.5, 0,1, yappLidOnly, yappHole, yappBackRight]  // push down\n ,[2.4,  7,    yappBoth, yappPin, yappFrontLeft, yappNoFillet]                 // front-left\n ,[2.4, 18.2,  yappBoth, yappPin, yappFrontRight, yappNoFillet]                // front-right\n];\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//                      +-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be provided\n//\n//  Parameters:\n//   Required:\n//    (0) = from Back\n//    (1) = from Left\n//    (2) = width\n//    (3) = length\n//    (4) = radius\n//    (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    (7) = angle : Default = 0\n//    (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.\n//    (n) = { [yappMaskDef, hOffset, vOffst, rotation] } : If a list for a mask is added it will be used as a mask for the cutout. With the Rotation and offsets applied. This can be used to fine tune the mask placement within the opening.\n//    (n) = { <yappCoordBox> | yappCoordPCB }\n//    (n) = { <yappOrigin>, yappCenter }\n//  (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces\n//-------------------------------------------------------------------\ncutoutsLid =  \n[\n    [ 4, 38,   14, 14,   2,   yappRoundedRect, 20, yappCenter, yappCoordPCB]  // USB (right)\n   ,[ 3,  7.5, 15, 10,   1,   yappRoundedRect, yappCenter, yappCoordPCB]      // Power Jack\n//   ,[40,   53,  50, 10,   2,   yappRoundedRect, 10, yappCenter, yappCoordPCB]       // right headers\n//   ,[45.5, -1,  40, 10,   0,   yappRectangle, yappCenter, yappCoordPCB]     // left headers\n   ,[38,  3,   24.5, 10,   2,   yappRoundedRect, yappCenter, yappCoordPCB]    // left power header\n   ,[65, 27.5,  9, 12,   1,   yappRoundedRect, yappCenter, yappCoordPCB]      // ICSP1\n   ,[ 4, 47.5,  8,  0,   3,   yappCircle,                  yappCoordPCB]      // reset button\n   ,[26, 22.5,  3,  3.5, 1,   yappRoundedRect, yappCenter, yappCoordPCB]      // led 13\n   ,[26, 29,    3,  3.5, 1,   yappRoundedRect, yappCenter, yappCoordPCB]      // TX\n   ,[26, 35,    3,  3.5, 1,   yappRoundedRect, yappCenter, yappCoordPCB]      // RX\n   ,[26, 42,    3,  3.5, 1,   yappRoundedRect, yappCenter, yappCoordPCB]      // PWR\n];\n              \n//-- base plane    -- origin is pcb[0,0,0]\n// (0) = posx\n// (1) = posy\ncutoutsBase =   \n[\n      [pcbLength/2, pcbWidth/2 ,45, 45, 0, yappPolygon, shapeHexagon, maskHoneycomb, yappCenter, yappCoordPCB]\n];\n\n//-- back plane  -- origin is pcb[0,0,0]\n// (0) = posy\n// (1) = posz\ncutoutsBack = \n[\n    [38,   4, 14, 11, 1, yappRoundedRect, 25, yappCenter, yappCoordPCB] // USB-A\n   ,[ 7.5, 4, 10, 11, 1, yappRoundedRect, 5, yappCenter, yappCoordPCB]  // Power Jack\n];\n\n//-- right plane  -- origin is pcb[0,0,0]\n// (0) = posX\n// (1) = posZ\ncutoutsRight = \n[\n    [42.0, 7, 51, 3,  2,  yappRoundedRect, 10, yappCenter, yappCoordPCB] // right headers\n];\n//-- right plane  -- origin is pcb[0,0,0]\n// (0) = posX\n// (1) = posZ\ncutoutsLeft = \n[\n    [46.5, 7, 42, 3, 2,  yappRoundedRect, 9, yappCenter, yappCoordPCB]   // left headers\n];\n\n\n//===================================================================\n//  *** Snap Joins ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx | posy\n//    (1) = width\n//    (n) = yappLeft / yappRight / yappFront / yappBack (one or more)\n//   Optional:\n//    (n) = { <yappOrigin> | yappCenter }\n//    (n) = { yappSymmetric }\n//    (n) = { yappRectangle } == Make a diamond shape snap\n//-------------------------------------------------------------------\nsnapJoins   =   \n[\n    [10, 5,  yappRight, yappLeft, yappSymmetric]\n];\n\n//===================================================================\n//  *** Labels ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   (0) = posx\n//   (1) = posy/z\n//   (2) = rotation degrees CCW\n//   (3) = depth : positive values go into case (Remove) negative valies are raised (Add)\n//   (4) = plane {yappLeft | yappRight | yappFront | yappBack | yappTop | yappBottom}\n//   (5) = font\n//   (6) = size\n//   (7) = \"label text\"\n//-------------------------------------------------------------------\nlabelsPlane = [\n               [28, 14,  0, 0.8, yappTop, \"Arial:style=bold\", 4, \"Arduino CLONE\" ]\n             , [57, 25, 90, 0.8, yappTop, \"Liberation Mono:style=bold\", 5, \"YAPP\" ]\n             , [33, 23,  0, 0.8, yappTop, \"Liberation Mono:style=bold\", 4, \"L13\" ]\n             , [33, 30,  0, 0.8, yappTop, \"Liberation Mono:style=bold\", 4, \"TX\" ]\n             , [33, 36,  0, 0.8, yappTop, \"Liberation Mono:style=bold\", 4, \"RX\" ]\n             , [33, 43,  0, 0.8, yappTop, \"Liberation Mono:style=bold\", 4, \"PWR\" ]\n            ];\n\n\nYAPPgenerate();"
  },
  {
    "path": "examples/YAPP_Connector_Demo.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.3.5 (2025-22-14)\n//\n// This design is parameterized based on the size of a PCB.\n//\n// For many/complex cutoutGrills, you might need to adjust\n//  the max number of elements in OpenSCAD:\n//\n//      Preferences->Advanced->Turn off rendering at 250000 elements\n//                                                   ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <C:\\SourceCode\\YAPP_Box/YAPPgenerator_v3.scad>\n\n//---------------------------------------------------------\n// This design is parameterized based on the size of a PCB.\n//---------------------------------------------------------\n// Note: length/lengte refers to X axis, \n//       width/breedte refers to Y axis,\n//       height/hoogte refers to Z axis\n\n/*\n      padding-back|<------pcb length --->|<padding-front\n                            RIGHT\n        0    X-axis ---> \n        +----------------------------------------+   ---\n        |                                        |    ^\n        |                                        |   padding-right \n      Y |                                        |    v\n      | |    -5,y +----------------------+       |   ---              \n B    a |         | 0,y              x,y |       |     ^              F\n A    x |         |                      |       |     |              R\n C    i |         |                      |       |     | pcb width    O\n K    s |         |                      |       |     |              N\n        |         | 0,0              x,0 |       |     v              T\n      ^ |    -5,0 +----------------------+       |   ---\n      | |                                        |    padding-left\n      0 +----------------------------------------+   ---\n        0    X-as --->\n                          LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\nprintDisplayClips     = true;\n\n// ********************************************************************\n// The Following will be used as the first element in the pbc array\n\n//Defined here so you can define the \"Main\" PCB using these if wanted\npcbLength           = 150; // front to back (X axis)\npcbWidth            = 100; // side to side (Y axis)\npcbThickness        = 1.6; \nstandoffHeight      = 20.0; //-- How much the PCB needs to be raised from the base to leave room for solderings and whatnot\nstandoffDiameter    = 7;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\n\n//===================================================================\n// *** PCBs ***\n// Printed Circuit Boards\n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : yappCoordBoxInside[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = name\n//    p(1) = length\n//    p(2) = width\n//    p(3) = posx\n//    p(4) = posy\n//    p(5) = Thickness\n//    p(6) = standoff_Height = Height to bottom of PCB from the inside of the base\n//             negative measures from inside of the lid to the top of the PCB\n//    p(7) = standoff_Diameter\n//    p(8) = standoff_PinDiameter\n//   Optional:\n//    p(9) = standoff_HoleSlack (default to 0.4)\n\n//The following can be used to get PCB values elsewhere in the script - not in pcb definition. \n//If \"PCB Name\" is omitted then \"Main\" is used\n//  pcbLength           --> pcbLength(\"PCB Name\")\n//  pcbWidth            --> pcbWidth(\"PCB Name\")\n//  pcbThickness        --> pcbThickness(\"PCB Name\") \n//  standoffHeight      --> standoffHeight(\"PCB Name\") \n//  standoffDiameter    --> standoffDiameter(\"PCB Name\") \n//  standoffPinDiameter --> standoffPinDiameter(\"PCB Name\") \n//  standoffHoleSlack   --> standoffHoleSlack(\"PCB Name\") \n\npcb = \n[\n  // Default Main PCB - DO NOT REMOVE the \"Main\" line.\n  [\"Main\",              pcbLength,pcbWidth,    0,0,    pcbThickness,  standoffHeight, standoffDiameter, standoffPinDiameter, standoffHoleSlack]\n];\n\n//-------------------------------------------------------------------                            \n//-- padding between pcb and inside wall\npaddingFront        = 2;\npaddingBack         = 2;\npaddingRight        = 2;\npaddingLeft         = 2;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 1.5;\nlidPlaneThickness   = 1.5;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 25;\nlidWallHeight       = 23;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.2;\nroundRadius         = 3.0;\n\n// Box Types are 0-4 with 0 as the default\n// 0 = All edges rounded with radius (roundRadius) above\n// 1 = All edges sqrtuare\n// 2 = All edges chamfered by (roundRadius) above \n// 3 = Square top and bottom edges (the ones that touch the build plate) and rounded vertical edges\n// 4 = Square top and bottom edges (the ones that touch the build plate) and chamfered vertical edges\n// 5 = Chanfered top and bottom edges (the ones that touch the build plate) and rounded vertical edges\nboxType             = 0; // Default type 0\n\n// Set the layer height of your printer\nprinterLayerHeight  = 0.2;\n\n\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n// -- Render --\nrenderQuality             = 8;          //-> from 1 to 32, Default = 8\n\n// --Preview --\npreviewQuality            = 5;          //-> from 1 to 32, Default = 5\nshowSideBySide            = true;       //-> Default = true\nonLidGap                  = 0;  // tip don't override to animate the lid opening\ncolorLid                  = \"YellowGreen\";   \nalphaLid                  = 1;\ncolorBase                 = \"BurlyWood\";\nalphaBase                 = 1;\nhideLidWalls              = false;      //-> Remove the walls from the lid : only if preview and showSideBySide=true \nhideBaseWalls             = false;      //-> Remove the walls from the base : only if preview and showSideBySide=true  \nshowOrientation           = true;       //-> Show the Front/Back/Left/Right labels : only in preview\nshowPCB                   = false;      //-> Show the PCB in red : only in preview \nshowSwitches              = false;      //-> Show the switches (for pushbuttons) : only in preview \nshowButtonsDepressed      = false;      //-> Should the buttons in the Lid On view be in the pressed position\nshowOriginCoordBox        = false;      //-> Shows red bars representing the origin for yappCoordBox : only in preview \nshowOriginCoordBoxInside  = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowOriginCoordPCB        = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowMarkersPCB            = false;      //-> Shows black bars corners of the PCB : only in preview \nshowMarkersCenter         = false;      //-> Shows magenta bars along the centers of all faces  \ninspectX                  = 12;          //-> 0=none (>0 from Back)\ninspectY                  = 0;          //-> 0=none (>0 from Right)\ninspectZ                  = 0;          //-> 0=none (>0 from Bottom)\ninspectXfromBack          = true;       //-> View from the inspection cut foreward\ninspectYfromLeft          = true;       //-> View from the inspection cut to the right\ninspectZfromBottom        = true;       //-> View from the inspection cut up\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n\n//-------------------------------------------------------------------\n//-------------------------------------------------------------------\n// Start of Debugging config (used if not overridden in template)\n// ------------------------------------------------------------------\n// ------------------------------------------------------------------\n\n//==================================================================\n//  *** Shapes ***\n//------------------------------------------------------------------\n//  There are a view pre defines shapes and masks\n//  shapes:\n//      shapeIsoTriangle, shapeHexagon, shape6ptStar\n//\n//  masks:\n//      maskHoneycomb, maskHexCircles, maskBars, maskOffsetBars\n//\n//------------------------------------------------------------------\n// Shapes should be defined to fit into a 1x1 box (+/-0.5 in X and Y) - they will \n// be scaled as needed.\n// defined as a vector of [x,y] vertices pairs.(min 3 vertices)\n// for example a triangle could be [yappPolygonDef,[[-0.5,-0.5],[0,0.5],[0.5,-0.5]]];\n// To see how to add your own shapes and mask see the YAPPgenerator program\n//------------------------------------------------------------------\n\n\n// Show sample of a Mask\n//SampleMask(maskHoneycomb);\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//   Optional:\n//    p(2) = Height to bottom of PCB from inside of base: Default = standoffHeight\n//             negative measures from inside of the lid to the top of the PCB\n//    p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    p(4) = standoffDiameter    Default = standoffDiameter;\n//    p(5) = standoffPinDiameter Default = standoffPinDiameter;\n//    p(6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    p(7) = filletRadius (0 = auto size)\n//    p(8) = Pin Length : Default = 0 -> PCB Gap + standoff_PinDiameter\n//             Indicated length of pin without the half sphere tip. \n//             Example : pcbThickness() only leaves the half sphere tip above the PCB\n//    n(a) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    n(b) = { <yappPin>, yappHole, yappTopPin } \n//             yappPin = Pin on Base and Hole on Lid \n//             yappHole = Hole on Both\n//             yappTopPin = Hole on Base and Pin on Lid\n//    n(c) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { yappNoFillet } : Removes the internal and external fillets and the Rounded tip on the pins\n//    n(f) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(g) = yappSelfThreading : make the hole a self threading hole \n//             This ignores the holeSlack and would only be usefull \n//             if the opposing stand if deleted see sample in Demo_Connectors\n//-------------------------------------------------------------------\npcbStands =  \n  [\n    [\n    10, 20, \n    yappAllCorners,\n    yappCoordPCB   //-- use [0,0,0] of the PCB os origen\n    ]\n  ];\n\n//===================================================================\n//  *** Connectors ***\n//  Standoffs with hole through base and socket in lid for screw type connections.\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//  \n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = pcbStandHeight\n//    p(3) = screwDiameter\n//    p(4) = screwHeadDiameter (don't forget to add extra for the fillet)\n//    p(5) = insertDiameter\n//    p(6) = outsideDiameter\n//   Optional:\n//    p(7) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    p(8) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = { <yappAllCorners>, yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    n(b) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(c) = { yappNoFillet }\n//    n(d) = { yappCountersink }\n//    n(e) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(f) = { yappThroughLid = changes the screwhole to the lid and the socket to the base}\n//    n(g) = {yappSelfThreading} : Make the insert self threading specify the Screw Diameter in the insertDiameter\n//-------------------------------------------------------------------\nconnectors =  \n  [\n    [ // Height equals the top of the PCB\n    10, 10, \n    0, // Use 0 as the default coordinate system is from the PCB\n    3.4,           //-- diameter of the screw (add some slack)\n    5.6,             //-- the diameter of the screw head\n    4.1,           //-- the diameter of the insert\n    11,            //-- the outside diameter of the connector\n    yappAllCorners,\n //   yappCoordPCB   //-- use [0,0,0] of the PCB os origen\n    ],\n    [ // Height equals standoffHeight from the outside of the box\n    10, 30, \n    standoffHeight(),   //  ??? semble doublé sinon ???\n    3.4,           //-- diameter of the screw (add some slack)\n    5.6,             //-- the diameter of the screw head\n    4.1,           //-- the diameter of the insert\n    11,            //-- the outside diameter of the connector\n    yappAllCorners,\n    yappCoordBox   //-- use [0,0,0] of the PCB os origen\n    ],\n    [ // Height equals standoffHeight from the inside of the box\n    10, 40, \n    standoffHeight(),   //  ??? semble doublé sinon ???\n    3.4,           //-- diameter of the screw (add some slack)\n    5.6,             //-- the diameter of the screw head\n    4.1,           //-- the diameter of the insert\n    11,            //-- the outside diameter of the connector\n    yappAllCorners,\n    yappCoordBoxInside   //-- use [0,0,0] of the PCB os origen\n    ]\n  ];\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//----------------------+-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//                      |                       |               |  (negative indicates outside of circle)\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be\n//                      |                       |               | provided\n//  yappRing            | width, length, radius |               | radius = outer radius, \n//                      |                       |               | length = inner radius\n//                      |                       |               | width = connection between rings\n//                      |                       |               |   0 = No connectors\n//                      |                       |               |   positive = 2 connectors\n//                      |                       |               |   negative = 4 connectors\n//  yappSphere          | width, radius         |               | Width = Sphere center distance from\n//                      |                       |               |   center of depth.  negative = below\n//                      |                       |               | radius = sphere radius\n//----------------------+-----------------------+---------------+------------------------------------\n//\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                     | yappCircleWithFlats | yappCircleWithKey | yappSphere }\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappAltOrigin } // Only affects Top(lid), Back and Right Faces\n//    n(g) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(h) = { yappFromInside } Make the cut from the inside towards the outside\n//-------------------------------------------------------------------\ncutoutsBase = \n[\n];\n\ncutoutsLid  = \n[\n\n];\n\ncutoutsFront =  \n[\n];\n\n\ncutoutsBack = \n[\n];\n\ncutoutsLeft =   \n[\n];\n\ncutoutsRight =  \n[\n];\n\n\n\n//===================================================================\n//  *** Snap Joins ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx | posy\n//    p(1) = width\n//    p(2) = { yappLeft | yappRight | yappFront | yappBack } : one or more\n//   Optional:\n//    n(a) = { <yappOrigin>, yappCenter }\n//    n(b) = { yappSymmetric }\n//    n(c) = { yappRectangle } == Make a diamond shape snap\n//-------------------------------------------------------------------\nsnapJoins   =   \n[\n];\n\n//===================================================================\n//  *** Box Mounts ***\n//  Mounting tabs on the outside of the box\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X.\n//                    Position is to center of mounting screw in leftmost position in slot\n//    p(1) = screwDiameter\n//    p(2) = width of opening in addition to screw diameter \n//                    (0=Circular hole screwWidth = hole twice as wide as it is tall)\n//    p(3) = height\n//    n(a) = { yappLeft | yappRight | yappFront | yappBack } : one or more\n//   Optional:\n//    p(4) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(b) = { yappNoFillet }\n//    n(c) = { <yappBase>, yappLid }\n//    n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of \n//                            the left of the opening\n//    n(e) = { <yappGlobalOrigin>, yappAltOrigin } : Only affects Back and Right Faces\n//-------------------------------------------------------------------\nboxMounts =\n[\n];\n\n//===================================================================\n//  *** Light Tubes ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = tubeLength\n//    p(3) = tubeWidth\n//    p(4) = tubeWall\n//    p(5) = gapAbovePcb\n//    p(6) = { yappCircle | yappRectangle } : tubeType    \n//   Optional:\n//    p(7) = lensThickness (how much to leave on the top of the lid for the \n//           light to shine through 0 for open hole : Default = 0/Open\n//    p(8) = Height to top of PCB : Default = standoffHeight+pcbThickness\n//    p(9) = filletRadius : Default = 0/Auto \n//    n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside } \n//    n(b) = { <yappGlobalOrigin>, yappAltOrigin }\n//    n(c) = { yappNoFillet }\n//    n(d) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//-------------------------------------------------------------------\nlightTubes =\n[\n];\n\n//===================================================================\n//  *** Push Buttons ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = capLength \n//    p(3) = capWidth \n//    p(4) = capRadius \n//    p(5) = capAboveLid\n//    p(6) = switchHeight\n//    p(7) = switchTravel\n//    p(8) = poleDiameter\n//   Optional:\n//    p(9) = Height to top of PCB : Default = standoffHeight + pcbThickness\n//    p(10) = { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey } : Shape, Default = yappRectangle\n//    p(11) = angle : Default = 0\n//    p(12) = filletRadius          : Default = 0/Auto \n//    p(13) = buttonWall            : Default = 2.0;\n//    p(14) = buttonPlateThickness  : Default= 2.5;\n//    p(15) = buttonSlack           : Default= 0.25;\n//    n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside } \n//    n(b) = { <yappGlobalOrigin>,  yappAltOrigin }\n//    n(c) = { yappNoFillet }\n//    n(d) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//-------------------------------------------------------------------\npushButtons = \n[\n];\n             \n//===================================================================\n//  *** Labels ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   p(0) = posx\n//   p(1) = posy/z\n//   p(2) = rotation degrees CCW\n//   p(3) = depth : positive values go into case (Remove) negative values are raised (Add)\n//   p(4) = { yappLeft, yappRight, yappFront, yappBack, yappLid, yappBase } : plane\n//   p(5) = font\n//   p(6) = size\n//   p(7) = \"label text\"\n//  Optional:\n//   p(8) = Expand : Default = 0 : mm to expand text by (making it bolder) \n//   p(9) = Direction : { <yappTextLeftToRight>, yappTextRightToLeft, yappTextTopToBottom, yappTextBottomToTop }\n//   p(10) = Horizontal alignment : { <yappTextHAlignLeft>, yappTextHAlignCenter, yappTextHAlignRight }\n//   p(11) = Vertical alignment : {  yappTextVAlignTop, yappTextVAlignCenter, yappTextVAlignBaseLine, <yappTextVAlignBottom> } \n//   p(12) = Character Spacing multiplier (1.0 = normal)\n//-------------------------------------------------------------------\nlabelsPlane =\n[\n];\n\n\n//===================================================================\n//  *** Ridge Extension ***\n//    Extension from the lid into the case for adding split opening at various heights\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = pos\n//    p(1) = width\n//    p(2) = height : Where to relocate the seam : yappCoordPCB = Above (positive) the PCB\n//                                                yappCoordBox = Above (positive) the bottom of the shell (outside)\n//   Optional:\n//    n(a) = { <yappOrigin>, yappCenter } \n//    n(b) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(c) = { yappAltOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces\n//    n(d) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//\n// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.\n//-------------------------------------------------------------------\nridgeExtLeft =\n[\n];\n\nridgeExtRight =\n[\n];\n\nridgeExtFront =\n[\n];\n\nridgeExtBack =\n[\n];\n\n\n//===================================================================\n//  *** Display Mounts ***\n//    add a cutout to the lid with mounting posts for a display\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p[2] : displayWidth = overall Width of the display module\n//    p[3] : displayHeight = overall Height of the display module\n//    p[4] : pinInsetH = Horizontal inset of the mounting hole\n//    p[5] : pinInsetV = Vertical inset of the mounting hole\n//    p[6] : pinDiameter,\n//    p[7] : postOverhang  = Extra distance towards outside of pins to move the post for the display to sit on - 0 = centered : pin Diameter will move the post to align to the outside of the pin (moves it half the distance specified for compatability : -pinDiameter will move it in.\n//    p[8] : walltoPCBGap = Distance from the display PCB to the surface of the screen\n//    p[9] : pcbThickness  = Thickness of the display module PCB\n//    p[10] : windowWidth = opening width for the screen\n//    p[11] : windowHeight = Opening height for the screen\n//    p[12] : windowOffsetH = Horizontal offset from the center for the opening\n//    p[13] : windowOffsetV = Vertical offset from the center for the opening\n//    p[14] : bevel = Apply a 45degree bevel to the opening\n// Optionl:\n//    p[15] : rotation\n//    p[16] : snapDiameter : default = pinDiameter*2\n//    p[17] : lidThickness : default = lidPlaneThickness\n//    n(a) = { <yappOrigin>, yappCenter } \n//    n(b) = { <yappCoordBox> | yappCoordPCB | yappCoordBoxInside }\n//    n(c) = { <yappGlobalOrigin>, yappAltOrigin } // Only affects Top(lid), Back and Right Faces\n//    n(d) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(e) = {yappSelfThreading} : Replace the pins with self threading holes\n//-------------------------------------------------------------------\ndisplayMounts =\n[\n];\n\n//========= HOOK functions ============================\n  \n// Hook functions allow you to add 3d objects to the case.\n// Lid/Base = Shell part to attach the object to.\n// Inside/Outside = Join the object from the midpoint of the shell to the inside/outside.\n// Pre = Attach the object Pre before doing Cutouts/Stands/Connectors. \n\n\n//===========================================================\n// origin = box(0,0,0)\nmodule hookLidInside()\n{\n  //if (printMessages) echo(\"hookLidInside() ..\");\n  \n} // hookLidInside()\n  \n\n//===========================================================\n// origin = box(0,0,shellHeight)\nmodule hookLidOutside()\n{\n  //if (printMessages) echo(\"hookLidOutside() ..\");\n  \n} // hookLidOutside()\n\n//===========================================================\n//===========================================================\n// origin = box(0,0,0)\nmodule hookBaseInside()\n{\n  //if (printMessages) echo(\"hookBaseInside() ..\");\n  \n} // hookBaseInside()\n\n//===========================================================\n// origin = box(0,0,0)\nmodule hookBaseOutside()\n{\n  //if (printMessages) echo(\"hookBaseOutside() ..\");\n  \n} // hookBaseInside()\n\n// **********************************************************\n// **********************************************************\n// **********************************************************\n// *************** END OF TEMPLATE SECTION ******************\n// **********************************************************\n// **********************************************************\n// **********************************************************\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Countersink Sample_v3.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0.1 (2024-01-15)\n//\n// This design is parameterized based on the size of a PCB.\n//\n// For many/complex cutoutGrills, you might need to adjust\n//  the max number of elements in OpenSCAD:\n//\n//      Preferences->Advanced->Turn off rendering at 250000 elements\n//                                                   ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n//---------------------------------------------------------\n// This design is parameterized based on the size of a PCB.\n//---------------------------------------------------------\n// Note: length/lengte refers to X axis, \n//       width/breedte refers to Y axis,\n//       height/hoogte refers to Z axis\n\n/*\n      padding-back|<------pcb length --->|<padding-front\n                            RIGHT\n        0    X-axis ---> \n        +----------------------------------------+   ---\n        |                                        |    ^\n        |                                        |   padding-right \n      Y |                                        |    v\n      | |    -5,y +----------------------+       |   ---              \n B    a |         | 0,y              x,y |       |     ^              F\n A    x |         |                      |       |     |              R\n C    i |         |                      |       |     | pcb width    O\n K    s |         |                      |       |     |              N\n        |         | 0,0              x,0 |       |     v              T\n      ^ |    -5,0 +----------------------+       |   ---\n      | |                                        |    padding-left\n      0 +----------------------------------------+   ---\n        0    X-as --->\n                          LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\n\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 150; // front to back (X axis)\npcbWidth            = 100; // side to side (Y axis)\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 2;\npaddingBack         = 2;\npaddingRight        = 2;\npaddingLeft         = 2;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 1.5;\nlidPlaneThickness   = 1.5;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 25;\nlidWallHeight       = 23;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.2;\nroundRadius         = 3.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 10.0;  //-- used for PCB Supports, Push Button and showPCB\nstandoffDiameter    = 7;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\n\n// Set the layer height of your printer\nprinterLayerHeight  = 0.2;\n\n\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n// -- Render --\nrenderQuality             = 8;          //-> from 1 to 32, Default = 8\n\n// --Preview --\npreviewQuality            = 5;          //-> from 1 to 32, Default = 5\nshowSideBySide            = true;       //-> Default = true\nonLidGap                  = 0;  // tip don't override to animate the lid opening\ncolorLid                  = \"YellowGreen\";   \nalphaLid                  = 1;\ncolorBase                 = \"BurlyWood\";\nalphaBase                 = 1;\nhideLidWalls              = false;      //-> Remove the walls from the lid : only if preview and showSideBySide=true \nhideBaseWalls             = false;      //-> Remove the walls from the base : only if preview and showSideBySide=true  \nshowOrientation           = true;       //-> Show the Front/Back/Left/Right labels : only in preview\nshowPCB                   = false;      //-> Show the PCB in red : only in preview \nshowSwitches              = false;      //-> Show the switches (for pushbuttons) : only in preview \nshowButtonsDepressed      = false;      //-> Should the buttons in the Lid On view be in the pressed position\nshowOriginCoordBox        = false;      //-> Shows red bars representing the origin for yappCoordBox : only in preview \nshowOriginCoordBoxInside  = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowOriginCoordPCB        = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowMarkersPCB            = false;      //-> Shows black bars corners of the PCB : only in preview \nshowMarkersCenter         = false;      //-> Shows magenta bars along the centers of all faces  \ninspectX                  = 145;          //-> 0=none (>0 from Back)\ninspectY                  = 0;          //-> 0=none (>0 from Right)\ninspectZ                  = 0;          //-> 0=none (>0 from Bottom)\ninspectXfromBack          = false;       //-> View from the inspection cut foreward\ninspectYfromLeft          = true;       //-> View from the inspection cut to the right\ninspectZfromBottom        = true;       //-> View from the inspection cut up\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n\n//-------------------------------------------------------------------\n//-------------------------------------------------------------------\n// Start of Debugging config (used if not overridden in template)\n// ------------------------------------------------------------------\n// ------------------------------------------------------------------\n\n//==================================================================\n//  *** Shapes ***\n//------------------------------------------------------------------\n//  There are a view pre defines shapes and masks\n//  shapes:\n//      shapeIsoTriangle, shapeHexagon, shape6ptStar\n//\n//  masks:\n//      maskHoneycomb, maskHexCircles, maskBars, maskOffsetBars\n//\n//------------------------------------------------------------------\n// Shapes should be defined to fit into a 1x1 box (+/-0.5 in X and Y) - they will \n// be scaled as needed.\n// defined as a vector of [x,y] vertices pairs.(min 3 vertices)\n// for example a triangle could be [yappPolygonDef,[[-0.5,-0.5],[0,0.5],[0.5,-0.5]]];\n// To see how to add your own shapes and mask see the YAPPgenerator program\n//------------------------------------------------------------------\n\n\n// Show sample of a Mask\n//SampleMask(maskHoneycomb);\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//   Optional:\n//    p(2) = Height to bottom of PCB : Default = standoffHeight\n//    p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    p(4) = standoffDiameter    Default = standoffDiameter;\n//    p(5) = standoffPinDiameter Default = standoffPinDiameter;\n//    p(6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    p(7) = filletRadius (0 = auto size)\n//    n(a) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    n(b) = { <yappPin>, yappHole } // Baseplate support treatment\n//    n(c) = { <yappAllCorners>, yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { yappNoFillet }\n//-------------------------------------------------------------------\npcbStands = \n[\n//- Add stands 5mm from each corner of the PCB\n    [5, 5]\n//-   Add posts 25mm from the corners of the box, with a custon height,diameter, Pin Size, hole\n//-   slack and filler radius.\n//  [25, 25, 10, 10, 3.3, 0.9, 5, yappCoordBox] \n];\n\n\n//===================================================================\n//  *** Connectors ***\n//  Standoffs with hole through base and socket in lid for screw type connections.\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//  \n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = pcbStandHeight\n//    p(3) = screwDiameter\n//    p(4) = screwHeadDiameter (don't forget to add extra for the fillet)\n//    p(5) = insertDiameter\n//    p(6) = outsideDiameter\n//   Optional:\n//    p(7) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    p(8) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = { <yappAllCorners>, yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    n(b) = { <yappCoordBox> | yappCoordPCB |  yappCoordBoxInside }\n//    n(c) = { yappNoFillet }\n//-------------------------------------------------------------------\nconnectors   =\n[\n    [9, 15, 10, 2.5, 6 + 1.25, 4.0, 9, 4, yappFrontRight, yappCountersink]\n//   ,[9, 15, 10, 2.5, 6 + 1.25, 4.0, 9, yappNoFillet, yappFrontLeft]\n//   ,[34, 15, 10, 2.5, 6+ 1.25, 4.0, 9, yappFrontRight]\n//   ,[34, 15, 10, 2.5, 6+ 1.25, 4.0, 9, 0, yappFrontLeft]\n];\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//----------------------+-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be\n//                      |                       |               | provided\n//----------------------+-----------------------+---------------+------------------------------------\n//\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                     | yappCircleWithFlats | yappCircleWithKey }\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces\n//-------------------------------------------------------------------\ncutoutsBase = \n[\n  [65,shellWidth/2 ,55,55, 5, yappPolygon ,0 ,30, yappCenter, shapeHexagon, maskHexCircles]\n// , [0, 0, 10, 10, 0, yappRectangle,maskHexCircles]\n// , [shellLength*2/3,shellWidth/2 ,0, 30, 20, yappCircleWithFlats, yappCenter]\n// , [shellLength/2,shellWidth/2 ,10, 5, 20, yappCircleWithKey,yappCenter]\n];\n\ncutoutsLid  = \n[\n//Center test\n  [shellLength/2,   shellWidth/2,  1,  1,  5, yappRectangle ,20 ,45, yappCenter]\n ,[pcbLength/2,       pcbWidth/2,  1,  1,  5, yappRectangle ,20 ,45, yappCenter, yappCoordPCB]\n//Edge tests\n ,[shellLength/2,              0,  2,  2,  5, yappRectangle ,20 ,45, yappCenter]\n ,[shellLength/2,     shellWidth,  2,  2,  5, yappRectangle ,20 ,45, yappCenter]\n ,[0,               shellWidth/2,  2,  2,  5, yappRectangle ,20 ,45, yappCenter]\n ,[shellLength,     shellWidth/2,  2,  2,  5, yappRectangle ,20 ,45, yappCenter]\n\n ,[shellLength*2/3, shellWidth/2,  0, 30, 20, yappCircleWithFlats, yappCenter]\n ,[shellLength/3,   shellWidth/2, 10,  5, 20, yappCircleWithKey,yappCenter]\n\n];\n\ncutoutsFront =  \n[\n];\n\n\ncutoutsBack = \n[\n];\n\ncutoutsLeft =   \n[\n];\n\ncutoutsRight =  \n[\n];\n\n\n\n//===================================================================\n//  *** Snap Joins ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx | posy\n//    p(1) = width\n//    p(2) = { yappLeft | yappRight | yappFront | yappBack } : one or more\n//   Optional:\n//    n(a) = { <yappOrigin>, yappCenter }\n//    n(b) = { yappSymmetric }\n//    n(c) = { yappRectangle } == Make a diamond shape snap\n//-------------------------------------------------------------------\nsnapJoins   =   \n[\n    [15, 10, yappFront, yappCenter,    yappRectangle, yappSymmetric]\n   ,[25, 10, yappBack,  yappSymmetric, yappCenter]\n   ,[30, 10, yappLeft,  yappRight,     yappCenter,    yappSymmetric]\n];\n\n//===================================================================\n//  *** Box Mounts ***\n//    Mounting tabs on the outside of the box\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X.\n//                    Position is to center of mounting screw in leftmost position in slot\n//    p(1) = screwDiameter\n//    p(2) = width of opening in addition to screw diameter \n//                    (0=Circular hole screwWidth = hole twice as wide as it is tall)\n//    p(3) = height\n//   Optional:\n//    p(4) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = { yappLeft | yappRight | yappFront | yappBack } : one or more\n//    n(b) = { yappNoFillet }\n//    n(c) = { <yappBase>, yappLid }\n//    n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of \n//                            the left of the opening\n//    n(e) = { <yappGlobalOrigin>, yappLeftOrigin } : Only affects Back and Right Faces\n//-------------------------------------------------------------------\nboxMounts =\n[\n];\n\n//===================================================================\n//  *** Light Tubes ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = tubeLength\n//    p(3) = tubeWidth\n//    p(4) = tubeWall\n//    p(5) = gapAbovePcb\n//    p(6) = { yappCircle | yappRectangle } : tubeType    \n//   Optional:\n//    p(7) = lensThickness (how much to leave on the top of the lid for the \n//           light to shine through 0 for open hole : Default = 0/Open\n//    p(8) = Height to top of PCB : Default = standoffHeight+pcbThickness\n//    p(9) = filletRadius : Default = 0/Auto \n//    n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside } \n//    n(b) = { <yappGlobalOrigin>, yappLeftOrigin }\n//    n(c) = { yappNoFillet }\n//-------------------------------------------------------------------\nlightTubes =\n[\n  [(pcbLength/2)+10, 20,    // [0,1] Pos\n    5, 5,                   // [2,3] Length, Width\n    1,                      // [4]   wall thickness\n    standoffHeight + pcbThickness + 4, // [5] Gap above base bottom\n    yappRectangle,          // [6]   tubeType (Shape)\n    0.5,                    // [7]   lensThickness\n    yappCoordPCB            // [n1]\n  ]\n  ,\n  [(pcbLength/2)+10, 40,    // [0,1] Pos\n    5, 10,                  // [2,3] Length, Width\n    1,                      // [4]   wall thickness\n    standoffHeight + pcbThickness + 4, // [5] Gap above base bottom\n    yappCircle,             // [6]   tubeType (Shape)\n    undef,                  // [7]\n    undef,                  // [8]\n    5,                      // [9]   filletRadius\n    yappCoordPCB            // [n1]\n  ]\n];\n\n//===================================================================\n//  *** Push Buttons ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = capLength \n//    p(3) = capWidth \n//    p(4) = capRadius \n//    p(5) = capAboveLid\n//    p(6) = switchHeight\n//    p(7) = switchTravel\n//    p(8) = poleDiameter\n//   Optional:\n//    p(9) = Height to top of PCB : Default = standoffHeight + pcbThickness\n//    p(10) = { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey } : Shape, Default = yappRectangle\n//    p(11) = angle : Default = 0\n//    p(12) = filletRadius          : Default = 0/Auto \n//    p(13) = buttonWall            : Default = 2.0;\n//    p(14) = buttonPlateThickness  : Default= 2.5;\n//    p(15) = buttonSlack           : Default= 0.25;\n//    n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside } \n//    n(b) = { <yappGlobalOrigin>,  yappLeftOrigin }\n//    n(c) = { yappNoFillet }\n//-------------------------------------------------------------------\npushButtons = \n[\n//-               0,   1,  2,  3, 4, 5,   6, 7, 8\n   [(pcbLength/2)+10, 65, 15, 10, 0, 3,   5, 1, 3]\n  ,[(pcbLength/2)+10, 85, 10, 10, 4, 2.0, 4, 1, 4, standoffHeight, yappCircle]\n];\n             \n//===================================================================\n//  *** Labels ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   p(0) = posx\n//   p(1) = posy/z\n//   p(2) = rotation degrees CCW\n//   p(3) = depth : positive values go into case (Remove) negative valies are raised (Add)\n//   p(4) = { yappLeft | yappRight | yappFront | yappBack | yappLid | yappBaseyappLid } : plane\n//   p(5) = font\n//   p(6) = size\n//   p(7) = \"label text\"\n//  Optional:\n//   p(8) = Expand : Default = 0 : mm to expand text by (making it bolder) \n//-------------------------------------------------------------------\nlabelsPlane =\n[\n    [5, 5, 0, 1, yappLid, \"Liberation Mono:style=bold\", 5, \"YAPP\" ]\n];\n\n\n//===================================================================\n//  *** Ridge Extension ***\n//    Extension from the lid into the case for adding split opening at various heights\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = pos\n//    p(1) = width\n//    p(2) = height : Where to relocate the seam : yappCoordPCB = Above (positive) the PCB\n//                                                yappCoordBox = Above (positive) the bottom of the shell (outside)\n//   Optional:\n//    n(a) = { <yappOrigin>, yappCenter } \n//    n(b) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(c) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces\n//\n// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.\n//-------------------------------------------------------------------\nridgeExtLeft =\n[\n];\n\nridgeExtRight =\n[\n];\n\nridgeExtFront =\n[\n];\n\nridgeExtBack =\n[\n];\n\n\n//========= HOOK functions ============================\n  \n// Hook functions allow you to add 3d objects to the case.\n// Lid/Base = Shell part to attach the object to.\n// Inside/Outside = Join the object from the midpoint of the shell to the inside/outside.\n// Pre = Attach the object Pre before doing Cutouts/Stands/Connectors. \n\n\n//===========================================================\n// origin = box(0,0,0)\nmodule hookLidInside()\n{\n  //if (printMessages) echo(\"hookLidInside() ..\");\n  \n} // hookLidInside()\n  \n\n//===========================================================\n// origin = box(0,0,shellHeight)\nmodule hookLidOutside()\n{\n  //if (printMessages) echo(\"hookLidOutside() ..\");\n  \n} // hookLidOutside()\n\n//===========================================================\n//===========================================================\n// origin = box(0,0,0)\nmodule hookBaseInside()\n{\n  //if (printMessages) echo(\"hookBaseInside() ..\");\n  \n} // hookBaseInside()\n\n//===========================================================\n// origin = box(0,0,0)\nmodule hookBaseOutside()\n{\n  //if (printMessages) echo(\"hookBaseOutside() ..\");\n  \n} // hookBaseInside()\n\n// **********************************************************\n// **********************************************************\n// **********************************************************\n// *************** END OF TEMPLATE SECTION ******************\n// **********************************************************\n// **********************************************************\n// **********************************************************\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Demo_DisplayMount_LCD2004.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0 (01-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  for many or complex cutouts you might need to adjust\n//  the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n//-- which part(s) do you want to print?\nprintBaseShell        = false;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\nprintDisplayClips     = true;\nshiftLid              = 10;  // Set the distance between the lid and base when rendered or previewed side by side\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n// ********************************************************************\n// The Following will be used as the first element in the pbc array\n\n//Defined here so you can define the \"Main\" PCB using these if wanted\npcbLength           = 104; // front to back (X axis)\npcbWidth            = 66; // side to side (Y axis)\npcbThickness        = 1.6;\nstandoffHeight      = 1.0;  //-- How much the PCB needs to be raised from the base to leave room for solderings \nstandoffDiameter    = 7;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\n\nwallThickness       = 2.6;\nbasePlaneThickness  = 1.6;\nlidPlaneThickness   = 1.6;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 10;\nlidWallHeight       = 5;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.3;\nroundRadius         = 3.0;\n\n// Box Types are 0-5 with 0 as the default\n// 0 = All edges rounded with radius (roundRadius) above\n// 1 = All edges square\n// 2 = All edges chamfered by (roundRadius) above \n// 3 = Square top and bottom edges (the ones that touch the build plate) and rounded vertical edges\n// 4 = Square top and bottom edges (the ones that touch the build plate) and chamfered vertical edges\n// 5 = Chamfered top and bottom edges (the ones that touch the build plate) and rounded vertical edges\nboxType = 3; // Default type 0\n\n\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n// -- Render --\nrenderQuality             = 8;          //-> from 1 to 32, Default = 8\n\n// --Preview --\npreviewQuality            = 5;          //-> from 1 to 32, Default = 5\nshowSideBySide            = true;       //-> Default = true\nonLidGap                  = 0;  // tip don't override to animate the lid opening\n//onLidGap                  = ((ridgeHeight) - (ridgeHeight * abs(($t-0.5)*2)))*2;  // tip don't override to animate the lid opening/closing\ncolorLid                  = \"YellowGreen\";   \nalphaLid                  = 1;\ncolorBase                 = \"BurlyWood\";\nalphaBase                 = 1;\nhideLidWalls              = false;      //-> Remove the walls from the lid : only if preview and showSideBySide=true \nhideBaseWalls             = false;      //-> Remove the walls from the base : only if preview and showSideBySide=true  \nshowOrientation           = true;       //-> Show the Front/Back/Left/Right labels : only in preview\nshowPCB                   = false;      //-> Show the PCB in red : only in preview \nshowSwitches              = false;      //-> Show the switches (for pushbuttons) : only in preview \nshowButtonsDepressed      = false;      //-> Should the buttons in the Lid On view be in the pressed position\nshowOriginCoordBox        = false;      //-> Shows red bars representing the origin for yappCoordBox : only in preview \nshowOriginCoordBoxInside  = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowOriginCoordPCB        = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowMarkersPCB            = false;      //-> Shows black bars corners of the PCB : only in preview \nshowMarkersCenter         = false;      //-> Shows magenta bars along the centers of all faces  \ninspectX                  = 0;          //-> 0=none (>0 from Back)\ninspectY                  = 0;          //-> 0=none (>0 from Right)\ninspectZ                  = 0;          //-> 0=none (>0 from Bottom)\ninspectXfromBack          = true;       //-> View from the inspection cut foreward\ninspectYfromLeft          = true;       //-> View from the inspection cut to the right\ninspectZfromBottom        = true;       //-> View from the inspection cut up\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n\n\n//===================================================================\n//  *** Display Mounts ***\n//    add a cutout to the lid with mounting posts for a display\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p[2] : displayWidth = overall Width of the display module\n//    p[3] : displayHeight = overall Height of the display module\n//    p[4] : pinInsetH = Horizontal inset of the mounting hole\n//    p[5] : pinInsetV = Vertical inset of the mounting hole\n//    p[6] : pinDiameter,\n//    p[7] : postOverhang  = Extra distance towards outside of pins to move the post for the display to sit on - 0 = centered : pin Diameter will move the post to align to the outside of the pin (moves it half the distance specified for compatability : -pinDiameter will move it in.\n//    p[8] : walltoPCBGap = Distance from the display PCB to the surface of the screen\n//    p[9] : pcbThickness  = Thickness of the display module PCB\n//    p[10] : windowWidth = opening width for the screen\n//    p[11] : windowHeight = Opening height for the screen\n//    p[12] : windowOffsetH = Horizontal offset from the center for the opening\n//    p[13] : windowOffsetV = Vertical offset from the center for the opening\n//    p[14] : bevel = Apply a 45degree bevel to the opening\n// Optionl:\n//    p[15] : rotation\n//    p[16] : snapDiameter : default = pinDiameter*2\n//    p[17] : lidThickness : default = lidPlaneThickness\n//    n(a) = { <yappOrigin>, yappCenter } \n//    n(b) = { <yappCoordBox> | yappCoordPCB | yappCoordBoxInside }\n//    n(c) = { <yappGlobalOrigin>, yappAltOrigin } // Only affects Top(lid), Back and Right Faces\n//    n(d) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(e) = {yappSelfThreading} : Replace the pins with self threading holes\n//-------------------------------------------------------------------\ndisplayMounts =\n[\n  /*\n  [ // This is for a SSD-1306 OLED Display v1.1 with vcc-gnd-scl-sda Pinout\n    20, //xPos\n    20, // yPos\n    28.9, // displayWidth\n    27.1, //displayHeight\n    2.7, //pinInsetH\n    1.9, //pinInsetV\n    2.0, //pinDiameter\n    2.0, //postOverhang\n    1.5, //walltoPCBGap\n    1.5, //pcbThickness\n    26.4, //windowWidth\n    14.5, //windowHeight\n    0, //windowOffsetH\n    1.5, //windowOffsetV\n    true, //bevel\n    0, // rotation\n    yappDefault,//snapDiameter\n    yappDefault,\n    yappCenter,  \n  ],  \n  [ // This is for a 1620A 2x20 LCD Display - Mounted through the lid\n    100, //xPos\n    25, // yPos\n    80, // displayWidth\n    35.9, //displayHeight\n    2.2, //pinInsetH\n    2.2, //pinInsetV\n    2.7, //pinDiameter\n    2.7, //postOverhang\n    5.8, //walltoPCBGap\n    1.5, //pcbThickness\n    71.5, //windowWidth\n    24.2, //windowHeight\n    0, //windowOffsetH\n    -0.9, //windowOffsetV\n    false, //bevel\n    0, // rotation\n    5.0,//snapDiameter\n    yappDefault,\n    yappCenter,  \n  ],\n  [ // This is for a 1620A 2x20 LCD Display - Mounted under the lid\n    100, //xPos\n    75, // yPos\n    80, // displayWidth\n    35.9, //displayHeight\n    2.2, //pinInsetH\n    2.2, //pinInsetV\n    2.7, //pinDiameter\n    2.7, //postOverhang\n    7.3, //walltoPCBGap\n    1.5, //pcbThickness\n    67.0, //windowWidth\n    17.0, //windowHeight\n    0, //windowOffsetH\n    -0.9, //windowOffsetV\n    true, //bevel\n    0, // rotation\n    5.0,//snapDiameter\n    yappDefault,\n    yappCenter,  \n  ],\n    [ // This is for a 2004A 4x20 LCD Display\n    55.5, //xPos\n    36.5, // yPos\n    98.0, // displayWidth\n    60.0, //displayHeight\n    2.2, //pinInsetH\n    2.5, //pinInsetV\n    3.3, //pinDiameter\n    3.3, //postOverhang \n    9.3, //walltoPCBGap\n    1.6, //pcbThickness\n    79.0, //windowWidth\n    28.0, //windowHeight\n    0, //windowOffsetH\n    0.0, //windowOffsetV\n    true, //bevel\n    0, // rotation\n    5.0,//snapDiameter\n    yappDefault,\n    yappCenter,  \n  ],\n\n  */\n  [ // This is for a 2004A 4x20 LCD Display - Mounted under the lid with screws\n    55.5, //xPos\n    36.5, // yPos\n    98.0, // displayWidth\n    60.0, //displayHeight\n    2.2, //pinInsetH\n    2.5, //pinInsetV\n    3.3, //pinDiameter\n    0, //postOverhang \n    9.3, //walltoPCBGap\n    1.6, //pcbThickness\n    79.0, //windowWidth\n    28.0, //windowHeight\n    0, //windowOffsetH\n    0.0, //windowOffsetV\n    true, //bevel\n    0, // rotation\n    5.0,//snapDiameter\n    yappDefault,\n    yappCenter,  \n    yappSelfThreading,\n  ],\n  /*\n  [ // This is for a 2.8 TFT SPI 240*320 V1.2 Display\n    //  Note the measurements were to the pin holes not the entire display \n    30, //xPos\n    80, // yPos\n    82.4, // displayWidth\n    50.0, //displayHeight\n    3.0, //pinInsetH\n    3.0, //pinInsetV\n    2.9, //pinDiameter\n    2.9, //postOverhang\n    3.8, //walltoPCBGap\n    1.5, //pcbThickness\n    60.0, //windowWidth\n    46.6, //windowHeight\n    5.4, //windowOffsetH\n    0, //windowOffsetV\n    true, //bevel\n    90, // rotation\n    5.0,//snapDiameter\n    yappDefault,\n    yappCenter,  \n  ],\n  */\n];\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n\n"
  },
  {
    "path": "examples/YAPP_Demo_DisplayMount_v31.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0 (01-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  for many or complex cutouts you might need to adjust\n//  the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\nshiftLid              = 10;  // Set the distance between the lid and base when rendered or previewed side by side\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n// ********************************************************************\n// The Following will be used as the first element in the pbc array\n\n//Defined here so you can define the \"Main\" PCB using these if wanted\npcbLength           = 140; // front to back (X axis)\npcbWidth            = 190; // side to side (Y axis)\npcbThickness        = 1.6;\nstandoffHeight      = 1.0;  //-- How much the PCB needs to be raised from the base to leave room for solderings \nstandoffDiameter    = 7;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\n\nwallThickness       = 2.6;\nbasePlaneThickness  = 1.6;\nlidPlaneThickness   = 1.6;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 10;\nlidWallHeight       = 5;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.3;\nroundRadius         = 3.0;\n\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n// -- Render --\nrenderQuality             = 8;          //-> from 1 to 32, Default = 8\n\n// --Preview --\npreviewQuality            = 5;          //-> from 1 to 32, Default = 5\nshowSideBySide            = true;       //-> Default = true\nonLidGap                  = 0;  // tip don't override to animate the lid opening\n//onLidGap                  = ((ridgeHeight) - (ridgeHeight * abs(($t-0.5)*2)))*2;  // tip don't override to animate the lid opening/closing\ncolorLid                  = \"YellowGreen\";   \nalphaLid                  = 1;\ncolorBase                 = \"BurlyWood\";\nalphaBase                 = 1;\nhideLidWalls              = false;      //-> Remove the walls from the lid : only if preview and showSideBySide=true \nhideBaseWalls             = false;      //-> Remove the walls from the base : only if preview and showSideBySide=true  \nshowOrientation           = true;       //-> Show the Front/Back/Left/Right labels : only in preview\nshowPCB                   = false;      //-> Show the PCB in red : only in preview \nshowSwitches              = false;      //-> Show the switches (for pushbuttons) : only in preview \nshowButtonsDepressed      = false;      //-> Should the buttons in the Lid On view be in the pressed position\nshowOriginCoordBox        = false;      //-> Shows red bars representing the origin for yappCoordBox : only in preview \nshowOriginCoordBoxInside  = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowOriginCoordPCB        = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowMarkersPCB            = false;      //-> Shows black bars corners of the PCB : only in preview \nshowMarkersCenter         = false;      //-> Shows magenta bars along the centers of all faces  \ninspectX                  = 0;          //-> 0=none (>0 from Back)\ninspectY                  = 0;          //-> 0=none (>0 from Right)\ninspectZ                  = 0;          //-> 0=none (>0 from Bottom)\ninspectXfromBack          = true;       //-> View from the inspection cut foreward\ninspectYfromLeft          = true;       //-> View from the inspection cut to the right\ninspectZfromBottom        = true;       //-> View from the inspection cut up\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n\n\n//===================================================================\n//  *** Display Mounts ***\n//    add a cutout to the lid with mounting posts for a display\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p[2] : displayWidth = overall Width of the display module\n//    p[3] : displayHeight = overall Height of the display module\n//    p[4] : pinInsetH = Horizontal inset of the mounting hole\n//    p[5] : pinInsetV = Vertical inset of the mounting hole\n//    p[6] : pinDiameter,\n//    p[7] : postOverhang  = Extra distance on outside of pins for the display to sit on - pin Diameter is a good value\n//    p[8] : walltoPCBGap = Distance from the display PCB to the surface of the screen\n//    p[9] : pcbThickness  = Thickness of the display module PCB\n//    p[10] : windowWidth = opening width for the screen\n//    p[11] : windowHeight = Opening height for the screen\n//    p[12] : windowOffsetH = Horizontal offset from the center for the opening\n//    p[13] : windowOffsetV = Vertical offset from the center for the opening\n//    p[14] : bevel = Apply a 45degree bevel to the opening\n// Optionl:\n//    p[15] : rotation\n//    p[16] : snapDiameter : default = pinDiameter*2\n//    p[17] : lidThickness : default = lidPlaneThickness\n//    n(a) = { <yappOrigin>, yappCenter } \n//    n(b) = { <yappCoordBox> | yappCoordPCB | yappCoordBoxInside }\n//    n(c) = { <yappGlobalOrigin>, yappAltOrigin } // Only affects Top(lid), Back and Right Faces\n//    n(d) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//-------------------------------------------------------------------\ndisplayMounts =\n[\n  /*\n  [ // This is for a SSD-1306 OLED Display v1.1 with vcc-gnd-scl-sda Pinout\n    20, //xPos\n    20, // yPos\n    28.9, // displayWidth\n    27.1, //displayHeight\n    2.7, //pinInsetH\n    1.9, //pinInsetV\n    2.0, //pinDiameter\n    2.0, //postOverhang\n    1.5, //walltoPCBGap\n    1.5, //pcbThickness\n    26.4, //windowWidth\n    14.5, //windowHeight\n    0, //windowOffsetH\n    1.5, //windowOffsetV\n    true, //bevel\n    0, // rotation\n    yappDefault,//snapDiameter\n    yappDefault,\n    yappCenter,  \n  ],  \n  [ // This is for a 1620A 2x20 LCD Display - Mounted through the lid\n    100, //xPos\n    25, // yPos\n    80, // displayWidth\n    35.9, //displayHeight\n    2.2, //pinInsetH\n    2.2, //pinInsetV\n    2.7, //pinDiameter\n    2.7, //postOverhang\n    5.8, //walltoPCBGap\n    1.5, //pcbThickness\n    71.5, //windowWidth\n    24.2, //windowHeight\n    0, //windowOffsetH\n    -0.9, //windowOffsetV\n    false, //bevel\n    0, // rotation\n    5.0,//snapDiameter\n    yappDefault,\n    yappCenter,  \n  ],\n  [ // This is for a 1620A 2x20 LCD Display - Mounted under the lid\n    100, //xPos\n    75, // yPos\n    80, // displayWidth\n    35.9, //displayHeight\n    2.2, //pinInsetH\n    2.2, //pinInsetV\n    2.7, //pinDiameter\n    2.7, //postOverhang\n    7.3, //walltoPCBGap\n    1.5, //pcbThickness\n    67.0, //windowWidth\n    17.0, //windowHeight\n    0, //windowOffsetH\n    -0.9, //windowOffsetV\n    true, //bevel\n    0, // rotation\n    5.0,//snapDiameter\n    yappDefault,\n    yappCenter,  \n  ],\n  */\n  [ // This is for a 2004A 4x20 LCD Display - Mounted under the lid\n    80, //xPos\n    160, // yPos\n    98, // displayWidth\n    60, //displayHeight\n    2.2, //pinInsetH\n    2.2, //pinInsetV\n    3.3, //pinDiameter\n    3.3, //postOverhang\n    9.3, //walltoPCBGap\n    1.6, //pcbThickness\n    78.0, //windowWidth\n    29.0, //windowHeight\n    0, //windowOffsetH\n    -0.9, //windowOffsetV\n    true, //bevel\n    0, // rotation\n    5.0,//snapDiameter\n    yappDefault,\n    yappCenter,  \n  ],\n  /*\n  [ // This is for a 2.8 TFT SPI 240*320 V1.2 Display\n    //  Note the measurements were to the pin holes not the entire display \n    30, //xPos\n    80, // yPos\n    82.4, // displayWidth\n    50.0, //displayHeight\n    3.0, //pinInsetH\n    3.0, //pinInsetV\n    2.9, //pinDiameter\n    2.9, //postOverhang\n    3.8, //walltoPCBGap\n    1.5, //pcbThickness\n    60.0, //windowWidth\n    46.6, //windowHeight\n    5.4, //windowOffsetH\n    0, //windowOffsetV\n    true, //bevel\n    90, // rotation\n    5.0,//snapDiameter\n    yappDefault,\n    yappCenter,  \n  ],\n  */\n];\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n\n"
  },
  {
    "path": "examples/YAPP_Demo_Joystick_Paddle Controller_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0.5 (03-26-2024)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\nprintDisplayClips     = true;\n\n//-- padding between pcb and inside wall\npaddingFront        = 20;\npaddingBack         = 20;\npaddingRight        = 20;\npaddingLeft         = 20;\n\n// ********************************************************************\n// The Following will be used as the first element in the pbc array\n\n//Defined here so you can define the \"Main\" PCB using these if wanted\npcbLength           = 10; // front to back (X axis)\npcbWidth            = 10; // side to side (Y axis)\npcbThickness        = 1.6;\nstandoffHeight      = 25-16.5;// 1.0;  //-- How much the PCB needs to be raised from the base to leave room for solderings \nstandoffDiameter    = 7;\nstandoffPinDiameter = 3.0;\nstandoffHoleSlack   = 0.2;\n\n//===================================================================\n// *** PCBs ***\n// Printed Circuit Boards\n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : yappCoordBoxInside[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = name\n//    p(1) = length\n//    p(2) = width\n//    p(3) = posx\n//    p(4) = posy\n//    p(5) = Thickness\n//    p(6) = standoff_Height\n//    p(7) = standoff_Diameter\n//    p(8) = standoff_PinDiameter\n//   Optional:\n//    p(9) = standoff_HoleSlack (default to 0.4)\n\n//The following can be used to get PCB values. If \"PCB Name\" is omitted then \"Main\" is used\n//  pcbLength           --> pcbLength(\"PCB Name\")\n//  pcbWidth            --> pcbWidth(\"PCB Name\")\n//  pcbThickness        --> pcbThickness(\"PCB Name\") \n//  standoffHeight      --> standoffHeight(\"PCB Name\") \n//  standoffDiameter    --> standoffDiameter(\"PCB Name\") \n//  standoffPinDiameter --> standoffPinDiameter(\"PCB Name\") \n//  standoffHoleSlack   --> standoffHoleSlack(\"PCB Name\") \n\npcb = \n[\n  //-- Default Main PCB - DO NOT REMOVE the \"Main\" line.\n  [\"Main\",              \n    pcbLength,pcbWidth,    \n    0,0,    \n    pcbThickness,  \n    standoffHeight, \n    standoffDiameter, \n    standoffPinDiameter, \n    standoffHoleSlack]\n ,[\"Joystick\",\n    26,34,        //Length, Width\n    0, //xPos\n    0, // yPos  \n    1.6,          //pcbThickness\n    -16, // Negative measures from inside of lid \n    7,            //standoffDiameter\n    3.0           //standoffPinDiameter\n  ]\n];\n\n//-------------------------------------------------------------------\n\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 1.25;\nlidPlaneThickness   = 1.25;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 4;\nlidWallHeight       = 20;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 2.0;\nridgeSlack          = 0.2;\nroundRadius         = 4.0;\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = true;     //-> true\npreviewQuality      = 8;        //-> from 1 to 32, Default = 5\nrenderQuality       = 5;        //-> from 1 to 32, Default = 8\nonLidGap            = 0;\nshiftLid            = 5;\ncolorLid            = \"gray\";   \nalphaLid            = 1;//0.2;   \ncolorBase           = \"yellow\";\nalphaBase           = 1;//0.2;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\nshowOrientation     = true;\nshowPCB             = true;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack    = true;     // View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = false;    //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//   Optional:\n//    p(2) = Height to bottom of PCB : Default = standoffHeight\n//    p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    p(4) = standoffDiameter    Default = standoffDiameter;\n//    p(5) = standoffPinDiameter Default = standoffPinDiameter;\n//    p(6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    p(7) = filletRadius (0 = auto size)\n//    p(8) = Pin Length : Default = 0 -> PCB Gap + standoff_PinDiameter\n//             Indicated length of pin without the half sphere tip. \n//             Example : pcbThickness() only leaves the half sphere tip above the PCB\n//    n(a) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    n(b) = { <yappPin>, yappHole, yappTopPin } \n//             yappPin = Pin on Base and Hole on Lid \n//             yappHole = Hole on Both\n//             yappTopPin = Hole on Base and Pin on Lid\n//    n(c) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { yappNoFillet } : Removes the internal and external fillets and the Rounded tip on the pins\n//    n(f) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(g) = yappSelfThreading : make the hole a self threading hole \n//             This ignores the holeSlack and would only be usefull \n//             if the opposing stand if deleted see sample in Demo_Connectors\n//-------------------------------------------------------------------\npcbStands = \n[\n//  [2.75, 3.5, yappFrontLeft, yappFrontRight, yappTopPin],\n//  [5.3, 3.5, yappBackLeft, yappBackRight, yappTopPin],\n// Normal with pin and hole\n  //[3.5, 2.75, yappFrontLeft, yappBackLeft, yappTopPin, [yappPCBName, \"Joystick\"]],\n  //[3.5, 5.3, yappFrontRight, yappBackRight, yappTopPin, [yappPCBName, \"Joystick\"]],\n  \n// Self taping with only lid \n//  [3.5, 2.75, 7, 3.0, yappFrontLeft, yappBackLeft, yappHole, [yappPCBName, \"Joystick\"], yappLidOnly, yappSelfThreading],\n  [3.5, 2.75, yappDefault, yappDefault, 7.0, 3.0, yappFrontLeft, yappBackLeft, yappHole, [yappPCBName, \"Joystick\"], yappLidOnly, yappSelfThreading],\n  [3.5, 5.3,, yappDefault, yappDefault, 7.0, 3.0, yappFrontRight, yappBackRight, yappHole, [yappPCBName, \"Joystick\"], yappLidOnly, yappSelfThreading],\n\n];\n\n\n\n//===================================================================\n//  *** Connectors ***\n//  Standoffs with hole through base and socket in lid for screw type connections.\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB : pcb[0,0,0]\n//  \n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = StandHeight : From specified origin \n//    p(3) = screwDiameter\n//    p(4) = screwHeadDiameter (don't forget to add extra for the fillet)\n//    p(5) = insertDiameter\n//    p(6) = outsideDiameter\n//   Optional:\n//    p(7) = insert Depth : default to entire connector\n//    p(8) = PCB Gap : Default if yappCoordPCB then pcbThickness else 0\n//    p(9) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }\n//    n(b) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(c) = { yappNoFillet }\n//    n(d) = { yappCountersink }\n//    n(e) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(f) = { yappThroughLid = changes the screwhole to the lid and the socket to the base}\n//    n(g) = {yappSelfThreading} : Make the insert self threading specify the Screw Diameter in the insertDiameter\n//-------------------------------------------------------------------\nconnectors   =\n[\n \n [14,14,\n    3, //StandHeight\n    3.1, //screwDiameter\n    5.5, //screwHeadDiameter\n    3.0, //insertDiameter\n    8, //outsideDiameter\n    yappCoordBox, yappAllCorners\n    , yappSelfThreading\n    ],\n\n];\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//                        Required                Not Used        Note\n//----------------------+-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be\n//                      |                       |               | provided\n//  yappRing            | width, length, radius |               | radius = outer radius, \n//                      |                       |               | length = inner radius\n//                      |                       |               | width = connection between rings\n//                      |                       |               |   0 = No connectors\n//                      |                       |               |   positive = 2 connectors\n//                      |                       |               |   negative = 4 connectors\n//  yappSphere          | width, radius         |               | Width = Sphere center distance from\n//                      |                       |               |   center of depth.  negative = below\n//                      |                       |               | radius = sphere radius\n//----------------------+-----------------------+---------------+------------------------------------\n//\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey | yappSphere }\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappAltOrigin } // Only affects Top(lid), Back and Right Faces\n//    n(g) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(h) = { yappFromInside } Make the cut from the inside towards the outside\n//-------------------------------------------------------------------\n\ncutoutsBase = \n[\n];\n\ncutoutsLid  = \n[\n\n  //Spherical cutout for Joystick\n  [\n    pcbLength(\"Joystick\") - 12.25, //pcbLength(\"Joystick\")/2, //xPos\n    pcbWidth(\"Joystick\")/2, // yPos\n    10-7 + (-lidPlaneThickness/2), // Shift offset in Z to the inside of the lid - offset needed\n    undef, //    p(3) = length\n    14.5, //    Joystick Hat radius\n    yappSphere, //    p(5) = shape \n    20+lidPlaneThickness, //5 // depth\n    //yappCoordBox,\n    yappCenter,\n    [yappPCBName, \"Joystick\"], \n  ]\n\n\n\n// [20,20, 0, 10, 20, yappRing, yappCenter]\n// ,[70,20, 5, 10, 20, yappRing, yappDefault, 0, yappCenter]\n// ,[120,20, -5, 10, 20, yappRing, yappDefault, 45, yappCenter]\n];\n\ncutoutsFront = \n[\n];  \n\n\ncutoutsBack = \n[\n  [5,  //    p(0) = from Back\n    3,//    p(1) = from Left (height)\n    undef,//    p(2) = width\n    11.5,//    p(3) = length\n    13.3/2, //    p(4) = radius\n    yappCircleWithFlats,//    p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n    yappCenter,\n  ],\n];\n\n\ncutoutsLeft = \n[\n];\n\ncutoutsRight = \n[\n  [pcbLength(\"Joystick\")/2,  //    p(0) = from Back\n    4,//    p(1) = from Left (height)\n    13.5,//    p(2) = width\n    2.5,//    p(3) = length\n    undef, //    p(4) = radius\n    yappRectangle,//    p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n    yappCenter,\n    [yappPCBName, \"Joystick\"], \n  ],\n];\n\n//===================================================================\n//  *** Snap Joins ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx | posy\n//    (1) = width\n//    (n) = yappLeft / yappRight / yappFront / yappBack (one or more)\n//   Optional:\n//    (n) = { <yappOrigin> | yappCenter }\n//    (n) = { yappSymmetric }\n//    (n) = { yappRectangle } == Make a diamond shape snap\n//-------------------------------------------------------------------\n\nsnapJoins =   \n[\n // [(shellWidth/2),     10, yappFront, yappCenter],\n// [(shellWidth/2),     6, yappFront, yappBack, yappCenter],\n];\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Demo_Labels_v3.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.3.4 (2025-02-14)\n//\n// This design is parameterized based on the size of a PCB.\n//\n// For many/complex cutoutGrills, you might need to adjust\n//  the max number of elements in OpenSCAD:\n//\n//      Preferences->Advanced->Turn off rendering at 250000 elements\n//                                                   ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <./YAPPgenerator_v3.scad>\n\n//---------------------------------------------------------\n// This design is parameterized based on the size of a PCB.\n//---------------------------------------------------------\n// Note: length/lengte refers to X axis, \n//       width/breedte refers to Y axis,\n//       height/hoogte refers to Z axis\n\n/*\n      padding-back|<------pcb length --->|<padding-front\n                            RIGHT\n        0    X-axis ---> \n        +----------------------------------------+   ---\n        |                                        |    ^\n        |                                        |   padding-right \n      Y |                                        |    v\n      | |    -5,y +----------------------+       |   ---              \n B    a |         | 0,y              x,y |       |     ^              F\n A    x |         |                      |       |     |              R\n C    i |         |                      |       |     | pcb width    O\n K    s |         |                      |       |     |              N\n        |         | 0,0              x,0 |       |     v              T\n      ^ |    -5,0 +----------------------+       |   ---\n      | |                                        |    padding-left\n      0 +----------------------------------------+   ---\n        0    X-as --->\n                          LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\nprintDisplayClips     = true;\n\n// ********************************************************************\n// The Following will be used as the first element in the pbc array\n\n//Defined here so you can define the \"Main\" PCB using these if wanted\npcbLength           = 200; // front to back (X axis)\npcbWidth            = 200; // side to side (Y axis)\npcbThickness        = 1.6; \nstandoffHeight      = 1.0; //-- How much the PCB needs to be raised from the base to leave room for solderings and whatnot\nstandoffDiameter    = 7;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\n\n//===================================================================\n// *** PCBs ***\n// Printed Circuit Boards\n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : yappCoordBoxInside[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = name\n//    p(1) = length\n//    p(2) = width\n//    p(3) = posx\n//    p(4) = posy\n//    p(5) = Thickness\n//    p(6) = standoff_Height\n//    p(7) = standoff_Diameter\n//    p(8) = standoff_PinDiameter\n//   Optional:\n//    p(9) = standoff_HoleSlack (default to 0.4)\n\n//The following can be used to get PCB values elsewhere in the script - not in pcb definition. \n//If \"PCB Name\" is omitted then \"Main\" is used\n//  pcbLength           --> pcbLength(\"PCB Name\")\n//  pcbWidth            --> pcbWidth(\"PCB Name\")\n//  pcbThickness        --> pcbThickness(\"PCB Name\") \n//  standoffHeight      --> standoffHeight(\"PCB Name\") \n//  standoffDiameter    --> standoffDiameter(\"PCB Name\") \n//  standoffPinDiameter --> standoffPinDiameter(\"PCB Name\") \n//  standoffHoleSlack   --> standoffHoleSlack(\"PCB Name\") \n\npcb = \n[\n  // Default Main PCB - DO NOT REMOVE the \"Main\" line.\n  [\"Main\",              pcbLength,pcbWidth,    0,0,    pcbThickness,  standoffHeight, standoffDiameter, standoffPinDiameter, standoffHoleSlack]\n];\n\n//-------------------------------------------------------------------                            \n//-- padding between pcb and inside wall\npaddingFront        = 2;\npaddingBack         = 2;\npaddingRight        = 2;\npaddingLeft         = 2;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 1.5;\nlidPlaneThickness   = 1.5;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 25;\nlidWallHeight       = 23;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.2;\nroundRadius         = 3.0;\n\n// Box Types are 0-4 with 0 as the default\n// 0 = All edges rounded with radius (roundRadius) above\n// 1 = All edges sqrtuare\n// 2 = All edges chamfered by (roundRadius) above \n// 3 = Square top and bottom edges (the ones that touch the build plate) and rounded vertical edges\n// 4 = Square top and bottom edges (the ones that touch the build plate) and chamfered vertical edges\n// 5 = Chanfered top and bottom edges (the ones that touch the build plate) and rounded vertical edges\nboxType             = 0; // Default type 0\n\n// Set the layer height of your printer\nprinterLayerHeight  = 0.2;\n\n\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n// -- Render --\nrenderQuality             = 8;          //-> from 1 to 32, Default = 8\n\n// --Preview --\npreviewQuality            = 5;          //-> from 1 to 32, Default = 5\nshowSideBySide            = true;       //-> Default = true\nonLidGap                  = 0;  // tip don't override to animate the lid opening\ncolorLid                  = \"YellowGreen\";   \nalphaLid                  = 1;\ncolorBase                 = \"BurlyWood\";\nalphaBase                 = 1;\nhideLidWalls              = false;      //-> Remove the walls from the lid : only if preview and showSideBySide=true \nhideBaseWalls             = false;      //-> Remove the walls from the base : only if preview and showSideBySide=true  \nshowOrientation           = true;       //-> Show the Front/Back/Left/Right labels : only in preview\nshowPCB                   = false;      //-> Show the PCB in red : only in preview \nshowSwitches              = false;      //-> Show the switches (for pushbuttons) : only in preview \nshowButtonsDepressed      = false;      //-> Should the buttons in the Lid On view be in the pressed position\nshowOriginCoordBox        = false;      //-> Shows red bars representing the origin for yappCoordBox : only in preview \nshowOriginCoordBoxInside  = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowOriginCoordPCB        = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowMarkersPCB            = false;      //-> Shows black bars corners of the PCB : only in preview \nshowMarkersCenter         = false;      //-> Shows magenta bars along the centers of all faces  \ninspectX                  = 0;          //-> 0=none (>0 from Back)\ninspectY                  = 0;          //-> 0=none (>0 from Right)\ninspectZ                  = 0;          //-> 0=none (>0 from Bottom)\ninspectXfromBack          = true;       //-> View from the inspection cut foreward\ninspectYfromLeft          = true;       //-> View from the inspection cut to the right\ninspectZfromBottom        = true;       //-> View from the inspection cut up\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n\n//-------------------------------------------------------------------\n//-------------------------------------------------------------------\n// Start of Debugging config (used if not overridden in template)\n// ------------------------------------------------------------------\n// ------------------------------------------------------------------\n\n//==================================================================\n//  *** Shapes ***\n//------------------------------------------------------------------\n//  There are a view pre defines shapes and masks\n//  shapes:\n//      shapeIsoTriangle, shapeHexagon, shape6ptStar\n//\n//  masks:\n//      maskHoneycomb, maskHexCircles, maskBars, maskOffsetBars\n//\n//------------------------------------------------------------------\n// Shapes should be defined to fit into a 1x1 box (+/-0.5 in X and Y) - they will \n// be scaled as needed.\n// defined as a vector of [x,y] vertices pairs.(min 3 vertices)\n// for example a triangle could be [yappPolygonDef,[[-0.5,-0.5],[0,0.5],[0.5,-0.5]]];\n// To see how to add your own shapes and mask see the YAPPgenerator program\n//------------------------------------------------------------------\n\n\n             \n//===================================================================\n//  *** Labels ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   p(0) = posx\n//   p(1) = posy/z\n//   p(2) = rotation degrees CCW\n//   p(3) = depth : positive values go into case (Remove) negative values are raised (Add)\n//   p(4) = { yappLeft, yappRight, yappFront, yappBack, yappLid, yappBase } : plane\n//   p(5) = font\n//   p(6) = size\n//   p(7) = \"label text\"\n//  Optional:\n//   p(8) = Expand : Default = 0 : mm to expand text by (making it bolder) \n//   p(9) = Direction : { <yappTextLeftToRight>, yappTextRightToLeft, yappTextTopToBottom, yappTextBottomToTop }\n//   p(10) = Horizontal alignment : { <yappTextHAlignLeft>, yappTextHAlignCenter, yappTextHAlignRight }\n//   p(11) = Vertical alignment : {  yappTextVAlignTop, yappTextVAlignCenter, yappTextVAlignBaseLine, <yappTextVAlignBottom> } \n//   p(12) = Character Spacing multiplier (1.0 = normal)\n//-------------------------------------------------------------------\nlabelsPlane =\n[\n   [50, shellWidth-20, 0, 1, yappLid, \"Liberation Mono\", 5, \"Normal/Left\"],\n   [50, shellWidth-30, 0, 1, yappLid, \"Liberation Mono\", 5, \"Center\" ,undef, undef, yappTextHAlignCenter ],\n   [50, shellWidth-40, 0, 1, yappLid, \"Liberation Mono\", 5, \"Right\" ,undef, undef, yappTextHAlignRight],\n   \n   [10, shellWidth-50, 0, 1, yappLid, \"Liberation Mono\", 5, \"Normal/Bottom (|)\"], // (|) added to text to get full height with ascenders/descenders\n   [50, shellWidth-50, 0, 1, yappLid, \"Liberation Mono\", 5, \"Top(|)\" ,undef, undef,undef, yappTextVAlignTop],\n   [80, shellWidth-50, 0, 1, yappLid, \"Liberation Mono\", 5, \"Center (|)\" ,undef, undef,undef,yappTextVAlignCenter ],\n   [120, shellWidth-50, 0, 1, yappLid, \"Liberation Mono\", 5, \"Baseline (|)\" ,undef, undef,undef,yappTextVAlignBottom],\n \n \n   [20, shellWidth-60, 0, 1, yappLid, \"Liberation Mono\", 5, \"Verticle Text\" ,0.15, yappTextTopToBottom, undef, undef, 1.1],\n   [25, shellWidth-60, 0, 1, yappLid, \"Liberation Mono\", 5, \"Verticle Text\" ,0.15, yappTextTopToBottom, undef, undef, 1.0],\n   [30, shellWidth-60, 90, 1, yappLid, \"Liberation Mono\", 5, \"Vert Rotated\" ,0.15, yappTextTopToBottom, undef, undef, 1.1],\n\n];\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Demo_RealBox_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for Demo RealBox - transmitter/receiver\n//\n//  Version 3.0 (01-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\nmakeTransmitter = false; //-- {true|false}\n\n//=========== DON'T CHANGE ANYTING BELOW THIS LINE ==================\n\ninsertDiam = 4.1;\n\nleftPadding = makeTransmitter ? 1 : 15;\n\ninclude <../YAPPgenerator_v3.scad>\n\n\n/*\nsee https://polyd.com/en/conversione-step-to-stl-online\n*/\n\nmyPcb = \"./STL/MODELS/virtualP1Cable_v10_model.stl\";\n\nif (true)\n{\n  translate([-145.5, 156.5+leftPadding, 5.5]) \n  {\n    rotate([0,0,0]) color(\"lightgray\") import(myPcb);\n  }\n}\n\n//-- switchBlock dimensions\nswitchWallThickness =  1;\nswitchWallHeight    = 11;\nswitchLength        = 15;\nswitchWidth         = 13;\n\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = false;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 62.3;\npcbWidth            = 49.6;\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = leftPadding; //-> set on top of file;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 1.8;\nbasePlaneThickness  = 1.5;\nlidPlaneThickness   = 1.5;\n\n//-- Total height of box = basePlaneThickness + lidPlaneThickness \n//--                     + baseWallHeight + lidWallHeight\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 14;\nlidWallHeight       =  5;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 3.5;\nridgeSlack          = 0.2;\nroundRadius         = 2.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 4.0;  //-- only used for showPCB\nstandoffPinDiameter = 2.2;\nstandoffHoleSlack   = 0.4;\nstandoffDiameter    = 5;\n\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = false;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 8;        //-> from 1 to 32, Default = 8\nonLidGap            = 0;\nshiftLid            = 5;\ncolorLid            = \"YellowGreen\";   \ncolorBase           = \"BurlyWood\";\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\nshowOrientation     = true;\nshowPCB             = false;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack    = true;     // View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = false;    //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n\n\n//===================================================================\n//   *** PCB Supports ***\n//   Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx\n//    (1) = posy\n//   Optional:\n//    (2) = Height to bottom of PCB : Default = standoffHeight\n//    (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    (4) = standoffDiameter    Default = standoffDiameter;\n//    (5) = standoffPinDiameter Default = standoffPinDiameter;\n//    (6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    (7) = filletRadius (0 = auto size)\n//    (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    (n) = { yappHole, <yappPin> } // Baseplate support treatment\n//    (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    (n) = { yappCoordBox, <yappCoordPCB> }  \n//    (n) = { yappNoFillet }\n//-------------------------------------------------------------------\npcbStands =    \n[// 0,   1,   2, 3, 4, 5, 6\n    [3.2, 3.0, yappBoth, yappPin, yappFrontRight]\n   ,[3.2, 3.5, yappBoth, yappPin, yappBackLeft]\n];\n\n//===================================================================\n//   *** Connectors ***\n//   Standoffs with hole through base and socket in lid for screw type connections.\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//  \n//  Parameters:\n//   Required:\n//    (0) = posx\n//    (1) = posy\n//    (2) = pcbStandHeight\n//    (3) = screwDiameter\n//    (4) = screwHeadDiameter (don't forget to add extra for the fillet)\n//    (5) = insertDiameter\n//    (6) = outsideDiameter\n//   Optional:\n//    (7) = filletRadius : Default = 0/Auto(0 = auto size)\n//    (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    (n) = { <yappCoordBox>, yappCoordPCB }\n//    (n) = { yappNoFillet }\n//-------------------------------------------------------------------\nconnectors   = \n[ \n //--0, 1,   2, 3,   4, 5,          6, 7, 8, -rest-\n    [3, 3.2, 4, 2.7, 5, insertDiam, 7, 0, yappCoordPCB, yappFrontLeft]\n   ,[3, 3.2, 4, 2.7, 5, insertDiam, 7, 0, yappCoordPCB, yappBackRight]\n];\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase, cutoutsLid, cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//                      +-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be provided\n//\n//  Parameters:\n//   Required:\n//    (0) = from Back\n//    (1) = from Left\n//    (2) = width\n//    (3) = length\n//    (4) = radius\n//    (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                   | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    (7) = angle : Default = 0\n//    (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.\n//    (n) = { <yappCoordBox> | yappCoordPCB }\n//    (n) = { <yappOrigin>, yappCenter }\n//    (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top, Back and Right Faces\n//-------------------------------------------------------------------\n\ncutoutsBase =   \n[\n      [pcbLength/2, pcbWidth/2 ,25, 25, 0, yappPolygon, shapeHexagon, maskHoneycomb, yappCenter, yappCoordPCB]\n];\n                \ncutoutsLid  =   \n[\n //-- 0,    1,    2,  3, 4, 5, 6, 7              8,  9,  n\n    [-3,   30,   13,  8, 0, yappRectangle, yappCoordPCB]             //-- antennaConnector\n   ,[45,    8.5, 18, 15, 0, yappRectangle, 4, yappCoordPCB]          //-- RJ12\n   ,[49.5, 41.5, 14, 12, 0, yappRectangle, yappCenter, yappCoordPCB] //-- switchBlock\n];\n\n              \n//   (0) = xPos from used yappCoord[0,0,0]\n//   (1) = zPos from used yappCoord[0,0,0]\ncutoutsFront =  \n[\n    [ 8.5, 0, 15, 16, 0,   yappRectangle, 4, yappCoordPCB]    //-- RJ12\n   ,[-6,   0,  0,  7, 4.5, yappCircleWithFlats, 0, 90, yappCenter, yappCoordPCB] //-- powerJack\n];\n\ncutoutsBack =   \n[\n //-- 0,   1, 2, 3, 4, 5,          6, n\n    [34,  15, 0, 0, 6, yappCircle, 10, yappCenter, yappCoordPCB]  //-- antennaConnector\n];\n\n//-- base mounts -- origen = box[x0,y0]\n// (0) = posx | posy\n// (1) = screwDiameter\n// (2) = width\n// (3) = height\n// (4..7) = yappLeft / yappRight / yappFront / yappBack (one or more)\n// (5) = { yappCenter }\nbaseMounts   =  \n[\n    [pcbLength/2, pcbWidth/2 ,25, 25, 0, 0 , 0, yappPolygon, shapeHexagon, maskHoneycomb, yappCenter, yappCoordPCB] //, yappUseMask]\n];\n\n//===================================================================\n//  *** Snap Joins ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx | posy\n//    (1) = width\n//    (n) = yappLeft / yappRight / yappFront / yappBack (one or more)\n//   Optional:\n//    (n) = { <yappOrigin> | yappCenter }\n//    (n) = { yappSymmetric }\n//    (n) = { yappRectangle } == Make a diamond shape snap\n//-------------------------------------------------------------------\nsnapJoins   =   \n[\n  [15, 3, yappLeft, yappRight, yappCenter, yappSymmetric]\n];\n               \n\n\n//========= MAIN CALL's ===========================================================\n  \n//===========================================================\nmodule hookLidInside()\n{\n  echo(\"hookLidInsidePost(switchBox) ..\");\n  \n  translate([(47.5+wallThickness+paddingFront)\n                , (38.5+wallThickness+paddingRight+paddingLeft)\n                , (switchWallHeight+0)/-2])\n  {\n    difference()\n    {\n      //-- [49.5, 41.5, 12, 14, 0, yappRectangle, yappCenter]   //-- switchBlock\n      //-- [49.5, 41.5, 13, 15, 0, yappRectangle, yappCenter]   //-- switchBlock\n\n      color(\"blue\") cube([switchLength, switchWidth, switchWallHeight], center=true);\n      color(\"red\")  cube([switchLength-switchWallThickness, \n                            switchWidth-switchWallThickness, switchWallHeight+1], center=true);\n    }\n  }\n  \n  \n} // hookLidInside(dummy)\n  \n\n//----------------------------------------------------------\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Demo_RealBox_v31.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for Demo RealBox - transmitter/receiver\n//\n//  Version 3.0 (01-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\nmakeTransmitter = false; //-- {true|false}\n\n//=========== DON'T CHANGE ANYTING BELOW THIS LINE ==================\n\ninsertDiam = 4.1;\n\nleftPadding = makeTransmitter ? 1 : 15;\n\ninclude <../YAPPgenerator_v3.scad>\n\n\n/*\nsee https://polyd.com/en/conversione-step-to-stl-online\n*/\n\nmyPcb = \"./STL/MODELS/virtualP1Cable_v10_model.stl\";\n\nif (true)\n{\n  translate([-145.5, 156.5+leftPadding, 5.5]) \n  {\n    rotate([0,0,0]) color(\"lightgray\") import(myPcb);\n  }\n}\n\n//-- switchBlock dimensions\nswitchWallThickness =  1;\nswitchWallHeight    = 11;\nswitchLength        = 15;\nswitchWidth         = 13;\n\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = false;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 62.3;\npcbWidth            = 49.6;\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = leftPadding; //-> set on top of file;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 1.8;\nbasePlaneThickness  = 1.5;\nlidPlaneThickness   = 1.5;\n\n//-- Total height of box = basePlaneThickness + lidPlaneThickness \n//--                     + baseWallHeight + lidWallHeight\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 14;\nlidWallHeight       =  5;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 3.5;\nridgeSlack          = 0.2;\nroundRadius         = 2.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 4.0;  //-- only used for showPCB\nstandoffPinDiameter = 2.2;\nstandoffHoleSlack   = 0.4;\nstandoffDiameter    = 5;\n\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = false;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 8;        //-> from 1 to 32, Default = 8\nonLidGap            = 0;\nshiftLid            = 5;\ncolorLid            = \"YellowGreen\";   \ncolorBase           = \"BurlyWood\";\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\nshowOrientation     = true;\nshowPCB             = false;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack    = true;     // View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = false;    //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n\n\n//===================================================================\n//   *** PCB Supports ***\n//   Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx\n//    (1) = posy\n//   Optional:\n//    (2) = Height to bottom of PCB : Default = standoffHeight\n//    (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    (4) = standoffDiameter    Default = standoffDiameter;\n//    (5) = standoffPinDiameter Default = standoffPinDiameter;\n//    (6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    (7) = filletRadius (0 = auto size)\n//    (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    (n) = { yappHole, <yappPin> } // Baseplate support treatment\n//    (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    (n) = { yappCoordBox, <yappCoordPCB> }  \n//    (n) = { yappNoFillet }\n//-------------------------------------------------------------------\npcbStands =    \n[// 0,   1,   2, 3, 4, 5, 6\n    [3.2, 3.0, yappBoth, yappPin, yappFrontRight]\n   ,[3.2, 3.5, yappBoth, yappPin, yappBackLeft]\n];\n\n//===================================================================\n//   *** Connectors ***\n//   Standoffs with hole through base and socket in lid for screw type connections.\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//  \n//  Parameters:\n//   Required:\n//    (0) = posx\n//    (1) = posy\n//    (2) = pcbStandHeight\n//    (3) = screwDiameter\n//    (4) = screwHeadDiameter (don't forget to add extra for the fillet)\n//    (5) = insertDiameter\n//    (6) = outsideDiameter\n//   Optional:\n//    (7) = filletRadius : Default = 0/Auto(0 = auto size)\n//    (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    (n) = { <yappCoordBox>, yappCoordPCB }\n//    (n) = { yappNoFillet }\n//-------------------------------------------------------------------\nconnectors   = \n[ \n //--0, 1,   2, 3,   4, 5,          6, 7, 8, -rest-\n    [3, 3.2, 4, 2.7, 5, insertDiam, 7, 0, yappCoordPCB, yappFrontLeft]\n   ,[3, 3.2, 4, 2.7, 5, insertDiam, 7, 0, yappCoordPCB, yappBackRight]\n];\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase, cutoutsLid, cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//                      +-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be provided\n//\n//  Parameters:\n//   Required:\n//    (0) = from Back\n//    (1) = from Left\n//    (2) = width\n//    (3) = length\n//    (4) = radius\n//    (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                   | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    (7) = angle : Default = 0\n//    (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.\n//    (n) = { <yappCoordBox> | yappCoordPCB }\n//    (n) = { <yappOrigin>, yappCenter }\n//    (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top, Back and Right Faces\n//-------------------------------------------------------------------\n\ncutoutsBase =   \n[\n      [pcbLength/2, pcbWidth/2 ,25, 25, 0, yappPolygon, shapeHexagon, maskHoneycomb, yappCenter, yappCoordPCB]\n];\n                \ncutoutsLid  =   \n[\n //-- 0,    1,    2,  3, 4, 5, 6, 7              8,  9,  n\n    [-3,   30,   13,  8, 0, yappRectangle, yappCoordPCB]             //-- antennaConnector\n   ,[45,    8.5, 18, 15, 0, yappRectangle, 4, yappCoordPCB]          //-- RJ12\n   ,[49.5, 41.5, 14, 12, 0, yappRectangle, yappCenter, yappCoordPCB] //-- switchBlock\n];\n\n              \n//   (0) = xPos from used yappCoord[0,0,0]\n//   (1) = zPos from used yappCoord[0,0,0]\ncutoutsFront =  \n[\n    [ 8.5, 0, 15, 16, 0,   yappRectangle, 4, yappCoordPCB]    //-- RJ12\n   ,[-6,   0,  0,  7, 4.5, yappCircleWithFlats, 0, 90, yappCenter, yappCoordPCB] //-- powerJack\n];\n\ncutoutsBack =   \n[\n //-- 0,   1, 2, 3, 4, 5,          6, n\n    [34,  15, 0, 0, 6, yappCircle, 10, yappCenter, yappCoordPCB]  //-- antennaConnector\n];\n\n//-- base mounts -- origen = box[x0,y0]\n// (0) = posx | posy\n// (1) = screwDiameter\n// (2) = width\n// (3) = height\n// (4..7) = yappLeft / yappRight / yappFront / yappBack (one or more)\n// (5) = { yappCenter }\nbaseMounts   =  \n[\n    [pcbLength/2, pcbWidth/2 ,25, 25, 0, 0 , 0, yappPolygon, shapeHexagon, maskHoneycomb, yappCenter, yappCoordPCB] //, yappUseMask]\n];\n\n//===================================================================\n//  *** Snap Joins ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx | posy\n//    (1) = width\n//    (n) = yappLeft / yappRight / yappFront / yappBack (one or more)\n//   Optional:\n//    (n) = { <yappOrigin> | yappCenter }\n//    (n) = { yappSymmetric }\n//    (n) = { yappRectangle } == Make a diamond shape snap\n//-------------------------------------------------------------------\nsnapJoins   =   \n[\n  [15, 3, yappLeft, yappRight, yappCenter, yappSymmetric]\n];\n               \n\n\n//========= MAIN CALL's ===========================================================\n  \n//===========================================================\nmodule hookLidInside()\n{\n  echo(\"hookLidInsidePost(switchBox) ..\");\n  \n  translate([(47.5+wallThickness+paddingFront)\n                , (38.5+wallThickness+paddingRight+paddingLeft)\n                , (switchWallHeight+0)/-2])\n  {\n    difference()\n    {\n      //-- [49.5, 41.5, 12, 14, 0, yappRectangle, yappCenter]   //-- switchBlock\n      //-- [49.5, 41.5, 13, 15, 0, yappRectangle, yappCenter]   //-- switchBlock\n\n      color(\"blue\") cube([switchLength, switchWidth, switchWallHeight], center=true);\n      color(\"red\")  cube([switchLength-switchWallThickness, \n                            switchWidth-switchWallThickness, switchWallHeight+1], center=true);\n    }\n  }\n  \n  \n} // hookLidInside(dummy)\n  \n\n//----------------------------------------------------------\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Demo_boxMounts_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a YAPP_Test_buttons_v30 test box\n//\n//    Rendering takes ~ 11 minutes (renderQuality 10)\n//    Rendering takes ~  5 minutes (renderQuality 5)\n//\n//  Version 3.0 (01-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 100;\npcbWidth            = 100;\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 1.4;\nbasePlaneThickness  = 1.5;\nlidPlaneThickness   = 1.0;\n\n//-- Total height of box = basePlaneThickness + lidPlaneThickness \n//--                     + baseWallHeight + lidWallHeight\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 10;\nlidWallHeight       = 10;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 3.0;  //-> at least 1.8 * wallThickness\nridgeSlack          = 0.2;\nroundRadius         = 8.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 3.0;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\nstandoffDiameter    = 6;\n\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = true;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 5;        //-> from 1 to 32, Default = 8\nonLidGap            = 0;\nshiftLid            = 10;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\ncolorBase           = \"yellow\";\nalphaBase           = 0.8;//0.2;   \ncolorLid            = \"silver\";\nalphaLid            = 0.8;//0.2;   \nshowOrientation     = true;\nshowPCB             = false;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Base)\ninspectXfromBack    = false;     //-> View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = true;     //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n\n//===================================================================\n//  *** Box Mounts ***\n//    Mounting tabs on the outside of the box\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X. Position is to center of mounting screw in leftmost position in slot\n//    p(1) = screwDiameter\n//    p(2) = width of opening in addition to screw diameter (0=Circular hole screwWidth = hole twice as wide as it is tall)\n//    p(3) = height\n//   Optional:\n//    p(4) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = yappLeft / yappRight / yappFront / yappBack (one or more)\n//    n(b) = { yappNoFillet }\n//    n(c) = { <yappBase>, yappLid }\n//    n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of the left of the opening\n//    n(e) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Back and Right Faces\n//-------------------------------------------------------------------\nboxMounts =\n[\n [13, 3, 3, 3, yappLeft, yappRight, yappFront, yappBack]\n,[30, 3, 6, 3, yappLeft, yappRight, yappFront, yappBack, yappCenter]\n,[30, 2, 6, 5, yappLeft, yappRight, yappFront, yappBack, yappCenter, yappLeftOrigin] // Note placement as previous line for Front and Left\n,[10, 3, 6, 3, yappLeft, yappRight, yappFront, yappBack, yappLid]\n,[30, 3, 6, 3, yappLeft, yappRight, yappFront, yappBack, yappCenter, yappLid]\n,[30, 3, 6, 3, yappLeft, yappRight, yappFront, yappBack, yappCenter, yappLeftOrigin, yappLid] // Note placement as previous line for Front and Left\n\n,[40, 3, 3, 3, yappLeft]        // 3 length yields a hole twice as wide as long (screw diameter = 3 also)\n,[50, 3, 0, 3, 1, yappLeft]     // Zero length yields a circular hole\n,[60, 3, -3, 3, yappLeft]       // 3 length yields a hole twice as long as wide perpendicular to case (screw diameter = 3 also)\n,[[70,10], 3, 10, 3, yappLeft]  // Vector por position yoelds Pos=70, offset = normal offset + 10\n,[0, 3, 0, 3, 4, yappFront]     // Note fillet/connection issues when closer to corner than roundRadius value\n];\n\n\n//========= MAIN CALL's ===========================================================\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Demo_boxMounts_v31.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a YAPP_Test_buttons_v30 test box\n//\n//    Rendering takes ~ 11 minutes (renderQuality 10)\n//    Rendering takes ~  5 minutes (renderQuality 5)\n//\n//  Version 3.0 (01-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 100;\npcbWidth            = 100;\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 1.4;\nbasePlaneThickness  = 1.5;\nlidPlaneThickness   = 1.0;\n\n//-- Total height of box = basePlaneThickness + lidPlaneThickness \n//--                     + baseWallHeight + lidWallHeight\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 20;\nlidWallHeight       = 20;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 3.0;  //-> at least 1.8 * wallThickness\nridgeSlack          = 0.2;\nroundRadius         = 8.0;\n\nboxtype = 5;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 3.0;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\nstandoffDiameter    = 6;\n\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = true;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 5;        //-> from 1 to 32, Default = 8\nonLidGap            = 0;\nshiftLid            = 10;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\ncolorBase           = \"yellow\";\nalphaBase           = 0.8;//0.2;   \ncolorLid            = \"silver\";\nalphaLid            = 0.8;//0.2;   \nshowOrientation     = true;\nshowPCB             = false;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Base)\ninspectXfromBack    = false;     //-> View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = true;     //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n\n//===================================================================\n//  *** Box Mounts ***\n//    Mounting tabs on the outside of the box\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X. Position is to center of mounting screw in leftmost position in slot\n//    p(1) = screwDiameter\n//    p(2) = width of opening in addition to screw diameter (0=Circular hole screwWidth = hole twice as wide as it is tall)\n//    p(3) = height\n//   Optional:\n//    p(4) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = yappLeft / yappRight / yappFront / yappBack (one or more)\n//    n(b) = { yappNoFillet }\n//    n(c) = { <yappBase>, yappLid }\n//    n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of the left of the opening\n//    n(e) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Back and Right Faces\n//-------------------------------------------------------------------\nboxMounts =\n[\n [13, 3, 3, 3, yappLeft, yappRight, yappFront, yappBack]\n,[30, 3, 6, 3, yappLeft, yappRight, yappFront, yappBack, yappCenter]\n,[30, 2, 6, 5, yappLeft, yappRight, yappFront, yappBack, yappCenter, yappAltOrigin] // Note placement as previous line for Front and Left\n,[10, 3, 6, 3, yappLeft, yappRight, yappFront, yappBack, yappLid]\n,[30, 3, 6, 3, yappLeft, yappRight, yappFront, yappBack, yappCenter, yappLid]\n,[30, 3, 6, 3, yappLeft, yappRight, yappFront, yappBack, yappCenter, yappAltOrigin, yappLid] // Note placement as previous line for Front and Left\n\n,[40, 3, 3, 3, yappLeft]        // 3 length yields a hole twice as wide as long (screw diameter = 3 also)\n,[50, 3, 0, 3, 1, yappLeft]     // Zero length yields a circular hole\n,[60, 3, -3, 3, yappLeft]       // 3 length yields a hole twice as long as wide perpendicular to case (screw diameter = 3 also)\n,[[70,10], 3, 10, 3, yappLeft]  // Vector por position yoelds Pos=70, offset = normal offset + 10\n,[0, 3, 0, 3, 4, yappFront]     // Note fillet/connection issues when closer to corner than roundRadius value\n];\n\n\n//========= MAIN CALL's ===========================================================\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Demo_buttons2_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a YAPP_Test_buttons2_v30 test box\n//\n//    Rendering takes ~ 11 minutes (renderQuality 10)\n//    Rendering takes ~  5 minutes (renderQuality 5)\n//\n//  Version 3.0 (12-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\n//-- Bambu Lab X1C 0.4mm Nozzle PLA\n//insertDiam  = 3.8 + 0.4;\n//screwDiam   = 2.5 + 0.4;\n//-- Bambu Lab X1C 0.4mm Nozzle XT-Copolyester\ninsertDiam  = 3.8 + 0.5;\nscrewDiam   = 2.5 + 0.5;\n  \n\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 100;\npcbWidth            = 100;\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 1.4;\nbasePlaneThickness  = 1.5;\nlidPlaneThickness   = 1.0;\n\n//-- Total height of box = basePlaneThickness + lidPlaneThickness \n//--                     + baseWallHeight + lidWallHeight\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 10;\nlidWallHeight       = 10;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 3.0;  //-> at least 1.8 * wallThickness\nridgeSlack          = 0.2;\nroundRadius         = 2.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 3.0;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\nstandoffDiameter    = 6;\n\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = false;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 5;        //-> from 1 to 32, Default = 8\nonLidGap            = 0;\nshiftLid            = 10;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\ncolorBase           = \"yellow\";\nalphaBase           = 0.8;//0.2;   \ncolorLid            = \"silver\";\nalphaLid            = 0.8;//0.2;   \nshowOrientation     = true;\nshowPCB             = true;\nshowSwitches        = true;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Base)\ninspectXfromBack    = false;     //-> View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = true;     //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx\n//    (1) = posy\n//   Optional:\n//    (2) = Height to bottom of PCB : Default = standoffHeight\n//    (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    (4) = standoffDiameter    Default = standoffDiameter;\n//    (5) = standoffPinDiameter Default = standoffPinDiameter;\n//    (6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    (7) = filletRadius (0 = auto size)\n//    (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    (n) = { yappHole, <yappPin> } // Baseplate support treatment\n//    (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    (n) = { yappCoordBox, <yappCoordPCB> }  \n//    (n) = { yappNoFillet }\n//-------------------------------------------------------------------\npcbStands =\n[\n  [5, 5]\n];\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase, cutoutsLid, cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//                      +-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be provided\n//\n//  Parameters:\n//   Required:\n//    (0) = from Back\n//    (1) = from Left\n//    (2) = width\n//    (3) = length\n//    (4) = radius\n//    (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    (7) = angle : Default = 0\n//    (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.\n//    (n) = { <yappCoordBox> | yappCoordPCB }\n//    (n) = { <yappOrigin>, yappCenter }\n//  (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top, Back and Right Faces\n//-------------------------------------------------------------------\ncutoutsBase =   \n[\n];\n\n// (0) = posy\n// (1) = posz\ncutoutsFront =  \n[\n//-- 0, 1,            2,             3, 4, 5\n    [3, 2, shellWidth-6, shellHeight-4, 2, yappRoundedRect]\n];\n\n// (0) = posy\n// (1) = posz\ncutoutsBack =   \n[\n//-- 0, 1,             2,             3, 4, 5\n    [5, 2, shellWidth-10, shellHeight-4, 3, yappRoundedRect]\n];\n\n\ncutoutsLeft =  \n[\n];\n\n\n\n//===================================================================\n//  *** Push Buttons ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = capLength \n//    p(3) = capWidth \n//    p(4) = capRadius \n//    p(5) = capAboveLid\n//    p(6) = switchHeight\n//    p(7) = switchTravel\n//    p(8) = poleDiameter\n//   Optional:\n//    p(9) = Height to top of PCB : Default = standoffHeight + pcbThickness\n//    p(10) = Shape  {yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey} : Default = yappRectangle\n//    p(11) = angle : Default = 0\n//    p(12) = filletRadius          : Default = 0/Auto \n//    p(13) = buttonWall            : Default = 2.0;\n//    p(14) = buttonPlateThickness  : Default= 2.5;\n//    p(15) = buttonSlack           : Default= 0.25;\n//    n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside } \n//    n(b) = { yappLeftOrigin, <yappGlobalOrigin> }\n//-------------------------------------------------------------------\npushButtons = \n[\n   [20,pcbWidth/2, \n    8, // Width\n    8, // Length\n    4, // Radius\n    0, // Cap above Lid\n    5, // Switch Height\n    0.5, // Switch travel\n    3, // Pole Diameter\n    undef, // Height to top of PCB\n    yappCircle, // Shape\n    yappNoFillet\n  ]\n  ,[20,pcbWidth/2-20, \n    8, // Width\n    8, // Length\n    4, // Radius\n    0, // Cap above Lid\n    5, // Switch Height\n    0.5, // Switch travel\n    3, // Pole Diameter\n    undef, // Height to top of PCB\n    yappCircle, // Shape\n    0,    \n    undef,\n    2.0, //buttonWall\n    2.5, // button plate thickness\n    0.5 // button slack\n  ]\n  ,[40,pcbWidth/2, \n    8, // Width\n    8, // Length\n    4, // Radius\n    0, // Cap above Lid\n    5, // Switch Height\n    0.5, // Switch travel\n    3, // Pole Diameter\n    undef, // Height to top of PCB\n    yappPolygon, // Shape\n    shapeArrow\n  ]\n  ,[40,pcbWidth/2-20, \n    8, // Width\n    8, // Length\n    4, // Radius\n    0, // Cap above Lid\n    5, // Switch Height\n    0.5, // Switch travel\n    3, // Pole Diameter\n    undef, // Height to top of PCB\n    yappPolygon, // Shape\n    90,    \n    shapeArrow\n  ]\n  ,[60,pcbWidth/2, \n    8, // Width\n    8, // Length\n    2, // Radius\n    -1, // Cap above Lid\n    6, // Switch Height\n    1, // Switch travel\n    3, // Pole Diameter\n    undef, // Height to top of PCB\n    yappRoundedRect // Shape\n  ]\n  ,[80,pcbWidth/2, \n    8, // Width\n    8, // Length\n    0, // Radius\n    1, // Cap above Lid\n    5, // Switch Height\n    0.5, // Switch travel\n    3, // Pole Diameter\n    undef, // Height to top of PCB\n    yappRectangle,  // Shape\n    0\n  ]\n\n];\n\n\n//========= MAIN CALL's ===========================================================\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Demo_buttons2_v31.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a YAPP_Test_buttons2_v30 test box\n//\n//    Rendering takes ~ 11 minutes (renderQuality 10)\n//    Rendering takes ~  5 minutes (renderQuality 5)\n//\n//  Version 3.0 (12-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\n//-- Bambu Lab X1C 0.4mm Nozzle PLA\n//insertDiam  = 3.8 + 0.4;\n//screwDiam   = 2.5 + 0.4;\n//-- Bambu Lab X1C 0.4mm Nozzle XT-Copolyester\ninsertDiam  = 3.8 + 0.5;\nscrewDiam   = 2.5 + 0.5;\n  \n\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 100;\npcbWidth            = 100;\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 1.4;\nbasePlaneThickness  = 1.5;\nlidPlaneThickness   = 1.0;\n\n//-- Total height of box = basePlaneThickness + lidPlaneThickness \n//--                     + baseWallHeight + lidWallHeight\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 10;\nlidWallHeight       = 10;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 3.0;  //-> at least 1.8 * wallThickness\nridgeSlack          = 0.2;\nroundRadius         = 2.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 3.0;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\nstandoffDiameter    = 6;\n\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = false;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 5;        //-> from 1 to 32, Default = 8\nonLidGap            = 0;\nshiftLid            = 10;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\ncolorBase           = \"yellow\";\nalphaBase           = 0.8;//0.2;   \ncolorLid            = \"silver\";\nalphaLid            = 0.8;//0.2;   \nshowOrientation     = true;\nshowPCB             = true;\nshowSwitches        = true;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Base)\ninspectXfromBack    = false;     //-> View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = true;     //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx\n//    (1) = posy\n//   Optional:\n//    (2) = Height to bottom of PCB : Default = standoffHeight\n//    (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    (4) = standoffDiameter    Default = standoffDiameter;\n//    (5) = standoffPinDiameter Default = standoffPinDiameter;\n//    (6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    (7) = filletRadius (0 = auto size)\n//    (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    (n) = { yappHole, <yappPin> } // Baseplate support treatment\n//    (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    (n) = { yappCoordBox, <yappCoordPCB> }  \n//    (n) = { yappNoFillet }\n//-------------------------------------------------------------------\npcbStands =\n[\n  [5, 5]\n];\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase, cutoutsLid, cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//                      +-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be provided\n//\n//  Parameters:\n//   Required:\n//    (0) = from Back\n//    (1) = from Left\n//    (2) = width\n//    (3) = length\n//    (4) = radius\n//    (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    (7) = angle : Default = 0\n//    (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.\n//    (n) = { <yappCoordBox> | yappCoordPCB }\n//    (n) = { <yappOrigin>, yappCenter }\n//  (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top, Back and Right Faces\n//-------------------------------------------------------------------\ncutoutsBase =   \n[\n];\n\n// (0) = posy\n// (1) = posz\ncutoutsFront =  \n[\n//-- 0, 1,            2,             3, 4, 5\n    [3, 2, shellWidth-6, shellHeight-4, 2, yappRoundedRect]\n];\n\n// (0) = posy\n// (1) = posz\ncutoutsBack =   \n[\n//-- 0, 1,             2,             3, 4, 5\n    [5, 2, shellWidth-10, shellHeight-4, 3, yappRoundedRect]\n];\n\n\ncutoutsLeft =  \n[\n];\n\n\n\n//===================================================================\n//  *** Push Buttons ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = capLength \n//    p(3) = capWidth \n//    p(4) = capRadius \n//    p(5) = capAboveLid\n//    p(6) = switchHeight\n//    p(7) = switchTravel\n//    p(8) = poleDiameter\n//   Optional:\n//    p(9) = Height to top of PCB : Default = standoffHeight + pcbThickness\n//    p(10) = Shape  {yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey} : Default = yappRectangle\n//    p(11) = angle : Default = 0\n//    p(12) = filletRadius          : Default = 0/Auto \n//    p(13) = buttonWall            : Default = 2.0;\n//    p(14) = buttonPlateThickness  : Default= 2.5;\n//    p(15) = buttonSlack           : Default= 0.25;\n//    n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside } \n//    n(b) = { yappLeftOrigin, <yappGlobalOrigin> }\n//-------------------------------------------------------------------\npushButtons = \n[\n   [20,pcbWidth/2, \n    8, // Width\n    8, // Length\n    4, // Radius\n    0, // Cap above Lid\n    5, // Switch Height\n    0.5, // Switch travel\n    3, // Pole Diameter\n    undef, // Height to top of PCB\n    yappCircle, // Shape\n    yappNoFillet\n  ]\n  ,[20,pcbWidth/2-20, \n    8, // Width\n    8, // Length\n    4, // Radius\n    0, // Cap above Lid\n    5, // Switch Height\n    0.5, // Switch travel\n    3, // Pole Diameter\n    undef, // Height to top of PCB\n    yappCircle, // Shape\n    0,    \n    undef,\n    2.0, //buttonWall\n    2.5, // button plate thickness\n    0.5 // button slack\n  ]\n  ,[40,pcbWidth/2, \n    8, // Width\n    8, // Length\n    4, // Radius\n    0, // Cap above Lid\n    5, // Switch Height\n    0.5, // Switch travel\n    3, // Pole Diameter\n    undef, // Height to top of PCB\n    yappPolygon, // Shape\n    shapeArrow\n  ]\n  ,[40,pcbWidth/2-20, \n    8, // Width\n    8, // Length\n    4, // Radius\n    0, // Cap above Lid\n    5, // Switch Height\n    0.5, // Switch travel\n    3, // Pole Diameter\n    undef, // Height to top of PCB\n    yappPolygon, // Shape\n    90,    \n    shapeArrow\n  ]\n  ,[60,pcbWidth/2, \n    8, // Width\n    8, // Length\n    2, // Radius\n    -1, // Cap above Lid\n    6, // Switch Height\n    1, // Switch travel\n    3, // Pole Diameter\n    undef, // Height to top of PCB\n    yappRoundedRect // Shape\n  ]\n  ,[80,pcbWidth/2, \n    8, // Width\n    8, // Length\n    0, // Radius\n    1, // Cap above Lid\n    5, // Switch Height\n    0.5, // Switch travel\n    3, // Pole Diameter\n    undef, // Height to top of PCB\n    yappRectangle,  // Shape\n    0\n  ]\n\n];\n\n\n//========= MAIN CALL's ===========================================================\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Demo_buttons_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a YAPP_Test_buttons_v30 test box\n//\n//    Rendering takes ~ 11 minutes (renderQuality 10)\n//    Rendering takes ~  5 minutes (renderQuality 5)\n//\n//  Version 3.0 (01-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\n\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 30;\npcbWidth            = 40;\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.4;\nbasePlaneThickness  = 1.6;\nlidPlaneThickness   = 1.6;\n\n//-- Total height of box = basePlaneThickness + lidPlaneThickness \n//--                     + baseWallHeight + lidWallHeight\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 10;\nlidWallHeight       = 10;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;  //-> at least 1.8 * wallThickness\nridgeSlack          = 0.2;\nroundRadius         = 2.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 3.0;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\nstandoffDiameter    = 6;\n\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = false;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 5;        //-> from 1 to 32, Default = 8\nonLidGap            = 0;\nshiftLid            = 1;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\ncolorBase           = \"yellow\";\nalphaBase           = 0.8;//0.2;   \ncolorLid            = \"silver\";\nalphaLid            = 0.8;//0.2;   \nshowOrientation     = true;\nshowPCB             = true;\nshowSwitches        = true;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 18;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Base)\ninspectXfromBack    = false;     //-> View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = true;     //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx\n//    (1) = posy\n//   Optional:\n//    (2) = Height to bottom of PCB : Default = standoffHeight\n//    (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    (4) = standoffDiameter    Default = standoffDiameter;\n//    (5) = standoffPinDiameter Default = standoffPinDiameter;\n//    (6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    (7) = filletRadius (0 = auto size)\n//    (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    (n) = { yappHole, <yappPin> } // Baseplate support treatment\n//    (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    (n) = { yappCoordBox, <yappCoordPCB> }  \n//    (n) = { yappNoFillet }\n//-------------------------------------------------------------------\npcbStands =\n[\n        [5, 5, yappAllCorners] \n];\n                       \n\n//===================================================================\n//  *** Push Buttons ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = capLength \n//    p(3) = capWidth \n//    p(4) = capRadius \n//    p(5) = capAboveLid\n//    p(6) = switchHeight\n//    p(7) = switchTravel\n//    p(8) = poleDiameter\n//   Optional:\n//    p(9) = Height to top of PCB : Default = standoffHeight + pcbThickness\n//    p(10) = { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey } : Shape, Default = yappRectangle\n//    p(11) = angle : Default = 0\n//    p(12) = filletRadius          : Default = 0/Auto \n//    p(13) = buttonWall            : Default = 2.0;\n//    p(14) = buttonPlateThickness  : Default= 2.5;\n//    p(15) = buttonSlack           : Default= 0.25;\n//    p(16) = snapSlack             : Default= 0.10;\n//    n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside } \n//    n(b) = { <yappGlobalOrigin>,  yappLeftOrigin }\n//    n(c) = { yappNoFillet }\n//    n(d) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//-------------------------------------------------------------------\npushButtons = \n[\n //-- 0,  1, 2, 3, 4, 5,   6, 7,   8\n   [15, 10, 8, 6, 0, 3, 5.5, 1, 3.5, undef, yappRectangle]\n  ,[15, 30, 0, 0, 4, 0, 3,   1, 3.5, undef, yappCircle, undef, undef, undef, undef, 0.25, .2]\n];     \n             \n\n\n//========= MAIN CALL's ===========================================================\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n\n// Set standard view for Screen Shots\n$vpr = [80,0,104];\n$vpt = [-17, 15,8];\n$vpf = 22.5;\n$vpd = 102;\n\n"
  },
  {
    "path": "examples/YAPP_Demo_buttons_v31.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a YAPP_Test_buttons_v30 test box\n//\n//    Rendering takes ~ 11 minutes (renderQuality 10)\n//    Rendering takes ~  5 minutes (renderQuality 5)\n//\n//  Version 3.0 (01-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\n\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 30;\npcbWidth            = 40;\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.4;\nbasePlaneThickness  = 1.6;\nlidPlaneThickness   = 1.6;\n\n//-- Total height of box = basePlaneThickness + lidPlaneThickness \n//--                     + baseWallHeight + lidWallHeight\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 10;\nlidWallHeight       = 10;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;  //-> at least 1.8 * wallThickness\nridgeSlack          = 0.2;\nroundRadius         = 2.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 3.0;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\nstandoffDiameter    = 6;\n\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = true;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 5;        //-> from 1 to 32, Default = 8\nonLidGap            = 0;\nshiftLid            = 1;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\ncolorBase           = \"yellow\";\nalphaBase           = 0.8;//0.2;   \ncolorLid            = \"silver\";\nalphaLid            = 0.8;//0.2;   \nshowOrientation     = true;\nshowPCB             = true;\nshowSwitches        = true;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 18;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Base)\ninspectXfromBack    = false;     //-> View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = true;     //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx\n//    (1) = posy\n//   Optional:\n//    (2) = Height to bottom of PCB : Default = standoffHeight\n//    (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    (4) = standoffDiameter    Default = standoffDiameter;\n//    (5) = standoffPinDiameter Default = standoffPinDiameter;\n//    (6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    (7) = filletRadius (0 = auto size)\n//    (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    (n) = { yappHole, <yappPin> } // Baseplate support treatment\n//    (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    (n) = { yappCoordBox, <yappCoordPCB> }  \n//    (n) = { yappNoFillet }\n//-------------------------------------------------------------------\npcbStands =\n[\n  [5, 5, yappAllCorners] \n];\n                       \n//===================================================================\n//  *** Connectors ***\n//  Standoffs with hole through base and socket in lid for screw type connections.\n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//  \n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = StandHeight : From specified origin \n//    p(3) = screwDiameter\n//    p(4) = screwHeadDiameter (don't forget to add extra for the fillet)\n//    p(5) = insertDiameter\n//    p(6) = outsideDiameter\n//   Optional:\n//    p(7) = insert Depth : default to entire connector\n//    p(8) = PCB Gap : Default if yappCoordPCB then pcbThickness else 0\n//    p(9) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }\n//    n(b) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(c) = { yappNoFillet }\n//    n(d) = { yappCountersink }\n//    n(e) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//-------------------------------------------------------------------\n\nconnectors   = \n[ \n];\n\n//===================================================================\n//  *** Push Buttons ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = capLength \n//    p(3) = capWidth \n//    p(4) = capRadius \n//    p(5) = capAboveLid\n//    p(6) = switchHeight\n//    p(7) = switchTravel\n//    p(8) = poleDiameter\n//   Optional:\n//    p(9) = Height to top of PCB : Default = standoffHeight + pcbThickness\n//    p(10) = { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey } : Shape, Default = yappRectangle\n//    p(11) = angle : Default = 0\n//    p(12) = filletRadius          : Default = 0/Auto \n//    p(13) = buttonWall            : Default = 2.0;\n//    p(14) = buttonPlateThickness  : Default= 2.5;\n//    p(15) = buttonSlack           : Default= 0.25;\n//    p(16) = snapSlack             : Default= 0.10;\n//    n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside } \n//    n(b) = { <yappGlobalOrigin>,  yappLeftOrigin }\n//    n(c) = { yappNoFillet }\n//    n(d) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//-------------------------------------------------------------------\npushButtons = \n[\n //-- 0,  1, 2, 3, 4, 5,   6, 7,   8\n   [15, 14, 8, 6, 0, 3, 5.5, 1, 3.5, undef, yappRectangle]\n  ,[15, 28, 0, 0, 4, 0, 3,   1, 3.5, undef, yappCircle, undef, undef, undef, undef, 0.25, .2]\n];     \n             \n\n\n//========= MAIN CALL's ===========================================================\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n\n// Set standard view for Screen Shots\n\n$vpr = [80,0,104];\n$vpt = [-17, 15,8];\n$vpf = 22.5;\n$vpd = 102;\n\n"
  },
  {
    "path": "examples/YAPP_Demo_connectors_v33.scad",
    "content": "/*\n***************************************************************************  \n**  Yet Another Parameterised Projectbox generator\n**\n**  Copyright (c) 2021, 2022, 2023, 2024, 2025 Willem Aandewiel\n**\n**  With help from:\n**   - Keith Hadley (parameterized label depth)\n**   - Oliver Grafe (connectorsPCB)\n**   - Juan Jose Chong (dynamic standoff flange)\n**   - Dan Drum (cleanup code)\n**   - Dave Rosenhauer (fillets and a lot more)\n**\n**\n**  for many or complex cutouts you might need to adjust\n**  the number of elements:\n**\n**      Preferences->Advanced->Turn of rendering at 250000 elements\n**                                                  ^^^^^^\n**\n**  TERMS OF USE: MIT License. See base offile.\n***************************************************************************      \n*/\n\ninclude <../YAPPgenerator_v3.scad>\n//printMessages = debug;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 150; // Front to back\npcbWidth            = 150; // Side to side\npcbThickness        = 1.6;\n\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n// -- Render --\nrenderQuality             = 8;          //-> from 1 to 32, Default = 8\n\n// --Preview --\npreviewQuality            = 5;          //-> from 1 to 32, Default = 5\nshowSideBySide            = true;       //-> Default = true\nonLidGap                  = 0.05;  // tip don't override to animate the lid opening\n//onLidGap                  = ((ridgeHeight) - (ridgeHeight * abs(($t-0.5)*2)))*2;  // tip don't override to animate the lid opening/closing\ncolorLid                  = \"YellowGreen\";   \nalphaLid                  = 1;\ncolorBase                 = \"BurlyWood\";\nalphaBase                 = 1;\nhideLidWalls              = false;      // Remove the walls from the lid : only if preview and showSideBySide=true \nhideBaseWalls             = false;      // Remove the walls from the base : only if preview and showSideBySide=true  \nshowOrientation           = true;       // Show the Front/Back/Left/Right labels : only in preview\nshowPCB                   = false;      // Show the PCB in red : only in preview \nshowSwitches              = false;      // Show the switches (for pushbuttons) : only in preview \nshowButtonsDepressed      = false;       // Should the buttons in the Lid On view be in the pressed position\nshowOriginCoordBox        = false;      // Shows red bars representing the origin for yappCoordBox : only in preview \nshowOriginCoordBoxInside  = false;      // Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowOriginCoordPCB        = false;      // Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowMarkersPCB            = false;      // Shows black bars corners of the PCB : only in preview \nshowMarkersCenter         = false;      // Shows magenta bars along the centers of all faces  \n// For this Demo cut at 5 to see profile of corner connections and 8 for others\ninspectX                  = 5;          //-> 0=none (>0 from Back)\ninspectY                  = 0;          //-> 0=none (>0 from Right)\ninspectZ                  = 0;          //-> 0=none (>0 from Bottom)\ninspectXfromBack          = true;       //-> View from the inspection cut foreward\ninspectYfromLeft          = true;       //-> View from the inspection cut to the right\ninspectZfromBottom        = true;       //-> View from the inspection cut up\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//   Optional:\n//    p(2) = Height to bottom of PCB : Default = standoffHeight\n//    p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    p(4) = standoffDiameter    Default = standoffDiameter;\n//    p(5) = standoffPinDiameter Default = standoffPinDiameter;\n//    p(6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    p(7) = filletRadius (0 = auto size)\n//    p(8) = Pin Length : Default = 0 -> PCB Gap + standoff_PinDiameter\n//             Indicated length of pin without the half sphere tip. \n//             Example : pcbThickness() only leaves the half sphere tip above the PCB\n//    n(a) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    n(b) = { <yappPin>, yappHole, yappTopPin } \n//             yappPin = Pin on Base and Hole on Lid \n//             yappHole = Hole on Both\n//             yappTopPin = Hole on Base and Pin on Lid\n//    n(c) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { yappNoFillet } : Removes the internal and external fillets and the Rounded tip on the pins\n//    n(f) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(g) = yappSelfThreading : make the hole a self threading hole \n//             This ignores the holeSlack and would only be usefull \n//             if the opposing stand if deleted see sample in Demo_Connectors\n//-------------------------------------------------------------------\n/*\npcbStands = \n[\n  [ // Sample PCB Stand that only has the base part and a self threading hole for a screw mounted PCB\n      5, // p(0) = posx\n      5, // p(1) = posy\n//   Optional:\n      12,// p(2) = Height to bottom of PCB : Default = standoffHeight\n      undef, //    p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n      6, // p(4) = standoffDiameter    Default = standoffDiameter;\n      3, // p(5) = standoffPinDiameter Default = standoffPinDiameter;\n      undef, //    p(6) = standoffHoleSlack   Default = standoffHoleSlack;\n      undef, // p(7) = filletRadius (0 = auto size)\n      undef, //    p(8) = Pin Length : Default = 0 -> PCB Gap + standoff_PinDiameter\n      yappAllCorners,\n      yappTopPin,\n      yappBaseOnly,\n      yappSelfThreading,\n  ],\n];\n*/\n\n//===================================================================\n//  *** Connectors ***\n//  Standoffs with hole through base and socket in lid for screw type connections.\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB : pcb[0,0,0]\n//  \n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = StandHeight : From specified origin \n//    p(3) = screwDiameter\n//    p(4) = screwHeadDiameter (don't forget to add extra for the fillet or specify yappNoInternalFillet)\n//    p(5) = insertDiameter\n//    p(6) = outsideDiameter\n//   Optional:\n//    p(7) = insert Depth : default to entire connector\n//    p(8) = PCB Gap : Default if yappCoordPCB then pcbThickness else 0\n//    p(9) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }\n//    n(b) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(c) = { yappNoFillet } : Don't add fillets\n//    n(d) = { yappCountersink }\n//    n(e) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(f) = { yappThroughLid = changes the screwhole to the lid and the socket to the base}\n//    n(g) = {yappSelfThreading} : Make the insert self threading specify the Screw Diameter in the insertDiameter\n//    n(h) = { yappNoInternalFillet } : Don't add internal fillets (external fillets can still be added)\n\n//-------------------------------------------------------------------\nconnectors   =\n[\n  [2, 2, \n    10, // Stand Height\n    4.0,// screwDiameter\n    7.5,// screwHeadDiameter\n    4.0,//insertDiameter\n    10.5,//outsideDiameter \n    undef, //insert Depth\n    0.0, //PCB Gap\n    yappAllCorners, yappSelfThreading, yappThroughLid, yappNoInternalFillet,yappCoordBoxInside],\n    \n//  [ 10, 10, 4, 3, 5, 4, 7, yappAllCorners], // All of the corners of the PCB inset 10,10\n//  [ 8, 8, 4, 3, 5, 6, 7, yappCoordBox], //Defaults to yappBackLeft of yappCoordBox\n//  [ 8-wallThickness, 28, 4, 3, 5, 4, 7, 5, 1.6, yappBackLeft, yappCoordBoxInside], // Shifted so that they all aligh for inspection cut\n//  [ 8-pcbX(), 48, 4, 3, 5, 4, 7, 16, yappBackLeft], // Shifted so that they all aligh for inspection cut\n  [ 8, 38, 14, 3, 5, 4, 7, 6, yappBackLeft, yappCoordBox, yappThroughLid, yappNoInternalFillet], // Shifted so that they all aligh for inspection cut\n  [ 8, 53, 14, 3.2, 5, 3, 7, undef, yappBackLeft, yappCoordBox, yappThroughLid, yappSelfThreading], // Shifted so that they all aligh for inspection cut\n  [ 8, 68, 14, 3, 5, 4, 7, 6, yappBackLeft, yappCoordBox, yappNoInternalFillet], // Shifted so that they all aligh for inspection cut\n  [ 8, 83, 14, 3, 5, 4, 7, 6, yappBackLeft, yappCoordBox, yappSelfThreading], // Shifted so that they all aligh for inspection cut\n  \n  // Full height connector (1.6 = basPlaneThickness)\n  // 3.2mm Opening in the base with no screwhead recess\n  // 3.0mm Self Taping hole instead of insert\n  [ 8, 98, 10, 3.2, 5, 3, 7, undef, 0,  yappBackLeft, yappCoordBox, yappNoInternalFillet, yappSelfThreading], \n  \n  // Full height connector (1.6 = basPlaneThickness)\n  // 3.2mm Opening in the base with no screwhead recess\n  // 3.0mm Self Taping hole instead of insert\n  [ 8, 113, 10, 3.2, 5, 3, 7, undef, 0,  yappBackLeft, yappCoordBox, yappNoInternalFillet, yappSelfThreading\n  , yappCountersink], \n  \n  \n];\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Demo_cutout_yappRing_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0.5 (03-26-2024)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = false;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 150; // Front to back\npcbWidth            = 100; // Side to side\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 41;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 1.25;\nlidPlaneThickness   = 1.25;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 25;\nlidWallHeight       = 23;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.2;\nroundRadius         = 2.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 10.0;  //-- used only for pushButton and showPCB\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\nstandoffDiameter    = 8;\n\n\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = true;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 6;        //-> from 1 to 32, Default = 8\nonLidGap            = 2;\nshiftLid            = 5;\ncolorLid            = \"gray\";   \nalphaLid            = 1;//0.2;   \ncolorBase           = \"yellow\";\nalphaBase           = 1;//0.2;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\nshowOrientation     = true;\nshowPCB             = false;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack    = true;     // View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = false;    //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//                        Required                Not Used        Note\n//----------------------+-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be\n//                      |                       |               | provided\n//  yappRing            | width, length, radius |               | radius = outer radius, \n//                      |                       |               | length = inner radius\n//                      |                       |               | width = connection between rings\n//                      |                       |               |   0 = No connectors\n//                      |                       |               |   positive = 2 connectors\n//                      |                       |               |   negative = 4 connectors\n//----------------------+-----------------------+---------------+------------------------------------\n//\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey }\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces\n//    n(g) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(h) = { yappFromInside } Make the cut from the inside towards the outside\n//-------------------------------------------------------------------\n\ncutoutsBase = \n[\n];\n\ncutoutsLid  = \n[\n [20,20, 0, 10, 20, yappRing, yappCenter]\n ,[70,20, 5, 10, 20, yappRing, yappDefault, 0, yappCenter]\n ,[120,20, -5, 10, 20, yappRing, yappDefault, 45, yappCenter]\n];\n\ncutoutsFront = \n[\n];  \n\n\ncutoutsBack = \n[\n];\n\n\ncutoutsLeft = \n[\n];\n\ncutoutsRight = \n[\n];\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Demo_cutout_yappRing_v31.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0.5 (03-26-2024)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = false;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 150; // Front to back\npcbWidth            = 100; // Side to side\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 41;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 1.25;\nlidPlaneThickness   = 1.25;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 25;\nlidWallHeight       = 23;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.2;\nroundRadius         = 2.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 10.0;  //-- used only for pushButton and showPCB\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\nstandoffDiameter    = 8;\n\n\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = true;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 6;        //-> from 1 to 32, Default = 8\nonLidGap            = 2;\nshiftLid            = 5;\ncolorLid            = \"gray\";   \nalphaLid            = 1;//0.2;   \ncolorBase           = \"yellow\";\nalphaBase           = 1;//0.2;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\nshowOrientation     = true;\nshowPCB             = false;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack    = true;     // View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = false;    //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//                        Required                Not Used        Note\n//----------------------+-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be\n//                      |                       |               | provided\n//  yappRing            | width, length, radius |               | radius = outer radius, \n//                      |                       |               | length = inner radius\n//                      |                       |               | width = connection between rings\n//                      |                       |               |   0 = No connectors\n//                      |                       |               |   positive = 2 connectors\n//                      |                       |               |   negative = 4 connectors\n//----------------------+-----------------------+---------------+------------------------------------\n//\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey }\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces\n//    n(g) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(h) = { yappFromInside } Make the cut from the inside towards the outside\n//-------------------------------------------------------------------\n\ncutoutsBase = \n[\n];\n\ncutoutsLid  = \n[\n [20,20, 0, 10, 20, yappRing, yappCenter]\n ,[70,20, 5, 10, 20, yappRing, yappDefault, 0, yappCenter]\n ,[120,20, -5, 10, 20, yappRing, yappDefault, 45, yappCenter]\n];\n\ncutoutsFront = \n[\n];  \n\n\ncutoutsBack = \n[\n];\n\n\ncutoutsLeft = \n[\n];\n\ncutoutsRight = \n[\n];\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Demo_cutout_yappSphere_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0.5 (03-26-2024)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\nprintDisplayClips     = true;\n\n//-- padding between pcb and inside wall\npaddingFront        = 10;\npaddingBack         = 10;\npaddingRight        = 10;\npaddingLeft         = 10;\n\n// ********************************************************************\n// The Following will be used as the first element in the pbc array\n\n//Defined here so you can define the \"Main\" PCB using these if wanted\npcbLength           = 1; // front to back (X axis)\npcbWidth            = 1; // side to side (Y axis)\npcbThickness        = 1.6;\nstandoffHeight      = 25-16.5;// 1.0;  //-- How much the PCB needs to be raised from the base to leave room for solderings \nstandoffDiameter    = 7;\nstandoffPinDiameter = 3.0;\nstandoffHoleSlack   = 0.2;\n\n//===================================================================\n// *** PCBs ***\n// Printed Circuit Boards\n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : yappCoordBoxInside[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = name\n//    p(1) = length\n//    p(2) = width\n//    p(3) = posx\n//    p(4) = posy\n//    p(5) = Thickness\n//    p(6) = standoff_Height\n//    p(7) = standoff_Diameter\n//    p(8) = standoff_PinDiameter\n//   Optional:\n//    p(9) = standoff_HoleSlack (default to 0.4)\n\n//The following can be used to get PCB values. If \"PCB Name\" is omitted then \"Main\" is used\n//  pcbLength           --> pcbLength(\"PCB Name\")\n//  pcbWidth            --> pcbWidth(\"PCB Name\")\n//  pcbThickness        --> pcbThickness(\"PCB Name\") \n//  standoffHeight      --> standoffHeight(\"PCB Name\") \n//  standoffDiameter    --> standoffDiameter(\"PCB Name\") \n//  standoffPinDiameter --> standoffPinDiameter(\"PCB Name\") \n//  standoffHoleSlack   --> standoffHoleSlack(\"PCB Name\") \n\npcb = \n[\n  //-- Default Main PCB - DO NOT REMOVE the \"Main\" line.\n  [\"Main\",              \n    pcbLength,pcbWidth,    \n    0,0,    \n    pcbThickness,  \n    standoffHeight, \n    standoffDiameter, \n    standoffPinDiameter, \n    standoffHoleSlack]\n ,[\"Joystick\",\n    26,34,        //Length, Width\n    0, //xPos\n    0, // yPos  \n    1.6,          //pcbThickness\n    -16, //25-17.5,      //standoffHeight  // BoxInsideHeight - 17.5 (16-pcbthickness)\n  //  25-17.5,      //standoffHeight  // BoxInsideHeight - 17.5 (16-pcbthickness)\n    7,            //standoffDiameter\n    3.0           //standoffPinDiameter\n  ]\n];\n\n//-------------------------------------------------------------------\n\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 1.25;\nlidPlaneThickness   = 1.25;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 10;\nlidWallHeight       = 15;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.2;\nroundRadius         = 2.0;\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = true;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 6;        //-> from 1 to 32, Default = 8\nonLidGap            = 0;\nshiftLid            = 5;\ncolorLid            = \"gray\";   \nalphaLid            = 1;//0.2;   \ncolorBase           = \"yellow\";\nalphaBase           = 1;//0.2;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\nshowOrientation     = true;\nshowPCB             = true;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack    = true;     // View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = false;    //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//   Optional:\n//    p(2) = Height to bottom of PCB : Default = standoffHeight\n//    p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    p(4) = standoffDiameter    Default = standoffDiameter;\n//    p(5) = standoffPinDiameter Default = standoffPinDiameter;\n//    p(6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    p(7) = filletRadius (0 = auto size)\n//    p(8) = Pin Length : Default = 0 -> PCB Gap + standoff_PinDiameter\n//             Indicated length of pin without the half sphere tip. \n//             Example : pcbThickness() only leaves the half sphere tip above the PCB\n//    n(a) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    n(b) = { <yappPin>, yappHole, yappTopPin } \n//             yappPin = Pin on Base and Hole on Lid \n//             yappHole = Hole on Both\n//             yappTopPin = Hole on Base and Pin on Lid\n//    n(c) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { yappNoFillet } : Removes the internal and external fillets and the Rounded tip on the pins\n//    n(f) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//-------------------------------------------------------------------\npcbStands = \n[\n//  [2.75, 3.5, yappFrontLeft, yappFrontRight, yappTopPin],\n//  [5.3, 3.5, yappBackLeft, yappBackRight, yappTopPin],\n  [3.5, 2.75, yappFrontLeft, yappBackLeft, yappTopPin, [yappPCBName, \"Joystick\"]],\n  [3.5, 5.3, yappFrontRight, yappBackRight, yappTopPin, [yappPCBName, \"Joystick\"]],\n];\n\n\n\n//===================================================================\n//  *** Connectors ***\n//  Standoffs with hole through base and socket in lid for screw type connections.\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB : pcb[0,0,0]\n//  \n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = StandHeight : From specified origin \n//    p(3) = screwDiameter\n//    p(4) = screwHeadDiameter (don't forget to add extra for the fillet)\n//    p(5) = insertDiameter\n//    p(6) = outsideDiameter\n//   Optional:\n//    p(7) = insert Depth : default to entire connector\n//    p(8) = PCB Gap : Default if yappCoordPCB then pcbThickness else 0\n//    p(9) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }\n//    n(b) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(c) = { yappNoFillet }\n//    n(d) = { yappCountersink }\n//    n(e) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(f) = { yappThroughLid = changes the screwhole to the lid and the socket to the base}\n//-------------------------------------------------------------------\nconnectors   =\n[\n];\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//                        Required                Not Used        Note\n//----------------------+-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be\n//                      |                       |               | provided\n//  yappRing            | width, length, radius |               | radius = outer radius, \n//                      |                       |               | length = inner radius\n//                      |                       |               | width = connection between rings\n//                      |                       |               |   0 = No connectors\n//                      |                       |               |   positive = 2 connectors\n//                      |                       |               |   negative = 4 connectors\n//  yappSphere          | width, radius         |               | Width = Sphere center distance from\n//                      |                       |               |   center of depth.  negative = below\n//                      |                       |               | radius = sphere radius\n//----------------------+-----------------------+---------------+------------------------------------\n//\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey | yappSphere }\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappAltOrigin } // Only affects Top(lid), Back and Right Faces\n//    n(g) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(h) = { yappFromInside } Make the cut from the inside towards the outside\n//-------------------------------------------------------------------\n\ncutoutsBase = \n[\n];\n\ncutoutsLid  = \n[\n\n  //Spherical cutout for Joystick\n  [\n    pcbLength(\"Joystick\") - 12.25, //pcbLength(\"Joystick\")/2, //xPos\n    pcbWidth(\"Joystick\")/2, // yPos\n    10-7 + (-lidPlaneThickness/2), // Shift offset in Z to the inside of the lid - offset needed\n    undef, //    p(3) = length\n    14.5, //    Joystick Hat radius\n    yappSphere, //    p(5) = shape \n    20+lidPlaneThickness, //5 // depth\n    //yappCoordBox,\n    yappCenter,\n    [yappPCBName, \"Joystick\"], \n  ]\n\n\n\n// [20,20, 0, 10, 20, yappRing, yappCenter]\n// ,[70,20, 5, 10, 20, yappRing, yappDefault, 0, yappCenter]\n// ,[120,20, -5, 10, 20, yappRing, yappDefault, 45, yappCenter]\n];\n\ncutoutsFront = \n[\n];  \n\n\ncutoutsBack = \n[\n];\n\n\ncutoutsLeft = \n[\n];\n\ncutoutsRight = \n[\n  [pcbLength(\"Joystick\")/2,  //    p(0) = from Back\n    4,//    p(1) = from Left (height)\n    13.5,//    p(2) = width\n    2.5,//    p(3) = length\n    undef, //    p(4) = radius\n    yappRectangle,//    p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n    yappCenter,\n    [yappPCBName, \"Joystick\"], \n  ],\n];\n\n//===================================================================\n//  *** Snap Joins ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx | posy\n//    (1) = width\n//    (n) = yappLeft / yappRight / yappFront / yappBack (one or more)\n//   Optional:\n//    (n) = { <yappOrigin> | yappCenter }\n//    (n) = { yappSymmetric }\n//    (n) = { yappRectangle } == Make a diamond shape snap\n//-------------------------------------------------------------------\n\nsnapJoins =   \n[\n // [(shellWidth/2),     10, yappFront, yappCenter],\n [(shellWidth/2),     6, yappFront, yappBack, yappCenter],\n];\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Demo_cutouts_all_coord_systems_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0 (01-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 100; // Front to back\npcbWidth            =  80; // Side to side\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 10;\npaddingBack         = 10;\npaddingRight        = 30;\npaddingLeft         = 40;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 1.25;\nlidPlaneThickness   = 1.25;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 25;\nlidWallHeight       = 23;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.2;\nroundRadius         = 2.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 10.0;  //-- used only for pushButton and showPCB\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\nstandoffDiameter    = 8;\n\n\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = false;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 8;        //-> from 1 to 32, Default = 8\nonLidGap            = 2;\nshiftLid            = 5;\ncolorLid            = \"Yellow\";   \nalphaLid            = 1;//0.2;   \ncolorBase           = \"silver\";\nalphaBase           = 1;//0.2;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\nshowOrientation     = true;\nshowPCB             = false;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack    = true;     // View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = false;    //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n\n\n\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase, cutoutsLid, cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//                      +-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be provided\n//\n//  Parameters:\n//   Required:\n//    (0) = from Back\n//    (1) = from Left\n//    (2) = width\n//    (3) = length\n//    (4) = radius\n//    (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    (7) = angle : Default = 0\n//    (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.\n//    (n) = { <yappCoordBox> | yappCoordPCB }\n//    (n) = { <yappOrigin> | yappCenter }\n//  (n) = { yappLeftOrigin | <yappGlobalOrigin> } // Only affects Top, Back and Right Faces\n//-------------------------------------------------------------------\n\ncutoutsBase = \n[\n //--  0,  1,  2,  3, 4, n\n  // All 4 Coordinate combinations of (yappOrigin | yappCenter) and  (yappCoordBox | yappCoordPCB)\n  [25,15, 20, 10,  2, yappRoundedRect]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCoordPCB]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter, yappCoordPCB]\n];\n\ncutoutsLid  = \n[\n //--  0,  1,  2,  3, 4, n\n  // All 8 Coordinate combinations of (yappOrigin | yappCenter) and  (yappCoordBox | yappCoordPCB) and (yappLeftOrigin |yappGlobalOrigin)\n  [25,15, 20, 10,  2, yappRoundedRect, yappCenter]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter, yappCoordPCB]\n ,[25,15, 20, 12,  2, yappRoundedRect, yappCenter, yappCoordPCB, yappLeftOrigin]\n ,[25,15, 20, 12,  2, yappRoundedRect, yappCenter, yappLeftOrigin]\n ,[25,15, 20, 14,  2, yappRoundedRect]\n ,[25,15, 20, 14,  2, yappRoundedRect, yappCoordPCB]\n ,[25,15, 20, 16,  2, yappRoundedRect, yappCoordPCB, yappLeftOrigin]\n ,[25,15, 20, 16,  2, yappRoundedRect, yappLeftOrigin]\n];\n\ncutoutsFront = \n[\n  // All 4 Coordinate combinations of (yappOrigin | yappCenter) and  (yappCoordBox | yappCoordPCB)\n  [25,15, 20, 10,  2, yappRoundedRect]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCoordPCB]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter, yappCoordPCB]\n];  \n\n\ncutoutsBack = \n[\n  // All 8 Coordinate combinations\n  [25,15, 20, 10,  2, yappRoundedRect, yappCenter]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter, yappCoordPCB]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter, yappCoordPCB, yappLeftOrigin]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter, yappLeftOrigin]\n ,[25,15, 20, 10,  2, yappRoundedRect]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCoordPCB]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCoordPCB, yappLeftOrigin]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappLeftOrigin]\n];\n\n\ncutoutsLeft = \n[\n //--  0,  1,  2,  3, 4, n\n  // All 4 Coordinate combinations of (yappOrigin | yappCenter) and  (yappCoordBox | yappCoordPCB)\n  [25,15, 20, 10,  2, yappRoundedRect]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCoordPCB]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter, yappCoordPCB]\n];\n\ncutoutsRight = \n[\n  // All 8 Coordinate combinations\n  [25,15, 20, 10,  2, yappRoundedRect, yappCenter]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter, yappCoordPCB]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter, yappCoordPCB, yappLeftOrigin]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter, yappLeftOrigin]\n ,[25,15, 20, 10,  2, yappRoundedRect]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCoordPCB]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCoordPCB, yappLeftOrigin]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappLeftOrigin]\n];\n\n\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Demo_cutouts_all_coord_systems_v31.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0 (01-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 100; // Front to back\npcbWidth            =  80; // Side to side\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 10;\npaddingBack         = 10;\npaddingRight        = 30;\npaddingLeft         = 40;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 1.25;\nlidPlaneThickness   = 1.25;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 25;\nlidWallHeight       = 23;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.2;\nroundRadius         = 2.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 10.0;  //-- used only for pushButton and showPCB\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\nstandoffDiameter    = 8;\n\n\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = false;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 8;        //-> from 1 to 32, Default = 8\nonLidGap            = 2;\nshiftLid            = 5;\ncolorLid            = \"Yellow\";   \nalphaLid            = 1;//0.2;   \ncolorBase           = \"silver\";\nalphaBase           = 1;//0.2;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\nshowOrientation     = true;\nshowPCB             = false;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack    = true;     // View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = false;    //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n\n\n\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase, cutoutsLid, cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//                      +-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be provided\n//\n//  Parameters:\n//   Required:\n//    (0) = from Back\n//    (1) = from Left\n//    (2) = width\n//    (3) = length\n//    (4) = radius\n//    (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    (7) = angle : Default = 0\n//    (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.\n//    (n) = { <yappCoordBox> | yappCoordPCB }\n//    (n) = { <yappOrigin> | yappCenter }\n//  (n) = { yappAltOrigin | <yappGlobalOrigin> } // Only affects Top, Back and Right Faces\n//-------------------------------------------------------------------\n\ncutoutsBase = \n[\n //--  0,  1,  2,  3, 4, n\n  // All 4 Coordinate combinations of (yappOrigin | yappCenter) and  (yappCoordBox | yappCoordPCB)\n  [25,15, 20, 10,  2, yappRoundedRect]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCoordPCB]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter, yappCoordPCB]\n];\n\ncutoutsLid  = \n[\n //--  0,  1,  2,  3, 4, n\n  // All 8 Coordinate combinations of (yappOrigin | yappCenter) and  (yappCoordBox | yappCoordPCB) and (yappAltOrigin |yappGlobalOrigin)\n  [25,15, 20, 10,  2, yappRoundedRect, yappCenter]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter, yappCoordPCB]\n ,[25,15, 20, 12,  2, yappRoundedRect, yappCenter, yappCoordPCB, yappAltOrigin]\n ,[25,15, 20, 12,  2, yappRoundedRect, yappCenter, yappAltOrigin]\n ,[25,15, 20, 14,  2, yappRoundedRect]\n ,[25,15, 20, 14,  2, yappRoundedRect, yappCoordPCB]\n ,[25,15, 20, 16,  2, yappRoundedRect, yappCoordPCB, yappAltOrigin]\n ,[25,15, 20, 16,  2, yappRoundedRect, yappAltOrigin]\n];\n\ncutoutsFront = \n[\n  // All 4 Coordinate combinations of (yappOrigin | yappCenter) and  (yappCoordBox | yappCoordPCB)\n  [25,15, 20, 10,  2, yappRoundedRect]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCoordPCB]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter, yappCoordPCB]\n];  \n\n\ncutoutsBack = \n[\n  // All 8 Coordinate combinations\n  [25,15, 20, 10,  2, yappRoundedRect, yappCenter]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter, yappCoordPCB]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter, yappCoordPCB, yappAltOrigin]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter, yappAltOrigin]\n ,[25,15, 20, 10,  2, yappRoundedRect]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCoordPCB]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCoordPCB, yappAltOrigin]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappAltOrigin]\n];\n\n\ncutoutsLeft = \n[\n //--  0,  1,  2,  3, 4, n\n  // All 4 Coordinate combinations of (yappOrigin | yappCenter) and  (yappCoordBox | yappCoordPCB)\n  [25,15, 20, 10,  2, yappRoundedRect]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCoordPCB]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter, yappCoordPCB]\n];\n\ncutoutsRight = \n[\n  // All 8 Coordinate combinations\n  [25,15, 20, 10,  2, yappRoundedRect, yappCenter]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter, yappCoordPCB]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter, yappCoordPCB, yappAltOrigin]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCenter, yappAltOrigin]\n ,[25,15, 20, 10,  2, yappRoundedRect]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCoordPCB]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappCoordPCB, yappAltOrigin]\n ,[25,15, 20, 10,  2, yappRoundedRect, yappAltOrigin]\n];\n\n\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Demo_cutouts_masks_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//    Version v3.3.1 (2025-01-09)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = false;\n\nprintMessages = true;\n//-- pcb dimensions -- very important!!!\npcbLength           = 150; // Front to back\npcbWidth            = 100; // Side to side\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 41;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 1.25;\nlidPlaneThickness   = 1.25;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 25;\nlidWallHeight       = 23;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.2;\nroundRadius         = 2.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 10.0;  //-- used only for pushButton and showPCB\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\nstandoffDiameter    = 8;\n\n\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = true;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 6;        //-> from 1 to 32, Default = 8\nonLidGap            = 2;\nshiftLid            = 5;\ncolorLid            = \"gray\";   \nalphaLid            = 1;//0.2;   \ncolorBase           = \"yellow\";\nalphaBase           = 1;//0.2;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\nshowOrientation     = true;\nshowPCB             = true;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack    = true;     // View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = false;    //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n\n\n//  *** Masks ***\n//------------------------------------------------------------------\n//  Parameters:\n//    maskName = [yappMaskDef,[\n//     p(0) = Grid pattern :{ yappPatternSquareGrid, yappPatternHexGrid }  \n//     p(1) = horizontal Repeat : if yappPatternSquareGrid then 0 = no repeat one \n//                                shape per column, if yappPatternHexGrid 0 is not valid\n//     p(2) = vertical Repeat :   if yappPatternSquareGrid then 0 = no repeat one shape \n//                                per row, if yappPatternHexGrid 0 is not valid\n//     p(3) = grid rotation\n//     p(4) = openingShape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect}\n//     p(5) = openingWidth, :  if yappPatternSquareGrid then 0 = no repeat one shape per \n//                             column, if yappPatternHexGrid 0 is not valid\n//     p(6) = openingLength,   if yappPatternSquareGrid then 0 = no repeat one shape per \n//                             row, if yappPatternHexGrid 0 is not valid\n//     p(7) = openingRadius\n//     p(8) = openingRotation\n//     p(9) = shape polygon : Required if openingShape = yappPolygon\n//   ]];\n//------------------------------------------------------------------\n\n// Custom Mask definition\nmaskCustom1 = [yappMaskDef, \n  [\n    yappPatternSquareGrid,// pattern\n    10,                   // hRepeat\n    10,                   // vRepeat\n    0,                    // rotation\n    yappCircle,           // openingShape\n    0,                    // openingWidth, \n    0,                    // openingLength, \n    1,                    // openingRadius\n    0,                    // openingRotation\n   ]\n];\n\n\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//                      +-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth \n//                      |                       |               |  (negative indicates outside of circle)\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be provided\n//\n//\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey }\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappAltOrigin } // Only affects Top(lid), Back and Right Faces\n//    n(g) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(h) = { yappFromInside } Make the cut from the inside towards the outside\n//-------------------------------------------------------------------\n\ncutoutsBase = \n[\n   [ 40, 30, 50, 50, 10, yappPolygon, shapeHexagon, maskHoneycomb, yappCenter], // Unshifted mask\n   [ 70, 70, 50, 50, 10, yappPolygon, shapeHexagon, [maskHoneycomb,0,3.3], yappCenter], // shifted to align the openings nicer\n   \n   [ 130, 50, 50, 50, 10, yappRectangle, maskCustom1, yappCenter], // Custom Mask defined above.\n\n];\n\ncutoutsLid  = \n[\n];\n\ncutoutsFront = \n[\n];  \n\ncutoutsBack = \n[\n];\n\ncutoutsLeft = \n[\n];\n\ncutoutsRight = \n[\n];\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Demo_cutouts_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//    Version v3.3.1 (2025-01-09)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = false;\n\nprintMessages = true;\n//-- pcb dimensions -- very important!!!\npcbLength           = 150; // Front to back\npcbWidth            = 100; // Side to side\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 41;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 1.25;\nlidPlaneThickness   = 1.25;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 25;\nlidWallHeight       = 23;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.2;\nroundRadius         = 2.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 10.0;  //-- used only for pushButton and showPCB\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\nstandoffDiameter    = 8;\n\n\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = true;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 6;        //-> from 1 to 32, Default = 8\nonLidGap            = 2;\nshiftLid            = 5;\ncolorLid            = \"gray\";   \nalphaLid            = 1;//0.2;   \ncolorBase           = \"yellow\";\nalphaBase           = 1;//0.2;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\nshowOrientation     = true;\nshowPCB             = true;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack    = true;     // View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = false;    //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n\n\n//===================================================================\n//   *** PCB Supports ***\n//   Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx\n//    (1) = posy\n//   Optional:\n//    (2) = Height to bottom of PCB : Default = standoffHeight\n//    (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    (4) = standoffDiameter    Default = standoffDiameter;\n//    (5) = standoffPinDiameter Default = standoffPinDiameter;\n//    (6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    (7) = filletRadius (0 = auto size)\n//    (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    (n) = { yappHole, <yappPin> } // Baseplate support treatment\n//    (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    (n) = { yappCoordBox, <yappCoordPCB> }  \n//    (n) = { yappNoFillet }\n//-------------------------------------------------------------------\npcbStands = [\n  //[5, 5, yappHole]\n];\n\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//                      +-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth \n//                      |                       |               |  (negative indicates outside of circle)\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be provided\n//\n//\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey }\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappAltOrigin } // Only affects Top(lid), Back and Right Faces\n//    n(g) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(h) = { yappFromInside } Make the cut from the inside towards the outside\n//-------------------------------------------------------------------\n\ncutoutsBase = \n[\n//   [120, 40, 30, 30, 10, yappPolygon, shape6ptStar],\n//   [ 60, 55, 50, 50, 10, yappPolygon, shapeHexagon, [maskHoneycomb,0,3.3], yappCenter],\n//   [115, 95, 20, 30, 10, yappCircle, 10],\n//   [140, 90, 20, 30,  1, yappRectangle, 10],\n//   [165, 90, 20, 30,  3, yappRoundedRect, 10],\n];\n\ncutoutsLid  = \n[\n//   [ 25, 70, 15, 25, 0, yappRectangle, undef, 30, yappCenter],\n//   [ 25, 30, 15, 25, 0, yappRectangle, yappCenter],\n//   [ 50, 70, 15, 25, 5, yappRoundedRect, undef, 30, yappCenter],\n//   [ 50, 30, 15, 25, 5, yappRoundedRect, yappCenter],\n//   [ 75, 30,  0,  0, 8, yappCircle, yappCenter],\n//   [100, 70, 12,  0, 8, yappCircleWithFlats, undef, 30, yappCenter],\n//   [100, 30, 12,  0, 8, yappCircleWithFlats, yappCenter],\n   [125, 70,  6, -4, 8, yappCircleWithKey, undef, 0, yappCenter], // External key of height 4\n   [125, 50,  6,  0, 8, yappCircleWithKey, undef, 0, yappCenter], // a depth of Zero just creates the flat for a key\n   [125, 30,  6,  4, 8, yappCircleWithKey, undef, 0, yappCenter], // Key with depth of 4\n//   [160, 30, 30, 30, 8, yappPolygon, [yappPolygonDef,[[-0.50,0],[-0.25,+0.433012],[+0.45,-0.433012],[-0.25,-0.433012]]], yappCenter], // Cuts an inline defined polygon\n//   [160, 65, 30, 30, 10, yappPolygon, shape6ptStar, yappCenter],\n//   [165, 90, 20, 30,  3, yappRoundedRect, 10], // Cuts down the side of the case 10mm \n//   [140, 90, 20, 30,  1, yappRectangle, 10],   // Cuts down the side of the case 10mm \n//   [115, 95, 20, 30, 10, yappCircle, 10],   // Cuts down the side of the case 10mm \n];\n\ncutoutsFront = \n[\n//   [20, 11, 15, 25, 3, yappRoundedRect],\n//   [ 30, 40, 25, 15, 3, yappRoundedRect, 10],\n//   [40, 11, 15, 25, 10, yappCircle],\n//   [70, 4, 15, 17, 10, yappCircleWithFlats],\n];  \n\n\ncutoutsBack = \n[\n//    [20, 40, 25, 15, 3, yappRoundedRect, 20],\n];\n\n\ncutoutsLeft = \n[\n//   [ 30,  0, 0, 0, 2, yappCircle, 5, yappCenter],\n//   [ 35,  0, 0, 0, 2, yappCircle, 5, yappCenter, yappFromInside],\n//   [ 30, 0, 25, 15, 3, yappRoundedRect, 10],\n//   [160, 35,  4,  3, 6, yappCircleWithKey, 0, 90, yappCenter],\n//   [ 90, 15, 30, 10, 0, yappRectangle, maskBars, yappCenter],  \n//   [ 90, 35, 30, 10, 0, yappRectangle, maskBars, yappCenter],  \n];\n\ncutoutsRight = \n[\n//   [90,  5, 20, 15,  4, yappRoundedRect],\n//   [15, -5, 20, 15, 10, yappCircle, 15],\n//   [40, -5, 20, 15,  5, yappRoundedRect, 15],\n//   [65, -5, 20, 15,  0, yappRectangle, 15],\n//   [65, 40, 20, 15,  0, yappRectangle, 15],\n//   [40, 40, 20, 15,  5, yappRoundedRect, 15],\n//   [15, 40, 20, 15, 10, yappCircle, 15],\n];\n\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Demo_imagesPlane_v3.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.1.2 (2024-04-16)\n//\n// This design is parameterized based on the size of a PCB.\n//\n// For many/complex cutoutGrills, you might need to adjust\n//  the max number of elements in OpenSCAD:\n//\n//      Preferences->Advanced->Turn off rendering at 250000 elements\n//                                                   ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n//---------------------------------------------------------\n// This design is parameterized based on the size of a PCB.\n//---------------------------------------------------------\n// Note: length/lengte refers to X axis, \n//       width/breedte refers to Y axis,\n//       height/hoogte refers to Z axis\n\n/*\n      padding-back|<------pcb length --->|<padding-front\n                            RIGHT\n        0    X-axis ---> \n        +----------------------------------------+   ---\n        |                                        |    ^\n        |                                        |   padding-right \n      Y |                                        |    v\n      | |    -5,y +----------------------+       |   ---              \n B    a |         | 0,y              x,y |       |     ^              F\n A    x |         |                      |       |     |              R\n C    i |         |                      |       |     | pcb width    O\n K    s |         |                      |       |     |              N\n        |         | 0,0              x,0 |       |     v              T\n      ^ |    -5,0 +----------------------+       |   ---\n      | |                                        |    padding-left\n      0 +----------------------------------------+   ---\n        0    X-as --->\n                          LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\nprintDisplayClips     = true;\n\n// ********************************************************************\n// The Following will be used as the first element in the pbc array\n\n//Defined here so you can define the \"Main\" PCB using these if wanted\npcbLength           = 150; // front to back (X axis)\npcbWidth            = 100; // side to side (Y axis)\npcbThickness        = 1.6; \nstandoffHeight      = 1.0; //-- How much the PCB needs to be raised from the base to leave room for solderings and whatnot\nstandoffDiameter    = 7;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\n\n//===================================================================\n// *** PCBs ***\n// Printed Circuit Boards\n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : yappCoordBoxInside[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = name\n//    p(1) = length\n//    p(2) = width\n//    p(3) = posx\n//    p(4) = posy\n//    p(5) = Thickness\n//    p(6) = standoff_Height\n//    p(7) = standoff_Diameter\n//    p(8) = standoff_PinDiameter\n//   Optional:\n//    p(9) = standoff_HoleSlack (default to 0.4)\n\n//The following can be used to get PCB values elsewhere in the script - not in pcb definition. \n//If \"PCB Name\" is omitted then \"Main\" is used\n//  pcbLength           --> pcbLength(\"PCB Name\")\n//  pcbWidth            --> pcbWidth(\"PCB Name\")\n//  pcbThickness        --> pcbThickness(\"PCB Name\") \n//  standoffHeight      --> standoffHeight(\"PCB Name\") \n//  standoffDiameter    --> standoffDiameter(\"PCB Name\") \n//  standoffPinDiameter --> standoffPinDiameter(\"PCB Name\") \n//  standoffHoleSlack   --> standoffHoleSlack(\"PCB Name\") \n\npcb = \n[\n  // Default Main PCB - DO NOT REMOVE the \"Main\" line.\n  [\"Main\",              pcbLength,pcbWidth,    0,0,    pcbThickness,  standoffHeight, standoffDiameter, standoffPinDiameter, standoffHoleSlack]\n];\n\n//-------------------------------------------------------------------                            \n//-- padding between pcb and inside wall\npaddingFront        = 2;\npaddingBack         = 2;\npaddingRight        = 2;\npaddingLeft         = 2;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 1.5;\nlidPlaneThickness   = 1.5;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 25;\nlidWallHeight       = 23;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.2;\nroundRadius         = 3.0;\n\n\n// Set the layer height of your printer\nprinterLayerHeight  = 0.2;\n\n\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n// -- Render --\nrenderQuality             = 8;          //-> from 1 to 32, Default = 8\n\n// --Preview --\npreviewQuality            = 5;          //-> from 1 to 32, Default = 5\nshowSideBySide            = true;       //-> Default = true\nonLidGap                  = 0;  // tip don't override to animate the lid opening\ncolorLid                  = \"YellowGreen\";   \nalphaLid                  = 1;\ncolorBase                 = \"BurlyWood\";\nalphaBase                 = 1;\nhideLidWalls              = false;      //-> Remove the walls from the lid : only if preview and showSideBySide=true \nhideBaseWalls             = false;      //-> Remove the walls from the base : only if preview and showSideBySide=true  \nshowOrientation           = true;       //-> Show the Front/Back/Left/Right labels : only in preview\nshowPCB                   = false;      //-> Show the PCB in red : only in preview \nshowSwitches              = false;      //-> Show the switches (for pushbuttons) : only in preview \nshowButtonsDepressed      = false;      //-> Should the buttons in the Lid On view be in the pressed position\nshowOriginCoordBox        = false;      //-> Shows red bars representing the origin for yappCoordBox : only in preview \nshowOriginCoordBoxInside  = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowOriginCoordPCB        = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowMarkersPCB            = false;      //-> Shows black bars corners of the PCB : only in preview \nshowMarkersCenter         = false;      //-> Shows magenta bars along the centers of all faces  \ninspectX                  = 0;          //-> 0=none (>0 from Back)\ninspectY                  = 0;          //-> 0=none (>0 from Right)\ninspectZ                  = 0;          //-> 0=none (>0 from Bottom)\ninspectXfromBack          = true;       //-> View from the inspection cut foreward\ninspectYfromLeft          = true;       //-> View from the inspection cut to the right\ninspectZfromBottom        = true;       //-> View from the inspection cut up\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n\n//===================================================================\n//  *** Images ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   p(0) = posx\n//   p(1) = posy/z\n//   p(2) = rotation degrees CCW\n//   p(3) = depth : positive values go into case (Remove) negative values are raised (Add)\n//   p(4) = { yappLeft, yappRight, yappFront, yappBack, yappLid, yappBase } : plane\n//   p(5) = \"image filename.svg\"\n//  Optional:\n//   p(6) = Scale : Default = 1 : ratio to scale image by (making it larger or smaller)\n//-------------------------------------------------------------------\nimagesPlane =\n[\n[ 40, 40, 0, 1, yappLid, \"YAPP_Demo_imagesPlane.svg\", 0.2 ]\n];\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Demo_lightTubes_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//    This is a box for test with lightTube\n//\n//    Rendering takes ~ 11 minutes (renderQuality 10)\n//    Rendering takes ~  5 minutes (renderQuality 5)\n//\n//    Version 3.0 (29-11-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//    You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//-----------------------------------------------------------------------\n\n\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 30;\npcbWidth            = 40;\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 2;\npaddingRight        = 3;\npaddingLeft         = 4;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 1.0;\nlidPlaneThickness   = 1.0;\n\n//-- Total height of box = basePlaneThickness + lidPlaneThickness \n//--                     + baseWallHeight + lidWallHeight\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      =  8;\nlidWallHeight       = 13;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 3.6;\nridgeSlack          = 0.2;\nroundRadius         = 2.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 7.0;  \nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\nstandoffDiameter    = 7;\n\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = false;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 5;        //-> from 1 to 32, Default = 8\nonLidGap            = 0;\nshiftLid            = 1;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\ncolorLid            = \"YellowGreen\";   \nalphaLid            = 0.8;//0.2;   \ncolorBase           = \"BurlyWood\";\nalphaBase           = 0.8;//0.2;\nshowOrientation     = true;\nshowPCB             = false;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Base)\ninspectXfromBack    = true;     //-> View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = true;     //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n//-------------------------------------------------------------------\n//-------------------------------------------------------------------\n// Start of Debugging config (used if not overridden in template)\n// ------------------------------------------------------------------\n\n\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx\n//    (1) = posy\n//   Optional:\n//    (2) = Height to bottom of PCB : Default = standoffHeight\n//    (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    (4) = standoffDiameter    Default = standoffDiameter;\n//    (5) = standoffPinDiameter Default = standoffPinDiameter;\n//    (6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    (7) = filletRadius (0 = auto size)\n//    (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    (n) = { yappHole, <yappPin> } // Baseplate support treatment\n//    (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    (n) = { yappCoordBox, <yappCoordPCB> }  \n//    (n) = { yappNoFillet }\n//-------------------------------------------------------------------\npcbStands =\n[\n      // 0, 1, \n        [5, 5, yappBaseOnly, yappFrontLeft, yappBackRight] \n      , [5, 5, yappBoth, yappBackLeft, yappFrontRight]\n];\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase, cutoutsLid, cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//                      +-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be provided\n//\n//  Parameters:\n//   Required:\n//    (0) = from Back\n//    (1) = from Left\n//    (2) = width\n//    (3) = length\n//    (4) = radius\n//    (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    (7) = angle : Default = 0\n//    (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.\n//    (n) = { <yappCoordBox> | yappCoordPCB }\n//    (n) = { <yappOrigin>, yappCenter }\n//  (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top, Back and Right Faces\n//-------------------------------------------------------------------\ncutoutsBase =   \n[\n    [shellLength/2,shellWidth/2 ,15,15, 5, yappPolygon ,0 ,30, yappCenter, shapeHexagon, maskHexCircles]\n];\n\n// (0) = posy\n// (1) = posz\ncutoutsFront =  \n[\n  // 0, 1,      2,            3,      4, 5\n    [5, 2, shellWidth-10, shellHeight-4, 2, yappRoundedRect, yappCoordBox]\n];\n\n// (0) = posy\n// (1) = posz\ncutoutsBack =   \n[\n    [3, 2, shellWidth-6, shellHeight-4, 3, yappRoundedRect, yappCoordBox]\n];\n\n\n//===================================================================\n//  *** Snap Joins ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx | posy\n//    (1) = width\n//    (n) = yappLeft / yappRight / yappFront / yappBack (one or more)\n//   Optional:\n//    (n) = { <yappOrigin> | yappCenter }\n//    (n) = { yappSymmetric }\n//    (n) = { yappRectangle } == Make a diamond shape snap\n//-------------------------------------------------------------------\nsnapJoins   =   \n[\n    [(shellLength/2)-10, 3, yappLeft, yappCenter, yappSymmetric]\n   ,[(shellLength/2)-8,  3, yappRight, yappCenter, yappSymmetric, yappRectangle]\n];\n\n\n//===================================================================\n//  *** Box Mounts ***\n//    Mounting tabs on the outside of the box\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X.\n//                    Position is to center of mounting screw in leftmost position in slot\n//    p(1) = screwDiameter\n//    p(2) = width of opening in addition to screw diameter \n//                    (0=Circular hole screwWidth = hole twice as wide as it is tall)\n//    p(3) = height\n//   Optional:\n//    p(4) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = { yappLeft | yappRight | yappFront | yappBack } : one or more\n//    n(b) = { yappNoFillet }\n//    n(c) = { <yappBase>, yappLid }\n//    n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of \n//                            the left of the opening\n//    n(e) = { <yappGlobalOrigin>, yappLeftOrigin } : Only affects Back and Right Faces\n//-------------------------------------------------------------------\nboxMounts   =  \n[\n    [(shellLength/2), 3, 6, 2.5, yappLeft, yappRight, yappCenter]\n];\n\n               \n//===================================================================\n//  *** Light Tubes ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB: PCB[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = tubeLength\n//    p(3) = tubeWidth\n//    p(4) = tubeWall\n//    p(5) = gapAbovePcb\n//    p(6) = tubeType    {yappCircle|yappRectangle}\n//   Optional:\n//    p(7) = lensThickness (how much to leave on the top of the lid for the \n//           light to shine through 0 for open hole : Default = 0/Open\n//    p(8) = Height to top of PCB : Default = standoffHeight+pcbThickness\n//    p(9) = filletRadius : Default = 0/Auto \n//    n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside } \n//    n(b) = { <yappGlobalOrigin>, yappLeftOrigin }\n//    n(c) = { yappNoFillet }\n//-------------------------------------------------------------------\nlightTubes = \n[\n //-- 0,  1, 2,   3, 4, 5, 6/7\n    [15, 10, 5,   6, 1, 0.1, yappCircle]\n   ,[15, 30, 1.5, 5, 1, 0.1, yappRectangle, .5]\n];     \n\n             \n\n//========= MAIN CALL's ===========================================================\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_HookTest_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0 (01-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n//---------------------------------------------------------\n// This design is parameterized based on the size of a PCB.\n//---------------------------------------------------------\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n      padding-back|<------pcb length --->|<padding-front\n                            RIGHT\n        0    X-axis ---> \n        +----------------------------------------+   ---\n        |                                        |    ^\n        |                                        |   padding-right \n      Y |                                        |    v\n      | |    -5,y +----------------------+       |   ---              \n B    a |         | 0,y              x,y |       |     ^              F\n A    x |         |                      |       |     |              R\n C    i |         |                      |       |     | pcb width    O\n K    s |         |                      |       |     |              N\n        |         | 0,0              x,0 |       |     v              T\n      ^ |    -5,0 +----------------------+       |   ---\n      | |                                        |    padding-left\n      0 +----------------------------------------+   ---\n        0    X-as --->\n                          LEFT\n*/\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 150; // Front to back\npcbWidth            = 100; // Side to side\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 4.0;\nbasePlaneThickness  = 1.5;\nlidPlaneThickness   = 1.5;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//                       + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 25;\nlidWallHeight       = 25;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight \n//     or 1.8x wallThickness if using snaps\nridgeHeight         = 10.0;\nridgeSlack          = 0.2;\n\n//-- Radius of the shell corners\nroundRadius         = 3;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 10.0;  //-- used for PCB Supports, Push Button and showPCB\nstandoffDiameter    = 7;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = true;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 8;        //-> from 1 to 32, Default = 8\nonLidGap            = 12;\nshiftLid            = 5;\ncolorLid            = \"YellowGreen\";   \nalphaLid            = 1;\ncolorBase           = \"BurlyWood\";\nalphaBase           = 1;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\nshowOrientation     = true;\nshowPCB             = false;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack    = true;     //-> View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = false;    //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//                      +-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be provided\n//\n//  Parameters:\n//   Required:\n//    (0) = from Back\n//    (1) = from Left\n//    (2) = width\n//    (3) = length\n//    (4) = radius\n//    (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    (7) = angle : Default = 0\n//    (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.\n//    (n) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added it will be used as a mask for the cutout. With the Rotation and offsets applied. This can be used to fine tune the mask placement within the opening.\n//    (n) = { <yappCoordBox> | yappCoordPCB }\n//    (n) = { <yappOrigin>, yappCenter }\n//  (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces\n\n//    (n) = { <yappBoth> | yappLidOnly | yappBaseOnly } : What part of the shell to cut (only affects Left/Right/Front/Back\n\n\n//-------------------------------------------------------------------\n\ncutoutsBase = \n[\n\n];\n\ncutoutsLid  = \n[\n];\n\ncutoutsFront =  \n[\n\n];\n\n\ncutoutsBack = \n[\n  // Make the hole thru the end of the ridge extansion\n  [25,ridgeExtTop-10-3, 0,  0,  3, yappCircle]\n];\n\ncutoutsLeft =   \n[\n\n];\n\ncutoutsRight =  \n[\n\n];\n\n\n//===================================================================\n//  *** Ridge Extension ***\n//    Extension from the lid into the case for adding split opening at various heights\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = pos\n//    (1) = width\n//    (2) = height : Distance below the ridge : Negative to move into lid\n//   Optional:\n//    (n) = { <yappOrigin>, yappCenter } \n//    (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces\n\n// Note: use ridgeExtTop to reference the top of the extension for cutouts.\n// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.\n//-------------------------------------------------------------------\nridgeExtFront =\n[\n [85, 6, ridgeHeight]\n  \n  // Make a ridge extension 6mm wide in the middle of the ridge \n ,[95, 6, 5]\n   \n  // Make a ridge extension 6mm wide 10mm below the top of the ridge\n ,[25, 6, 10]\n  \n  // Make a ridge extension 20mm wide 15mm below the top of the ridge\n ,[45, 20, 15]\n \n // Make a ridge extension 6mm wide 15mm below the top of the ridge\n ,[35, 6, 15]\n];\n\nridgeExtBack =\n[\n \n];\n\nridgeExtLeft =\n[\n \n];\n\nridgeExtRight =\n[\n\n];\n\n\n  \n  \n//===================================================================\n//  *** Labels ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   (0) = posx\n//   (1) = posy/z\n//   (2) = rotation degrees CCW\n//   (3) = depth : positive values go into case (Remove) negative valies are raised (Add)\n//   (4) = plane {yappLeft | yappRight | yappFront | yappBack | yappTop | yappBottom}\n//   (5) = font\n//   (6) = size\n//   (7) = \"label text\"\n//-------------------------------------------------------------------\nlabelsPlane =\n[\n\n];\n//========= HOOK functions ============================\n  \n// Hook functions allow you to add 3d objects to the case.\n// Lid/Base = Shell part to attach the object to.\n// Inside/Outside = Join the object from the midpoint of the shell to the inside/outside.\n// Pre = Attach the object Pre before doing Cutouts/Stands/Connectors. \n\n//===========================================================\n// origin = box(0,0,0)\nmodule hookLidInsidePre()\n{\n  echo(\"hookLidInsidePre() ..\");\n  translate([shellInsideLength, shellInsideWidth, 0]) sphere(20);\n} // hookLidInsidePre()\n\n//===========================================================\n// origin = box(0,0,0)\nmodule hookLidInside()\n{\n  echo(\"hookLidInside() ..\");\n  sphere(20);\n} // hookLidInside()\n  \n//===========================================================\n//===========================================================\n// origin = box(0,0,shellHeight)\nmodule hookLidOutsidePre()\n{\n  echo(\"hookLidOutsidePre() ..\");\n  translate([shellInsideLength, shellInsideWidth, 0]) sphere(20);\n} // hookLidOutsidePre()\n\n//===========================================================\n// origin = box(0,0,shellHeight)\nmodule hookLidOutside()\n{\n  echo(\"hookLidOutside() ..\");\n  sphere(20);\n} // hookLidOutside()\n\n//===========================================================\n//===========================================================\n// origin = box(0,0,0)\nmodule hookBaseInsidePre()\n{\n  echo(\"hookBaseInsidePre() ..\");\n} // hookBaseInsidePre()\n\n//===========================================================\n// origin = box(0,0,0)\nmodule hookBaseInside()\n{\n  echo(\"hookBaseInside() ..\");\n  sphere(20);\n} // hookBaseInside()\n\n//===========================================================\n//===========================================================\n// origin = box(0,0,0)\nmodule hookBaseOutsidePre()\n{\n  echo(\"hookBaseOutsidePre() ..\");\n} // hookBaseOutsidePre()\n\n//===========================================================\n// origin = box(0,0,0)\nmodule hookBaseOutside()\n{\n  echo(\"hookBaseOutside() ..\");\n  sphere(20);\n} // hookBaseOutside()\n\n//===========================================================\n//===========================================================\n\n//---- This is where the magic happens ----\nYAPPgenerate();"
  },
  {
    "path": "examples/YAPP_Reference_Masks_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0 (03-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = false;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 250; // Front to back\npcbWidth            = 100; // Side to side\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 2.0;\nlidPlaneThickness   = 2.0;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 25;\nlidWallHeight       = 25;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.2;\nroundRadius         = 2.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 1.0;  //-- used only for pushButton and showPCB\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\nstandoffDiameter    = 8;\n\n\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = false;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 6;        //-> from 1 to 32, Default = 8\nonLidGap            = 2;\nshiftLid            = 5;\ncolorLid            = \"gray\";   \nalphaLid            = 1;//0.2;   \ncolorBase           = \"gray\";\nalphaBase           = 1;//0.2;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\nshowOrientation     = true;\nshowPCB             = false;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack    = true;     // View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = false;    //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//                        Required                Not Used        Note\n//----------------------+-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be\n//                      |                       |               | provided\n//----------------------+-----------------------+---------------+------------------------------------\n//\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey }\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappAltOrigin } // Only affects Bottom(base), Back and Right Faces\n//    n(g) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(h) = { yappFromInside } Make the cut from the inside towards the outside\n//-------------------------------------------------------------------\n\ncutoutsBase = \n[\n  [10,10,5,5,undef,yappRectangle,yappCenter] \n ,[10,10,undef,undef,2.5,yappCircle,yappCenter, yappAltOrigin] \n];\n\ncutoutsLid  = \n[\n  [10,10,5,5,undef,yappRectangle,yappCenter] \n ,[10,10,undef,undef,2.5,yappCircle,yappCenter, yappAltOrigin] \n\n/*\n [25, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter, maskHoneycomb]\n ,[50, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter, maskHexCircles]\n ,[75, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter, maskCircles]\n ,[100, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter, maskBars]\n ,[125, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter, maskOffsetBars]\n ,[150, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter, maskSquares]\n// ,[175, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter]                    //(A)\n*/\n];\n\ncutoutsFront = \n[\n  [10,10,5,5,undef,yappRectangle,yappCenter] \n ,[10,10,undef,undef,2.5,yappCircle,yappCenter, yappAltOrigin] \n];  \n\n\ncutoutsBack = \n[\n  [10,10,5,5,undef,yappRectangle,yappCenter] \n ,[10,10,undef,undef,2.5,yappCircle,yappCenter, yappAltOrigin] \n];\n\n\ncutoutsLeft = \n[\n  [10,10,5,5,undef,yappRectangle,yappCenter] \n ,[10,10,undef,undef,2.5,yappCircle,yappCenter, yappAltOrigin] \n];\n\ncutoutsRight = \n[\n  [10,10,5,5,undef,yappRectangle,yappCenter] \n ,[10,10,undef,undef,2.5,yappCircle,yappCenter, yappAltOrigin] \n];\n\n\n//===================================================================\n//  *** Box Mounts ***\n//  Mounting tabs on the outside of the box\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X.\n//                    Position is to center of mounting screw in leftmost position in slot\n//    p(1) = screwDiameter\n//    p(2) = width of opening in addition to screw diameter \n//                    (0=Circular hole screwWidth = hole twice as wide as it is tall)\n//    p(3) = height\n//   Optional:\n//    p(4) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = { yappLeft | yappRight | yappFront | yappBack } : one or more\n//    n(b) = { yappNoFillet }\n//    n(c) = { <yappBase>, yappLid }\n//    n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of \n//                            the left of the opening\n//    n(e) = { <yappGlobalOrigin>, yappAltOrigin } : Only affects Back and Right Faces\n//-------------------------------------------------------------------\nboxMounts =\n[\n//  [20, 6, 6, 3, yappLeft]\n];\n\n\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Reference_Shapes_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0 (03-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = false;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 250; // Front to back\npcbWidth            = 100; // Side to side\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 1.25;\nlidPlaneThickness   = 1.25;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 25;\nlidWallHeight       = 23;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.2;\nroundRadius         = 2.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 10.0;  //-- used only for pushButton and showPCB\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\nstandoffDiameter    = 8;\n\n\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = false;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 6;        //-> from 1 to 32, Default = 8\nonLidGap            = 2;\nshiftLid            = 5;\ncolorLid            = \"gray\";   \nalphaLid            = 1;//0.2;   \ncolorBase           = \"yellow\";\nalphaBase           = 1;//0.2;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\nshowOrientation     = true;\nshowPCB             = false;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack    = true;     // View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = false;    //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//                        Required                Not Used        Note\n//----------------------+-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be\n//                      |                       |               | provided\n//----------------------+-----------------------+---------------+------------------------------------\n//\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey }\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces\n//    n(g) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(h) = { yappFromInside } Make the cut from the inside towards the outside\n//-------------------------------------------------------------------\n\ncutoutsBase = \n[\n];\n\ncutoutsLid  = \n[\n\n//yappCenter demo\n/*\n    [10, 10, 10, 20, undef, yappRectangle]                              //(A)\n   ,[10, 50, 10, 20, undef, yappRectangle, yappCenter]                  //(B)\n\n   ,[30, 10, undef, undef, 5, yappCircle, ]                             //(C)\n   ,[30, 50, undef, undef, 5, yappCircle, yappCenter]                   //(D)\n \n   ,[50, 10, 10, 20, 2, yappRoundedRect, ]                              //(E)\n   ,[50, 50, 10, 20, 2, yappRoundedRect, yappCenter]                    //(F)\n \n   ,[70, 10, 15, undef, 10, yappCircleWithFlats, ]                      //(G)\n   ,[70, 50, 15, undef, 10, yappCircleWithFlats, yappCenter]            //(H)\n \n   ,[90, 10, 5, 2, 8, yappCircleWithKey, ]                              //(I)\n   ,[90, 50, 5, 2, 8, yappCircleWithKey, yappCenter]                    //(J)\n \n   ,[110, 10, 20, 20, undef, yappPolygon, shape6ptStar]                 //(K)\n   ,[110, 50, 20, 20, undef, yappPolygon, shape6ptStar, yappCenter]     //(L)\n   \n*/\n\n\n // [0, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter]                              //(A)\n [25, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter]                              //(A)\n ,[50, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter]                              //(A)\n ,[75, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter]                              //(A)\n ,[100, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter]                              //(A)\n ,[125, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter]                              //(A)\n ,[150, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter]                              //(A)\n ,[175, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter]                              //(A)\n //,[200, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter]                              //(A)\n\n ,[25, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeIsoTriangle, yappCenter]\n ,[50, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeIsoTriangle2, yappCenter]\n ,[75, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeHexagon, yappCenter]\n ,[100, 40, 20, 20, undef, yappPolygon, undef, $t*360, shape6ptStar, yappCenter]\n ,[125, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeTriangle, yappCenter]\n ,[150, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeTriangle2, yappCenter]\n ,[175, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeArrow, yappCenter]\n //,[200, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeArrow2, yappCenter]\n \n // Mask Demo\n//   ,[ 160, 55, 50, 50, 10, yappRectangle, 1, shapeHexagon, [maskHoneycomb,0,0,0], yappCenter, yappFromInside]\n//   ,[ 160, 55, 50, 50, 10, yappRectangle, 1, shapeHexagon, [maskHoneycomb,0,0,0], yappCenter, yappFromInside]\n];\n\ncutoutsFront = \n[\n];  \n\n\ncutoutsBack = \n[\n];\n\n\ncutoutsLeft = \n[\n //--  0,  1,  2,  3, 4, 5,6,7,n\n//    [ 30,  3, 25, 15, 3, yappRoundedRect, 1]\n //  ,[ 60, 3, 25, 15, 3, yappRoundedRect, 1, yappFromInside] \n //  ,[ 20, 1, 5, 5, 1, yappRoundedRect, 5, yappFromInside, yappCoordBox] // Cuts out into mounting tab\n];\n\ncutoutsRight = \n[\n];\n\n\n//===================================================================\n//  *** Box Mounts ***\n//  Mounting tabs on the outside of the box\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X.\n//                    Position is to center of mounting screw in leftmost position in slot\n//    p(1) = screwDiameter\n//    p(2) = width of opening in addition to screw diameter \n//                    (0=Circular hole screwWidth = hole twice as wide as it is tall)\n//    p(3) = height\n//   Optional:\n//    p(4) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = { yappLeft | yappRight | yappFront | yappBack } : one or more\n//    n(b) = { yappNoFillet }\n//    n(c) = { <yappBase>, yappLid }\n//    n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of \n//                            the left of the opening\n//    n(e) = { <yappGlobalOrigin>, yappLeftOrigin } : Only affects Back and Right Faces\n//-------------------------------------------------------------------\nboxMounts =\n[\n//  [20, 6, 6, 3, yappLeft]\n];\n\n\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_RidgeExtDemo_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0 (01-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n//---------------------------------------------------------\n// This design is parameterized based on the size of a PCB.\n//---------------------------------------------------------\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n      padding-back|<------pcb length --->|<padding-front\n                            RIGHT\n        0    X-axis ---> \n        +----------------------------------------+   ---\n        |                                        |    ^\n        |                                        |   padding-right \n      Y |                                        |    v\n      | |    -5,y +----------------------+       |   ---              \n B    a |         | 0,y              x,y |       |     ^              F\n A    x |         |                      |       |     |              R\n C    i |         |                      |       |     | pcb width    O\n K    s |         |                      |       |     |              N\n        |         | 0,0              x,0 |       |     v              T\n      ^ |    -5,0 +----------------------+       |   ---\n      | |                                        |    padding-left\n      0 +----------------------------------------+   ---\n        0    X-as --->\n                          LEFT\n*/\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 150; // Front to back\npcbWidth            = 100; // Side to side\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 4.0;\nbasePlaneThickness  = 1.5;\nlidPlaneThickness   = 1.5;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//                       + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 25;\nlidWallHeight       = 25;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight \n//     or 1.8x wallThickness if using snaps\nridgeHeight         = 10.0;\nridgeSlack          = 0.2;\n\n//-- Radius of the shell corners\nroundRadius         = 3;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 10.0;  //-- used for PCB Supports, Push Button and showPCB\nstandoffDiameter    = 7;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = false;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 8;        //-> from 1 to 32, Default = 8\nonLidGap            = 12;\nshiftLid            = 5;\ncolorLid            = \"YellowGreen\";   \nalphaLid            = 1;\ncolorBase           = \"BurlyWood\";\nalphaBase           = 1;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\nshowOrientation     = true;\nshowPCB             = false;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack    = true;     //-> View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = false;    //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//                      +-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be provided\n//\n//  Parameters:\n//   Required:\n//    (0) = from Back\n//    (1) = from Left\n//    (2) = width\n//    (3) = length\n//    (4) = radius\n//    (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    (7) = angle : Default = 0\n//    (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.\n//    (n) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added it will be used as a mask for the cutout. With the Rotation and offsets applied. This can be used to fine tune the mask placement within the opening.\n//    (n) = { yappCoordBox | <yappCoordPCB> }\n//    (n) = { <yappOrigin>, yappCenter }\n//  (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces\n\n//    (n) = { <yappBoth> | yappLidOnly | yappBaseOnly } : What part of the shell to cut (only affects Left/Right/Front/Back\n\n\n//-------------------------------------------------------------------\n\ncutoutsBase = \n[\n\n];\n\ncutoutsLid  = \n[\n];\n\ncutoutsFront =  \n[\n  // This can only have a cable put through it after the case is assembled\n  // This could be used as a locking pin\n  [75,(ridgeHeight/2), 0,  0,  1, yappCircle, yappCenter]\n  \n  // Make the hole thru the end of the ridge extansion\n ,[85,ridgeHeight-3, 0,  0,  3, yappCircle]\n \n  // In the Middle of the Ridge\n ,[95+3,(ridgeHeight/2), 0,  0,  2.5, yappCircle, yappCenter]\n\n  // Make the hole thru the end of the ridge extansion\n ,[25,10-3, 0,  0,  3, yappCircle]\n\n  // Make the rounded rect thru the end of the ridge extansion\n ,[45, 15-3, 20, 6,  3, yappRoundedRect]\n\n  // Make the hexagonal thru the end of the ridge extansion\n ,[38, 15, 6, 6,  0, yappPolygon, 0, 30, shapeHexagon, yappCenter]\n\n\n];\n\n\ncutoutsBack = \n[\n  // Make the hole thru the end of the ridge extansion\n  [28,8, 0,  0,  3, yappCircle, yappCenter, yappCoordBox]\n\n  // Make the hole thru the end of the ridge extansion\n ,[25,8, 6,  6,  0, yappPolygon, shape6ptStar, yappLeftOrigin, yappCenter, yappCoordBox]\n\n  // Make the rounded rect thru the end of the ridge extansion\n ,[55,13, 20, 6,  3, yappRoundedRect, yappCenter, yappCoordBox]\n\n  // Make the hexagonal thru the end of the ridge extansion\n ,[38,35, 6, 6,  0, yappPolygon, 0, 30, shapeHexagon, yappCenter, yappCoordBox]\n\n\n];\n\ncutoutsLeft =   \n[\n  // Make the hole thru the end of the ridge extansion\n  // Height = ridgeExtTop - height of the ext - the diameter of the circle\n  [5,10-3, 0,  0,  3, yappCircle]\n\n  // Make the hexagonal thru the end of the ridge extansion\n ,[15+3,15, 6, 6,  0, yappPolygon, 0, 30, shapeHexagon, yappCenter]\n\n  // Make the rounded rect thru the end of the ridge extansion\n ,[25,15-3, 10, 6,  3, yappRoundedRect]\n\n\n];\n\ncutoutsRight =  \n[\n  // Make the hole thru the end of the ridge extansion\n  [25,10-3, 0,  0,  3, yappCircle]\n\n  // Make the hole thru the end of the ridge extansion\n ,[25,10-3, 6,  6,  0, yappPolygon, shape6ptStar, yappLeftOrigin]\n\n  // Make the rounded rect thru the end of the ridge extansion\n ,[45,15-3, 20, 6,  3, yappRoundedRect]\n\n  // Make the hexagonal thru the end of the ridge extansion\n ,[38,15, 6, 6,  0, yappPolygon, 0, 30, shapeHexagon, yappCenter]\n\n\n];\n\n\n//===================================================================\n//  *** Ridge Extension ***\n//    Extension from the lid into the case for adding split opening at various heights\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = pos\n//    (1) = width\n//    (2) = height : Distance below the ridge : Negative to move into lid\n//   Optional:\n//    (n) = { <yappOrigin>, yappCenter } \n//    (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces\n\n// Note: use ridgeExtTop to reference the top of the extension for cutouts.\n// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.\n//-------------------------------------------------------------------\nridgeExtFront =\n[\n [85, 6, ridgeHeight]\n  \n  // Make a ridge extension 6mm wide in the middle of the ridge \n ,[95, 6, 5]\n   \n  // Make a ridge extension 6mm wide 10mm below the top of the ridge\n ,[25, 6, 10]\n  \n  // Make a ridge extension 20mm wide 15mm below the top of the ridge\n ,[45, 20, 15]\n \n // Make a ridge extension 6mm wide 15mm below the top of the ridge\n ,[35, 6, 15]\n];\n\nridgeExtBack =\n[\n  // Make a ridge extension 6mm wide 8mm from the bottom of the box\n  [25, 6, 8, yappCoordBox]\n  \n  // Make a ridge extension 6mm wide 8mm from the bottom of the box from the left edge\n ,[25, 6, 8, yappLeftOrigin, yappCoordBox, yappCenter]\n  \n  // Make a ridge extension 20mm wide 13mm from the bottom of the box\n ,[45, 20, 13, yappCoordBox]\n \n // Make a ridge extension 6mm wide 35mm from the bottom of the box\n ,[35, 6, 35, yappCoordBox]\n];\n\nridgeExtLeft =\n[\n  // Make a ridge extension 6mm wide 10mm below the top of the ridge\n  [5, 6, 10]\n  // Make a ridge extension 6mm wide 15mm below the top of the ridge\n ,[15, 6, 15]\n  // Make a ridge extension 20mm wide 15mm below the top of the ridge\n ,[25, 10, 15]\n \n // Make a row of ridgeExt from 8mm below the PCB to \n ,[ 40, 5, -8]\n ,[ 50, 5, -4]\n ,[ 60, 5, -0]\n ,[ 70, 5,  4]\n ,[ 80, 5,  8]\n ,[ 90, 5, 12]\n ,[100, 5, 16]\n ,[110, 5, 20]\n ,[120, 5, 24]\n ,[130, 5, 28]\n];\n\nridgeExtRight =\n[\n  // Make a ridge extension 6mm wide 10mm below the top of the ridge\n  [25, 6, 10]\n  \n  // Make a ridge extension 6mm wide 10mm below the top of the ridge from the left edge\n ,[25, 6, 10, yappLeftOrigin]\n  \n  // Make a ridge extension 20mm wide 15mm below the top of the ridge\n ,[45, 20, 15]\n \n // Make a ridge extension 6mm wide 15mm below the top of the ridge\n ,[35, 6, 15]\n];\n\n\n  \n  \n//===================================================================\n//  *** Labels ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   p(0) = posx\n//   p(1) = posy/z\n//   p(2) = rotation degrees CCW\n//   p(3) = depth : positive values go into case (Remove) negative valies are raised (Add)\n//   p(4) = plane {yappLeft | yappRight | yappFront | yappBack | yappLid | yappBase}\n//   p(5) = font\n//   p(6) = size\n//   p(7) = \"label text\"\n//-------------------------------------------------------------------\nlabelsPlane =\n[\n//  [5, 5, 0, 3, yappLid, \"Liberation Mono:style=bold\", 5, \"YAPP Lid\" ]\n// ,[5, 5, 0, 3, yappBase, \"Liberation Mono:style=bold\", 5, \"YAPP Base\" ]\n// ,[5, 5, 0, 3, yappLeft, \"Liberation Mono:style=bold\", 5, \"YAPP Left\" ]\n// ,[5, 5, 0, 3, yappRight, \"Liberation Mono:style=bold\", 5, \"YAPP Right\" ]\n// ,[5, 5, 0, 3, yappFront, \"Liberation Mono:style=bold\", 5, \"YAPP Front\" ]\n//  ,[5, 5, 0, 3, yappBack, \"Liberation Mono:style=bold\", 5, \"YAPP Back\" ]\n \n//  ,[10, 15, 45, 3, yappLid,    \"Liberation Mono:style=bold\", 5, \"YAPP Lid\" ]\n//  ,[10, 15, 45, 3, yappBase, \"Liberation Mono:style=bold\", 5, \"YAPP Base\" ]\n//  ,[10, 15, 45, 3, yappLeft,   \"Liberation Mono:style=bold\", 5, \"YAPP Left\" ]\n//  ,[10, 15, 45, 3, yappRight,  \"Liberation Mono:style=bold\", 5, \"YAPP Right\" ]\n//  ,[10, 15, 45, 3, yappFront,  \"Liberation Mono:style=bold\", 5, \"YAPP Front\" ]\n//  ,[10, 15, 45, 3, yappBack,   \"Liberation Mono:style=bold\", 5, \"YAPP Back\" ]\n\n//  ,[35, 5, 0, -2, yappLid, \"Liberation Mono:style=bold\", 5, \"YAPP Lid\" ]\n//  ,[35, 5, 0, -2, yappBase, \"Liberation Mono:style=bold\", 5, \"YAPP Base\" ]\n//  ,[35, 5, 0, -2, yappLeft, \"Liberation Mono:style=bold\", 5, \"YAPP Left\" ]\n//  ,[35, 5, 0, -2, yappRight, \"Liberation Mono:style=bold\", 5, \"YAPP Right\" ]\n//  ,[35, 5, 0, -2, yappFront, \"Liberation Mono:style=bold\", 5, \"YAPP Front\" ]\n//  ,[35, 5, 0, -2, yappBack, \"Liberation Mono:style=bold\", 5, \"YAPP Back\" ]\n \n//  ,[30, 15, 45, -2, yappLid,    \"Liberation Mono:style=bold\", 5, \"YAPP Lid\" ]\n//  ,[30, 15, 45, -2, yappBase, \"Liberation Mono:style=bold\", 5, \"YAPP Base\" ]\n//  ,[30, 15, 45, -2, yappLeft,   \"Liberation Mono:style=bold\", 5, \"YAPP Left\" ]\n//  ,[30, 15, 45, -2, yappRight,  \"Liberation Mono:style=bold\", 5, \"YAPP Right\" ]\n//  ,[30, 15, 45, -2, yappFront,  \"Liberation Mono:style=bold\", 5, \"YAPP Front\" ]\n//  ,[30, 15, 45, -2, yappBack,   \"Liberation Mono:style=bold\", 5, \"YAPP Back\" ]\n];\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();"
  },
  {
    "path": "examples/YAPP_RidgeExtDemo_v31.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0 (01-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n//---------------------------------------------------------\n// This design is parameterized based on the size of a PCB.\n//---------------------------------------------------------\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n      padding-back|<------pcb length --->|<padding-front\n                            RIGHT\n        0    X-axis ---> \n        +----------------------------------------+   ---\n        |                                        |    ^\n        |                                        |   padding-right \n      Y |                                        |    v\n      | |    -5,y +----------------------+       |   ---              \n B    a |         | 0,y              x,y |       |     ^              F\n A    x |         |                      |       |     |              R\n C    i |         |                      |       |     | pcb width    O\n K    s |         |                      |       |     |              N\n        |         | 0,0              x,0 |       |     v              T\n      ^ |    -5,0 +----------------------+       |   ---\n      | |                                        |    padding-left\n      0 +----------------------------------------+   ---\n        0    X-as --->\n                          LEFT\n*/\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 150; // Front to back\npcbWidth            = 100; // Side to side\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 4.0;\nbasePlaneThickness  = 1.5;\nlidPlaneThickness   = 1.5;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//                       + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 25;\nlidWallHeight       = 25;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight \n//     or 1.8x wallThickness if using snaps\nridgeHeight         = 10.0;\nridgeSlack          = 0.2;\n\n//-- Radius of the shell corners\nroundRadius         = 3;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 10.0;  //-- used for PCB Supports, Push Button and showPCB\nstandoffDiameter    = 7;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = false;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 8;        //-> from 1 to 32, Default = 8\nonLidGap            = 12;\nshiftLid            = 5;\ncolorLid            = \"YellowGreen\";   \nalphaLid            = 1;\ncolorBase           = \"BurlyWood\";\nalphaBase           = 1;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\nshowOrientation     = true;\nshowPCB             = false;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack    = true;     //-> View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = false;    //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//                      +-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be provided\n//\n//  Parameters:\n//   Required:\n//    (0) = from Back\n//    (1) = from Left\n//    (2) = width\n//    (3) = length\n//    (4) = radius\n//    (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    (7) = angle : Default = 0\n//    (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.\n//    (n) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added it will be used as a mask for the cutout. With the Rotation and offsets applied. This can be used to fine tune the mask placement within the opening.\n//    (n) = { yappCoordBox | <yappCoordPCB> }\n//    (n) = { <yappOrigin>, yappCenter }\n//  (n) = { yappAltOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces\n\n//    (n) = { <yappBoth> | yappLidOnly | yappBaseOnly } : What part of the shell to cut (only affects Left/Right/Front/Back\n\n\n//-------------------------------------------------------------------\n\ncutoutsBase = \n[\n\n];\n\ncutoutsLid  = \n[\n];\n\ncutoutsFront =  \n[\n  // This can only have a cable put through it after the case is assembled\n  // This could be used as a locking pin\n  [75,(ridgeHeight/2), 0,  0,  1, yappCircle, yappCenter]\n  \n  // Make the hole thru the end of the ridge extansion\n ,[85,ridgeHeight-3, 0,  0,  3, yappCircle]\n \n  // In the Middle of the Ridge\n ,[95+3,(ridgeHeight/2), 0,  0,  2.5, yappCircle, yappCenter]\n\n  // Make the hole thru the end of the ridge extansion\n ,[25,10-3, 0,  0,  3, yappCircle]\n\n  // Make the rounded rect thru the end of the ridge extansion\n ,[45, 15-3, 20, 6,  3, yappRoundedRect]\n\n  // Make the hexagonal thru the end of the ridge extansion\n ,[38, 15, 6, 6,  0, yappPolygon, 0, 30, shapeHexagon, yappCenter]\n\n\n];\n\n\ncutoutsBack = \n[\n  // Make the hole thru the end of the ridge extansion\n  [28,8, 0,  0,  3, yappCircle, yappCenter, yappCoordBox]\n\n  // Make the hole thru the end of the ridge extansion\n ,[25,8, 6,  6,  0, yappPolygon, shape6ptStar, yappAltOrigin, yappCenter, yappCoordBox]\n\n  // Make the rounded rect thru the end of the ridge extansion\n ,[55,13, 20, 6,  3, yappRoundedRect, yappCenter, yappCoordBox]\n\n  // Make the hexagonal thru the end of the ridge extansion\n ,[38,35, 6, 6,  0, yappPolygon, 0, 30, shapeHexagon, yappCenter, yappCoordBox]\n\n\n];\n\ncutoutsLeft =   \n[\n  // Make the hole thru the end of the ridge extansion\n  // Height = ridgeExtTop - height of the ext - the diameter of the circle\n  [5,10-3, 0,  0,  3, yappCircle]\n\n  // Make the hexagonal thru the end of the ridge extansion\n ,[15+3,15, 6, 6,  0, yappPolygon, 0, 30, shapeHexagon, yappCenter]\n\n  // Make the rounded rect thru the end of the ridge extansion\n ,[25,15-3, 10, 6,  3, yappRoundedRect]\n\n\n];\n\ncutoutsRight =  \n[\n  // Make the hole thru the end of the ridge extansion\n  [25,10-3, 0,  0,  3, yappCircle]\n\n  // Make the hole thru the end of the ridge extansion\n ,[25,10-3, 6,  6,  0, yappPolygon, shape6ptStar, yappAltOrigin]\n\n  // Make the rounded rect thru the end of the ridge extansion\n ,[45,15-3, 20, 6,  3, yappRoundedRect]\n\n  // Make the hexagonal thru the end of the ridge extansion\n ,[38,15, 6, 6,  0, yappPolygon, 0, 30, shapeHexagon, yappCenter]\n\n\n];\n\n\n//===================================================================\n//  *** Ridge Extension ***\n//    Extension from the lid into the case for adding split opening at various heights\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = pos\n//    (1) = width\n//    (2) = height : Distance below the ridge : Negative to move into lid\n//   Optional:\n//    (n) = { <yappOrigin>, yappCenter } \n//    (n) = { yappAltOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces\n\n// Note: use ridgeExtTop to reference the top of the extension for cutouts.\n// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.\n//-------------------------------------------------------------------\nridgeExtFront =\n[\n [85, 6, ridgeHeight]\n  \n  // Make a ridge extension 6mm wide in the middle of the ridge \n ,[95, 6, 5]\n   \n  // Make a ridge extension 6mm wide 10mm below the top of the ridge\n ,[25, 6, 10]\n  \n  // Make a ridge extension 20mm wide 15mm below the top of the ridge\n ,[45, 20, 15]\n \n // Make a ridge extension 6mm wide 15mm below the top of the ridge\n ,[35, 6, 15]\n];\n\nridgeExtBack =\n[\n  // Make a ridge extension 6mm wide 8mm from the bottom of the box\n  [25, 6, 8, yappCoordBox]\n  \n  // Make a ridge extension 6mm wide 8mm from the bottom of the box from the left edge\n ,[25, 6, 8, yappAltOrigin, yappCoordBox, yappCenter]\n  \n  // Make a ridge extension 20mm wide 13mm from the bottom of the box\n ,[45, 20, 13, yappCoordBox]\n \n // Make a ridge extension 6mm wide 35mm from the bottom of the box\n ,[35, 6, 35, yappCoordBox]\n];\n\nridgeExtLeft =\n[\n  // Make a ridge extension 6mm wide 10mm below the top of the ridge\n  [5, 6, 10]\n  // Make a ridge extension 6mm wide 15mm below the top of the ridge\n ,[15, 6, 15]\n  // Make a ridge extension 20mm wide 15mm below the top of the ridge\n ,[25, 10, 15]\n \n // Make a row of ridgeExt from 8mm below the PCB to \n ,[ 40, 5, -8]\n ,[ 50, 5, -4]\n ,[ 60, 5, -0]\n ,[ 70, 5,  4]\n ,[ 80, 5,  8]\n ,[ 90, 5, 12]\n ,[100, 5, 16]\n ,[110, 5, 20]\n ,[120, 5, 24]\n ,[130, 5, 28]\n];\n\nridgeExtRight =\n[\n  // Make a ridge extension 6mm wide 10mm below the top of the ridge\n  [25, 6, 10]\n  \n  // Make a ridge extension 6mm wide 10mm below the top of the ridge from the left edge\n ,[25, 6, 10, yappAltOrigin]\n  \n  // Make a ridge extension 20mm wide 15mm below the top of the ridge\n ,[45, 20, 15]\n \n // Make a ridge extension 6mm wide 15mm below the top of the ridge\n ,[35, 6, 15]\n];\n\n\n  \n  \n//===================================================================\n//  *** Labels ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   p(0) = posx\n//   p(1) = posy/z\n//   p(2) = rotation degrees CCW\n//   p(3) = depth : positive values go into case (Remove) negative valies are raised (Add)\n//   p(4) = plane {yappLeft | yappRight | yappFront | yappBack | yappLid | yappBase}\n//   p(5) = font\n//   p(6) = size\n//   p(7) = \"label text\"\n//-------------------------------------------------------------------\nlabelsPlane =\n[\n//  [5, 5, 0, 3, yappLid, \"Liberation Mono:style=bold\", 5, \"YAPP Lid\" ]\n// ,[5, 5, 0, 3, yappBase, \"Liberation Mono:style=bold\", 5, \"YAPP Base\" ]\n// ,[5, 5, 0, 3, yappLeft, \"Liberation Mono:style=bold\", 5, \"YAPP Left\" ]\n// ,[5, 5, 0, 3, yappRight, \"Liberation Mono:style=bold\", 5, \"YAPP Right\" ]\n// ,[5, 5, 0, 3, yappFront, \"Liberation Mono:style=bold\", 5, \"YAPP Front\" ]\n//  ,[5, 5, 0, 3, yappBack, \"Liberation Mono:style=bold\", 5, \"YAPP Back\" ]\n \n//  ,[10, 15, 45, 3, yappLid,    \"Liberation Mono:style=bold\", 5, \"YAPP Lid\" ]\n//  ,[10, 15, 45, 3, yappBase, \"Liberation Mono:style=bold\", 5, \"YAPP Base\" ]\n//  ,[10, 15, 45, 3, yappLeft,   \"Liberation Mono:style=bold\", 5, \"YAPP Left\" ]\n//  ,[10, 15, 45, 3, yappRight,  \"Liberation Mono:style=bold\", 5, \"YAPP Right\" ]\n//  ,[10, 15, 45, 3, yappFront,  \"Liberation Mono:style=bold\", 5, \"YAPP Front\" ]\n//  ,[10, 15, 45, 3, yappBack,   \"Liberation Mono:style=bold\", 5, \"YAPP Back\" ]\n\n//  ,[35, 5, 0, -2, yappLid, \"Liberation Mono:style=bold\", 5, \"YAPP Lid\" ]\n//  ,[35, 5, 0, -2, yappBase, \"Liberation Mono:style=bold\", 5, \"YAPP Base\" ]\n//  ,[35, 5, 0, -2, yappLeft, \"Liberation Mono:style=bold\", 5, \"YAPP Left\" ]\n//  ,[35, 5, 0, -2, yappRight, \"Liberation Mono:style=bold\", 5, \"YAPP Right\" ]\n//  ,[35, 5, 0, -2, yappFront, \"Liberation Mono:style=bold\", 5, \"YAPP Front\" ]\n//  ,[35, 5, 0, -2, yappBack, \"Liberation Mono:style=bold\", 5, \"YAPP Back\" ]\n \n//  ,[30, 15, 45, -2, yappLid,    \"Liberation Mono:style=bold\", 5, \"YAPP Lid\" ]\n//  ,[30, 15, 45, -2, yappBase, \"Liberation Mono:style=bold\", 5, \"YAPP Base\" ]\n//  ,[30, 15, 45, -2, yappLeft,   \"Liberation Mono:style=bold\", 5, \"YAPP Left\" ]\n//  ,[30, 15, 45, -2, yappRight,  \"Liberation Mono:style=bold\", 5, \"YAPP Right\" ]\n//  ,[30, 15, 45, -2, yappFront,  \"Liberation Mono:style=bold\", 5, \"YAPP Front\" ]\n//  ,[30, 15, 45, -2, yappBack,   \"Liberation Mono:style=bold\", 5, \"YAPP Back\" ]\n];\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();"
  },
  {
    "path": "examples/YAPP_TEST_BoxTypes_v32.scad",
    "content": "include <../YAPPgenerator_v3.scad>\n\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.6;\nbasePlaneThickness  = 1.5;\nlidPlaneThickness   = 1.5;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//                       + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoff_Height+pcb_Thickness)\nbaseWallHeight      = 20;\nlidWallHeight       = 20;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight \n//     or 1.8x wallThickness if using snaps\nridgeHeight         = 5.0;\nridgeSlack          = 0.3;\n\n//-- Radius of the shell corners\n//roundRadius         = wallThickness + 1;\n//roundRadius         = ($t + 0.2) * 5;\nroundRadius         = 0;\n\n// Box Types are 0-4 with 0 as the default\n// 0 = All edges rounded with radius (roundRadius) above\n// 1 = All edges square\n// 2 = All edges chamfered by (roundRadius) above \n// 3 = Square top and bottom edges (the ones that touch the build plate) and rounded vertical edges\n// 4 = Square top and bottom edges (the ones that touch the build plate) and chamfered vertical edges\n// 5 = Chamfered top and bottom edges (the ones that touch the build plate) and rounded vertical edges\n\n//boxType = round($t * 6); // Default type 0\nboxType = 0; // Default type 0\n\n\n\n// *****************\n\ncutoutsBase = \n[\n  [-10,-10,20,20,0,yappRectangle, 20], // Cut out the corner so we can see the cut line\n];\n\n\n//===========================================================\n//-- origin = box(0,0,0)\nmodule hookLidInside()\n{\n  //if (printMessages) echo(\"hookLidInside() ..\");\n  sphere(20); //qqqqq\n\n} //-- hookLidInside()\n\nmodule hookBaseInside()\n{\n  //if (printMessages) echo(\"hookBaseInside() ..\");\n  sphere(15); //qqqqq\n  \n} //-- hookBaseInside()\n\n\n\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_Test_SnapJoints_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0 (01-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n//---------------------------------------------------------\n// This design is parameterized based on the size of a PCB.\n//---------------------------------------------------------\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n      padding-back|<------pcb length --->|<padding-front\n                            RIGHT\n        0    X-axis ---> \n        +----------------------------------------+   ---\n        |                                        |    ^\n        |                                        |   padding-right \n      Y |                                        |    v\n      | |    -5,y +----------------------+       |   ---              \n B    a |         | 0,y              x,y |       |     ^              F\n A    x |         |                      |       |     |              R\n C    i |         |                      |       |     | pcb width    O\n K    s |         |                      |       |     |              N\n        |         | 0,0              x,0 |       |     v              T\n      ^ |    -5,0 +----------------------+       |   ---\n      | |                                        |    padding-left\n      0 +----------------------------------------+   ---\n        0    X-as --->\n                          LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = true;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 150; // Front to back\npcbWidth            = 100; // Side to side\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 1.5;\nlidPlaneThickness   = 1.5;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//                       + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 25;\nlidWallHeight       = 23;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight \n//     or 2.5x wallThickness if using snaps\nridgeHeight         = 3.6;\nridgeSlack          = 0.2;\n\n//-- Radius of the shell corners\nroundRadius         = 3;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 10.0;  //-- used for PCB Supports, Push Button and showPCB\nstandoffDiameter    = 7;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = true;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 8;        //-> from 1 to 32, Default = 8\nonLidGap            = 0;\nshiftLid            = 5;\ncolorLid            = \"gray\";   \nalphaLid            = 0.9; // 1;\ncolorBase           = \"BurlyWood\";\nalphaBase           = 0.9; // 1;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\nshowOrientation     = true;\nshowPCB             = false;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack    = true;     // View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = false;    //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n\n//===================================================================\n//  *** Snap Joins ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    (0) = posx | posy\n//    (1) = width\n//    (n) = yappLeft / yappRight / yappFront / yappBack (one or more)\n//   Optional:\n//    (n) = { <yappOrigin> | yappCenter }\n//    (n) = { yappSymmetric }\n//    (n) = { yappRectangle } == Make a diamond shape snap\n//-------------------------------------------------------------------\nsnapJoins   =   \n[\n// Test all combinations of yappCenter & yappRectangle \n    [(shellWidth/2)-10,     5, yappFront, yappBack, yappCenter, yappSymmetric]\n   ,[(shellLength/2)-10,     5, yappLeft, yappRight, yappCenter, yappSymmetric]\n\n   ,[(shellWidth/2)-20,     5, yappFront, yappBack, yappSymmetric]\n   ,[(shellLength/2)-20,     5, yappLeft, yappRight, yappSymmetric]\n\n   ,[(shellWidth/2)-30,     5, yappFront, yappBack, yappCenter, yappSymmetric, yappRectangle]\n   ,[(shellLength/2)-30,     5, yappLeft, yappRight, yappCenter, yappSymmetric, yappRectangle]\n\n   ,[(shellWidth/2)-40,     5, yappFront, yappBack, yappSymmetric, yappRectangle]\n   ,[(shellLength/2)-40,     5, yappLeft, yappRight, yappSymmetric, yappRectangle]\n\n];\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();"
  },
  {
    "path": "examples/YAPP_ViewShapes_v30.scad",
    "content": "\ninclude <../YAPPgenerator_v3.scad>\n\n\n\nif(len(preDefinedShapes) > 0)\n{\n  for(i=[0:len(preDefinedShapes)-1])  \n  {\n    shape=preDefinedShapes[i];\n    translate([10,(i*25)+10,0])\n    {\n      color(\"red\")\n      linear_extrude(1)\n      {\n      \n        scale([20,20,1])\n        polygon(shape[1][1]);\n      }\n      \n      color(\"Black\")\n      translate([0,0,-0.5])\n      linear_extrude(2)\n      {\n        circle(d=1);\n      }\n      \n      color(\"Black\")\n      linear_extrude(1)\n      {  \n        translate([15,-5,0])\n        text(shape[0]);\n      }\n    }\n    \n  }\n}\n      \n\n\n"
  },
  {
    "path": "examples/YAPP_WemosD1mini_v30.scad",
    "content": "//---------------------------------------------------------\n// This design is parameterized based on the size of a PCB.\n//\n//  Script to creates a box for a Wemos D1 mini\n//\n//  Version 1.2 (12-12-2023)\n//\n//---------------------------------------------------------\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n      padding-back|<------pcb length --->|<padding-front\n                            RIGHT\n        0    X-as ---> \n        +----------------------------------------+   ---\n        |                                        |    ^\n        |                                        |   padding-right \n        |                                        |    v\n        |    -5,y +----------------------+       |   ---              \n B    Y |         | 0,y              x,y |       |     ^              F\n A    - |         |                      |       |     |              R\n C    a |         |                      |       |     | pcb width    O\n K    s |         |                      |       |     |              N\n        |         | 0,0              x,0 |       |     v              T\n      ^ |    -5,0 +----------------------+       |   ---\n      | |                                        |    padding-left\n      0 +----------------------------------------+   ---\n        0    X-as --->\n                          LEFT\n*/\n\nprintLidShell       = true;\nprintBaseShell      = true;\n\n// Edit these parameters for your own board dimensions\nwallThickness       = 1.5;\nbasePlaneThickness  = 1.0;\nlidPlaneThickness   = 1.0;\n\nbaseWallHeight      = 5;\nlidWallHeight       = 3;\n\n//-- D E B U G -------------------\nshowSideBySide      = true;\nonLidGap            = 3;\nshiftLid            = 0;\nhideLidWalls        = false;\ncolorLid            = \"yellow\";\nhideBaseWalls       = false;\ncolorBase           = \"white\";\nshowPCB             = false;\nshowMarkers         = false;\ninspectX            = 0;  //-> 0=none (>0 from front, <0 from back)\ninspectY            = 0;  //-> 0=none (>0 from left, <0 from right)\n//-- D E B U G -------------------\n\n// Total height of box = basePlaneThickness + lidPlaneThickness \n//                     + baseWallHeight + lidWallHeight\npcbLength           = 35.0;\npcbWidth            = 26.0;\npcbThickness        = 1.0;\n                            \n// padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1.5;\npaddingLeft         = 1.5;\n\n// ridge where base and lid off box can overlap\n// Make sure this isn't less than lidWallHeight\nridgeHeight         = 3.5;\nridgeSlack          = 0.1;\nroundRadius         = 1.0;\n\n// How much the PCB needs to be raised from the base\n// to leave room for solderings and whatnot\nstandoffHeight      = 2.0;\npinDiameter         = 1.8;\npinHoleSlack        = 0.1;\nstandoffDiameter    = 4;\n\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//   Optional:\n//    p(2) = Height to bottom of PCB : Default = standoffHeight\n//    p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0\n//    p(4) = standoffDiameter    Default = standoffDiameter;\n//    p(5) = standoffPinDiameter Default = standoffPinDiameter;\n//    p(6) = standoffHoleSlack   Default = standoffHoleSlack;\n//    p(7) = filletRadius (0 = auto size)\n//    n(a) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    n(b) = { <yappPin>, yappHole } // Baseplate support treatment\n//    n(c) = { <yappAllCorners>, yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { yappNoFillet }\n//-------------------------------------------------------------------\npcbStands =     \n[\n    [3.6, 3, 2, yappBoth, yappPin, yappBackLeft]                   // back-left\n   ,[3.6, 3.4, 2, yappBoth, yappPin, yappFrontRight]        // back-right\n   ,[3.6, 7, 2, yappBoth, yappHole, yappFrontLeft]       // front-left\n   ,[3.6, 3.4, 2, yappBoth, yappHole, yappBackRight] // front-right\n\n];\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//                        Required                Not Used        Note\n//----------------------+-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be\n//                      |                       |               | provided\n//----------------------+-----------------------+---------------+------------------------------------\n//\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey}\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces\n//-------------------------------------------------------------------\ncutoutsLid =    \n[\n//-- 0,  1,                2,     3, 4, 5\n    [6, -1, (pcbLength-12),       5, 0, yappRectangle]  // left-header\n   ,[6, pcbWidth-4, pcbLength-12, 5, 0, yappRectangle]  // right-header\n   ,[18.7, 8.8,            0,     0, 1, yappCircle]     // blue led\n];\n\n//-- base plane    -- origin is pcb[0,0,0]\n// (0) = posx\n// (1) = posy\ncutoutsBase =   \n[\n    [6, -1, (pcbLength-12), 5, 0, yappRectangle]         // left-header\n   ,[6, pcbWidth-4, pcbLength-12, 5, 0, yappRectangle]   // right-header\n];\n\n//-- front plane  -- origin is pcb[0,0,0]\n// (0) = posy\n// (1) = posz\ncutoutsFront =  \n[\n    [14.0, 1.0, 12.0, 7, 0, yappRectangle, yappCenter]  // microUSB\n];\n\n//-- left plane   -- origin is pcb[0,0,0]\n// (0) = posx\n// (1) = posz\ncutoutsLeft =   \n[\n    [31.0, 0.5, 4.5, 3, 0, yappRectangle, yappCenter]    // reset button\n];\n\n//===================================================================\n//  *** Snap Joins ***\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx | posy\n//    p(1) = width\n//    p(2) = { yappLeft | yappRight | yappFront | yappBack } : one or more\n//   Optional:\n//    n(a) = { <yappOrigin>, yappCenter }\n//    n(b) = { yappSymmetric }\n//    n(c) = { yappRectangle } == Make a diamond shape snap\n//-------------------------------------------------------------------\nsnapJoins   =   \n[\n    [shellLength-17, 5, yappLeft]\n   ,[shellLength-10, 5, yappRight]\n   ,[(shellWidth/2)-2.5, 5, yappBack]\n];\n\n\n//--- this is where the magic happens ---\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_connectors_v30.scad",
    "content": "/*\n***************************************************************************  \n**  Yet Another Parameterised Projectbox generator\n**\n**  Copyright (c) 2021, 2022, 2023, 2024 Willem Aandewiel\n**\n**  With help from:\n**   - Keith Hadley (parameterized label depth)\n**   - Oliver Grafe (connectorsPCB)\n**   - Juan Jose Chong (dynamic standoff flange)\n**   - Dan Drum (cleanup code)\n**   - Dave Rosenhauer (fillets and a lot more)\n**\n**\n**  for many or complex cutouts you might need to adjust\n**  the number of elements:\n**\n**      Preferences->Advanced->Turn of rendering at 250000 elements\n**                                                  ^^^^^^\n**\n**  TERMS OF USE: MIT License. See base offile.\n***************************************************************************      \n*/\n\ninclude <../YAPPgenerator_v3.scad>\n\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 150; // Front to back\npcbWidth            = 150; // Side to side\npcbThickness        = 1.6;\n\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n// -- Render --\nrenderQuality             = 8;          //-> from 1 to 32, Default = 8\n\n// --Preview --\npreviewQuality            = 5;          //-> from 1 to 32, Default = 5\nshowSideBySide            = false;       //-> Default = true\nonLidGap                  = 1;  // tip don't override to animate the lid opening\n//onLidGap                  = ((ridgeHeight) - (ridgeHeight * abs(($t-0.5)*2)))*2;  // tip don't override to animate the lid opening/closing\ncolorLid                  = \"YellowGreen\";   \nalphaLid                  = 1;\ncolorBase                 = \"BurlyWood\";\nalphaBase                 = 1;\nhideLidWalls              = false;      // Remove the walls from the lid : only if preview and showSideBySide=true \nhideBaseWalls             = false;      // Remove the walls from the base : only if preview and showSideBySide=true  \nshowOrientation           = true;       // Show the Front/Back/Left/Right labels : only in preview\nshowPCB                   = false;      // Show the PCB in red : only in preview \nshowSwitches              = false;      // Show the switches (for pushbuttons) : only in preview \nshowButtonsDepressed      = false;       // Should the buttons in the Lid On view be in the pressed position\nshowOriginCoordBox        = false;      // Shows red bars representing the origin for yappCoordBox : only in preview \nshowOriginCoordBoxInside  = false;      // Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowOriginCoordPCB        = false;      // Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowMarkersPCB            = false;      // Shows black bars corners of the PCB : only in preview \nshowMarkersCenter         = false;      // Shows magenta bars along the centers of all faces  \ninspectX                  = 8;          //-> 0=none (>0 from Back)\ninspectY                  = 0;          //-> 0=none (>0 from Right)\ninspectZ                  = 0;          //-> 0=none (>0 from Bottom)\ninspectXfromBack          = true;       //-> View from the inspection cut foreward\ninspectYfromLeft          = true;       //-> View from the inspection cut to the right\ninspectZfromBottom        = true;       //-> View from the inspection cut up\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n\n\n//===================================================================\n//  *** Connectors ***\n//  Standoffs with hole through base and socket in lid for screw type connections.\n//-------------------------------------------------------------------\n//  Default origin = yappCoordPCB : pcb[0,0,0]\n//  \n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//    p(2) = StandHeight : From specified origin \n//    p(3) = screwDiameter\n//    p(4) = screwHeadDiameter (don't forget to add extra for the fillet)\n//    p(5) = insertDiameter\n//    p(6) = outsideDiameter\n//   Optional:\n//    p(7) = insert Depth : default to entire connector\n//    p(8) = PCB Gap : Default if yappCoordPCB then pcbThickness else 0\n//    p(9) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }\n//    n(b) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(c) = { yappNoFillet }\n//    n(d) = { yappCountersink }\n//    n(e) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(f) = { yappThroughLid = changes the screwhole to the lid and the socket to the base}\n//-------------------------------------------------------------------\nconnectors   =\n[\n//  [ 10, 10, 4, 3, 5, 4, 7, yappAllCorners], // All of the corners of the PCB inset 10,10\n//  [ 8, 8, 4, 3, 5, 4, 7, yappCoordBox], //Defaults to yappBackLeft of yappCoordBox\n//  [ 8-wallThickness, 28, 4, 3, 5, 4, 7, 5, 1.6, yappBackLeft, yappCoordBoxInside], // Shifted so that they all aligh for inspection cut\n//  [ 8-pcbX(), 48, 4, 3, 5, 4, 7, 16, yappBackLeft], // Shifted so that they all aligh for inspection cut\n  [ 8, 68, 14, 3, 5, 4, 7, 6, yappBackLeft, yappCoordBox], // Shifted so that they all aligh for inspection cut\n  [ 8, 38, 14, 3, 5, 4, 7, 6, yappBackLeft, yappCoordBox, yappThroughLid], // Shifted so that they all aligh for inspection cut\n];\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/YAPP_cutouts_from_inside_v30.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0 (03-12-2023)\n//\n// This design is parameterized based on the size of a PCB.\n//\n//  You might need to adjust the number of elements:\n//\n//      Preferences->Advanced->Turn of rendering at 250000 elements\n//                                                  ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n// Note: length/lengte refers to X axis, \n//       width/breedte to Y, \n//       height/hoogte to Z\n\n/*\n            padding-back>|<---- pcb length ---->|<padding-front\n                                 RIGHT\n                   0    X-ax ---> \n               +----------------------------------------+   ---\n               |                                        |    ^\n               |                                        |   padding-right \n             ^ |                                        |    v\n             | |    -5,y +----------------------+       |   ---              \n        B    Y |         | 0,y              x,y |       |     ^              F\n        A    - |         |                      |       |     |              R\n        C    a |         |                      |       |     | pcb width    O\n        K    x |         |                      |       |     |              N\n               |         | 0,0              x,0 |       |     v              T\n               |   -5,0  +----------------------+       |   ---\n               |                                        |    padding-left\n             0 +----------------------------------------+   ---\n               0    X-ax --->\n                                 LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = false;\n\n//-- pcb dimensions -- very important!!!\npcbLength           = 250; // Front to back\npcbWidth            = 100; // Side to side\npcbThickness        = 1.6;\n                            \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.0;\nbasePlaneThickness  = 1.25;\nlidPlaneThickness   = 1.25;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 25;\nlidWallHeight       = 23;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.2;\nroundRadius         = 2.0;\n\n//-- How much the PCB needs to be raised from the base\n//-- to leave room for solderings and whatnot\nstandoffHeight      = 10.0;  //-- used only for pushButton and showPCB\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\nstandoffDiameter    = 8;\n\n\n\n//-- C O N T R O L -------------//-> Default ---------\nshowSideBySide      = true;     //-> true\npreviewQuality      = 5;        //-> from 1 to 32, Default = 5\nrenderQuality       = 6;        //-> from 1 to 32, Default = 8\nonLidGap            = 2;\nshiftLid            = 5;\ncolorLid            = \"gray\";   \nalphaLid            = 1;//0.2;   \ncolorBase           = \"yellow\";\nalphaBase           = 1;//0.2;\nhideLidWalls        = false;    //-> false\nhideBaseWalls       = false;    //-> false\nshowOrientation     = true;\nshowPCB             = false;\nshowSwitches        = false;\nshowPCBmarkers      = false;\nshowShellZero       = false;\nshowCenterMarkers   = false;\ninspectX            = 0;        //-> 0=none (>0 from Back)\ninspectY            = 0;        //-> 0=none (>0 from Right)\ninspectZ            = 0;        //-> 0=none (>0 from Bottom)\ninspectXfromBack    = true;     // View from the inspection cut foreward\ninspectYfromLeft    = true;     //-> View from the inspection cut to the right\ninspectZfromTop     = false;    //-> View from the inspection cut down\n//-- C O N T R O L ---------------------------------------\n\n//===================================================================\n//  *** Cutouts ***\n//    There are 6 cutouts one for each surface:\n//      cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight\n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//                        Required                Not Used        Note\n//----------------------+-----------------------+---------------+------------------------------------\n//  yappRectangle       | width, length         | radius        |\n//  yappCircle          | radius                | width, length |\n//  yappRoundedRect     | width, length, radius |               |     \n//  yappCircleWithFlats | width, radius         | length        | length=distance between flats\n//  yappCircleWithKey   | width, length, radius |               | width = key width length=key depth\n//  yappPolygon         | width, length         | radius        | yappPolygonDef object must be\n//                      |                       |               | provided\n//----------------------+-----------------------+---------------+------------------------------------\n//\n//  Parameters:\n//   Required:\n//    p(0) = from Back\n//    p(1) = from Left\n//    p(2) = width\n//    p(3) = length\n//    p(4) = radius\n//    p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect \n//                    | yappCircleWithFlats | yappCircleWithKey }\n//  Optional:\n//    p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)\n//    p(7) = angle : Default = 0\n//    n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -\n//    n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask \n//                             for the cutout.\n//    n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added \n//                              it will be used as a mask for the cutout. With the Rotation \n//                              and offsets applied. This can be used to fine tune the mask\n//                              placement within the opening.\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { <yappOrigin>, yappCenter }\n//    n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces\n//    n(g) = [yappPCBName, \"XXX\"] : Specify a PCB. Defaults to [yappPCBName, \"Main\"]\n//    n(h) = { yappFromInside } Make the cut from the inside towards the outside\n//-------------------------------------------------------------------\n\ncutoutsBase = \n[\n];\n\ncutoutsLid  = \n[\n\n//yappCenter demo\n/*\n    [10, 10, 10, 20, undef, yappRectangle]                              //(A)\n   ,[10, 50, 10, 20, undef, yappRectangle, yappCenter]                  //(B)\n\n   ,[30, 10, undef, undef, 5, yappCircle, ]                             //(C)\n   ,[30, 50, undef, undef, 5, yappCircle, yappCenter]                   //(D)\n \n   ,[50, 10, 10, 20, 2, yappRoundedRect, ]                              //(E)\n   ,[50, 50, 10, 20, 2, yappRoundedRect, yappCenter]                    //(F)\n \n   ,[70, 10, 15, undef, 10, yappCircleWithFlats, ]                      //(G)\n   ,[70, 50, 15, undef, 10, yappCircleWithFlats, yappCenter]            //(H)\n \n   ,[90, 10, 5, 2, 8, yappCircleWithKey, ]                              //(I)\n   ,[90, 50, 5, 2, 8, yappCircleWithKey, yappCenter]                    //(J)\n \n   ,[110, 10, 20, 20, undef, yappPolygon, shape6ptStar]                 //(K)\n   ,[110, 50, 20, 20, undef, yappPolygon, shape6ptStar, yappCenter]     //(L)\n   \n*/\n\n\n // [0, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter]                              //(A)\n [25, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter]                              //(A)\n ,[50, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter]                              //(A)\n ,[75, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter]                              //(A)\n ,[100, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter]                              //(A)\n ,[125, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter]                              //(A)\n ,[150, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter]                              //(A)\n ,[175, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter]                              //(A)\n ,[200, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter]                              //(A)\n\n ,[25, 40, 20, 20, undef, yappPolygon, 1.5, $t*360, shapeIsoTriangle, yappCenter, yappFromInside]\n ,[50, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeIsoTriangle2, yappCenter]\n ,[75, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeHexagon, yappCenter]\n ,[100, 40, 20, 20, undef, yappPolygon, undef, $t*360, shape6ptStar, yappCenter]\n ,[125, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeTriangle, yappCenter]\n ,[150, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeTriangle2, yappCenter]\n ,[175, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeArrow, yappCenter]\n// ,[200, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeArrow2, yappCenter]\n \n // Mask Demo\n//   ,[ 160, 55, 50, 50, 10, yappRectangle, 1, shapeHexagon, [maskHoneycomb,0,0,0], yappCenter, yappFromInside]\n//   ,[ 160, 55, 50, 50, 10, yappRectangle, 1, shapeHexagon, [maskHoneycomb,0,0,0], yappCenter, yappFromInside]\n];\n\ncutoutsFront = \n[\n];  \n\n\ncutoutsBack = \n[\n];\n\n\ncutoutsLeft = \n[\n //--  0,  1,  2,  3, 4, 5,6,7,n\n//    [ 30,  3, 25, 15, 3, yappRoundedRect, 1]\n //  ,[ 60, 3, 25, 15, 3, yappRoundedRect, 1, yappFromInside] \n //  ,[ 20, 1, 5, 5, 1, yappRoundedRect, 5, yappFromInside, yappCoordBox] // Cuts out into mounting tab\n];\n\ncutoutsRight = \n[\n];\n\n\n//===================================================================\n//  *** Box Mounts ***\n//  Mounting tabs on the outside of the box\n//-------------------------------------------------------------------\n//  Default origin = yappCoordBox: box[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X.\n//                    Position is to center of mounting screw in leftmost position in slot\n//    p(1) = screwDiameter\n//    p(2) = width of opening in addition to screw diameter \n//                    (0=Circular hole screwWidth = hole twice as wide as it is tall)\n//    p(3) = height\n//   Optional:\n//    p(4) = filletRadius : Default = 0/Auto(0 = auto size)\n//    n(a) = { yappLeft | yappRight | yappFront | yappBack } : one or more\n//    n(b) = { yappNoFillet }\n//    n(c) = { <yappBase>, yappLid }\n//    n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of \n//                            the left of the opening\n//    n(e) = { <yappGlobalOrigin>, yappLeftOrigin } : Only affects Back and Right Faces\n//-------------------------------------------------------------------\nboxMounts =\n[\n//  [20, 6, 6, 3, yappLeft]\n];\n\n\n\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  },
  {
    "path": "examples/pcbStandTest.scad",
    "content": "//-----------------------------------------------------------------------\n// Yet Another Parameterized Projectbox generator\n//\n//  This is a box for <template>\n//\n//  Version 3.0.1 (2024-01-15)\n//\n// This design is parameterized based on the size of a PCB.\n//\n// For many/complex cutoutGrills, you might need to adjust\n//  the max number of elements in OpenSCAD:\n//\n//      Preferences->Advanced->Turn off rendering at 250000 elements\n//                                                   ^^^^^^\n//\n//-----------------------------------------------------------------------\n\ninclude <../YAPPgenerator_v3.scad>\n\n//---------------------------------------------------------\n// This design is parameterized based on the size of a PCB.\n//---------------------------------------------------------\n// Note: length/lengte refers to X axis, \n//       width/breedte refers to Y axis,\n//       height/hoogte refers to Z axis\n\n/*\n      padding-back|<------pcb length --->|<padding-front\n                            RIGHT\n        0    X-axis ---> \n        +----------------------------------------+   ---\n        |                                        |    ^\n        |                                        |   padding-right \n      Y |                                        |    v\n      | |    -5,y +----------------------+       |   ---              \n B    a |         | 0,y              x,y |       |     ^              F\n A    x |         |                      |       |     |              R\n C    i |         |                      |       |     | pcb width    O\n K    s |         |                      |       |     |              N\n        |         | 0,0              x,0 |       |     v              T\n      ^ |    -5,0 +----------------------+       |   ---\n      | |                                        |    padding-left\n      0 +----------------------------------------+   ---\n        0    X-as --->\n                          LEFT\n*/\n\n\n//-- which part(s) do you want to print?\nprintBaseShell        = true;\nprintLidShell         = true;\nprintSwitchExtenders  = false;\n\n\n// ********************************************************************\n// The Following will be used as the first element in the pbc array\npcbLength           = 100; // Front to back\npcbWidth            = 20; // Side to side\npcbThickness        = 1.6;\nstandoffHeight      = 10.0;  //-- How much the PCB needs to be raised from the base to leave room for solderings and whatnot\nstandoffDiameter    = 7;\nstandoffPinDiameter = 2.4;\nstandoffHoleSlack   = 0.4;\n\n//===================================================================\n// *** PCBs ***\n// Printed Circuit Boards\n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : yappCoordBoxInside[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = name\n//    p(1) = length\n//    p(2) = width\n//    p(3) = posx\n//    p(4) = posy\n//    p(5) = Thickness\n//    p(6) = standoffHeight\n//    p(7) = standoffDiameter\n//    p(8) = standoffPinDiameter\n//    p(9) = standoffHoleSlack (default to 0.4)\n//   Optional:\n\n//The following can be used to get PCB values elsewhere in the script - not in pcb definition. \n//If \"PCB Name\" is omitted then \"Main\" is used\n//  pcbLength           --> pcbLength(\"PCB Name\")\n//  pcbWidth            --> pcbWidth(\"PCB Name\")\n//  pcbThickness        --> pcbThickness(\"PCB Name\") \n//  standoffHeight      --> standoffHeight(\"PCB Name\") \n//  standoffDiameter    --> standoffDiameter(\"PCB Name\") \n//  standoffPinDiameter --> standoffPinDiameter(\"PCB Name\") \n//  standoffHoleSlack   --> standoffHoleSlack(\"PCB Name\") \n\npcb = \n[\n  [\"Main\",              pcbLength,pcbWidth,    0,0,    pcbThickness,  standoffHeight, standoffDiameter, standoffPinDiameter, standoffHoleSlack]\n];\n\n//-------------------------------------------------------------------\n  \n//-- padding between pcb and inside wall\npaddingFront        = 1;\npaddingBack         = 1;\npaddingRight        = 1;\npaddingLeft         = 1;\n\n//-- Edit these parameters for your own box dimensions\nwallThickness       = 2.4;\nbasePlaneThickness  = 1.2;\nlidPlaneThickness   = 1.2;\n\n//-- Total height of box = lidPlaneThickness \n//                       + lidWallHeight \n//--                     + baseWallHeight \n//                       + basePlaneThickness\n//-- space between pcb and lidPlane :=\n//--      (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)\nbaseWallHeight      = 9;\nlidWallHeight       = 17;\n\n//-- ridge where base and lid off box can overlap\n//-- Make sure this isn't less than lidWallHeight\nridgeHeight         = 5.0;\nridgeSlack          = 0.2;\nroundRadius         = 3.0;\n\n// Set the layer height of your printer\nprinterLayerHeight  = 0.2;\n\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n// -- Render --\nrenderQuality             = 8;          //-> from 1 to 32, Default = 8\n\n// --Preview --\npreviewQuality            = 5;          //-> from 1 to 32, Default = 5\nshowSideBySide            = false;       //-> Default = true\nonLidGap                  = 10;  // tip don't override to animate the lid opening\ncolorLid                  = \"YellowGreen\";   \nalphaLid                  = 1;\ncolorBase                 = \"BurlyWood\";\nalphaBase                 = 1;\nhideLidWalls              = false;      //-> Remove the walls from the lid : only if preview and showSideBySide=true \nhideBaseWalls             = false;      //-> Remove the walls from the base : only if preview and showSideBySide=true  \nshowOrientation           = true;       //-> Show the Front/Back/Left/Right labels : only in preview\nshowPCB                   = false;      //-> Show the PCB in red : only in preview \nshowSwitches              = true;      //-> Show the switches (for pushbuttons) : only in preview \nshowButtonsDepressed      = false;      //-> Should the buttons in the Lid On view be in the pressed position\nshowOriginCoordBox        = false;      //-> Shows red bars representing the origin for yappCoordBox : only in preview \nshowOriginCoordBoxInside  = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowOriginCoordPCB        = false;      //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview \nshowMarkersPCB            = false;      //-> Shows black bars corners of the PCB : only in preview \nshowMarkersCenter         = false;      //-> Shows magenta bars along the centers of all faces  \ninspectX                  = 0;          //-> 0=none (>0 from Back)\ninspectY                  = 13.5;          //-> 0=none (>0 from Right)\ninspectZ                  = 0;          //-> 0=none (>0 from Bottom)\ninspectXfromBack          = true;       //-> View from the inspection cut foreward\ninspectYfromLeft          = true;       //-> View from the inspection cut to the right\ninspectZfromBottom        = true;       //-> View from the inspection cut up\n//---------------------------\n//--     C O N T R O L     --\n//---------------------------\n\n//===================================================================\n// *** PCB Supports ***\n// Pin and Socket standoffs \n//-------------------------------------------------------------------\n//  Default origin =  yappCoordPCB : pcb[0,0,0]\n//\n//  Parameters:\n//   Required:\n//    p(0) = posx\n//    p(1) = posy\n//   Optional:\n//    p(2) = Height to bottom of PCB : Default = standoff_Height\n//    p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcb_Thickness, yappCoordBox=0\n//    p(4) = standoff_Diameter    Default = standoff_Diameter;\n//    p(5) = standoff_PinDiameter Default = standoff_PinDiameter;\n//    p(6) = standoff_HoleSlack   Default = standoff_HoleSlack;\n//    p(7) = filletRadius (0 = auto size)\n//    p(8) = Pin Length : Default = 0 -> PCB Gap + standoff_PinDiameter\n//             Indicated length of pin without the half sphere on top\n//    n(a) = { <yappBoth> | yappLidOnly | yappBaseOnly }\n//    n(b) = { <yappPin>, yappHole, yappTopPin } \n//             yappPin = Pin on Base and Hole on Lid \n//             yappHole = Hole on Both\n//             yappHole = Hole on Base and Pin on Lid\n//    n(c) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }\n//    n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }\n//    n(e) = { yappNoFillet } : Removes the internal and external fillets and the Rounded tip on the pins\n//    n(f) = [yappPCBName, \"XXX\"] : {Specify a PCB defaults to \"Main\"\n//-------------------------------------------------------------------\npcbStands = \n[\n  [5,  10, undef, undef, 2, 1]  // Original method\n ,[15,  10, undef, undef, 4, 2, undef, undef, pcbThickness() + 2 ] // Custom Length of PCB Thickness + 2\n ,[25,  10, undef, undef, 4, 2, undef, undef, 999 , yappHole]  // Default Hole in Lid and Pin in Base Pin Length is ignored\n ,[35,  10, undef, undef, 4, 2, yappHole]  // Default Hole in Lid and Pin in Base Pin Length is ignored\n ,[45,  10, undef, undef, 4, 2, undef, undef, pcbThickness() +2 , yappTopPin] //  Hole in Base and Pin in Lid\n ,[55,  10, undef, undef, 4, 2, undef, undef, pcbThickness() +2 , yappNoFillet] // No Outer Fillet\n ,[65,  10, undef, undef, 4, 2, undef, undef, 4 ] // Custom Length of 4\n ,[75,  10, undef, undef, 4, 2, undef, undef, -0.0001 ] // Custom Length of Zero (have to use 0.0001 so it's not actually zero so the default isn't used\n];\n\n//---- This is where the magic happens ----\nYAPPgenerate();\n"
  }
]