YAPPgenerator_en
  • Yet Another Parametric Projectbox generator
  • What you need
  • Getting Started
  • Design Philosophy
  • Coordinate Systems
  • YAPPgenerator API
  • YAPP Box Settings
    • Multiple PCBs
  • Standoffs
    • pcbStands (advanced)
  • Connecting Base and Lid
    • Connecting Base and Lid (advanced)
  • Cutouts
    • n(h) - yappFromInside
    • p(6) - Cutout Depth
    • Placement of the project box
      • Cutouts in the Base Plane
      • Cutouts in the Lid Plane
      • Cutouts in the Front Plane
      • Cutouts in the Back Plane
      • Cutouts in the Left Plane
      • Cutouts in the Right Plane
    • Shapes
    • Optional Parameters
      • p(7) - Angle
      • n(a) = Polygon Definition
      • n(b)/n(c) - Mask Definition
      • n(d) - Coordinate System
      • n(e) - Position reference
      • n(f) - Alternate Origin
      • n(g) - PCB Selection
  • Box Mounts
    • boxMounts (advanced)
  • Snap Joins
  • Light Tubes
  • Push Buttons
    • Optional Parameters
  • Ridge Extension
  • Labels
  • Images
  • Hooks
  • Debugging
  • Advanced Options
    • Specify a PCB
    • Position reference
    • Polygon Definitions
    • Mask Definitions
  • Generating STL file from KiCad
  • License
Powered by GitBook
On this page

Getting Started

PreviousWhat you needNextDesign Philosophy

Last updated 11 months ago

To use the YAPP API you need at a minimum the following:

include <./YAPPgenerator_v3.scad>
YAPPgenerate();

This assumes that the YAPPgenerator_v3.scad library file is in the same location as your script. If it is in another location update the "./" as needed to locate the library (see ).

These two lines of code will include the API and generate a box (in this case with all of the default settings).

While this will get you "a box" it won't get you "your box". To get "your box" you will need to add all of the options that you need.

The Simplest Project Box

The YAPPgenerator assumes a lot of default values that you should override to the needs of your project box. So in addition to the two lines that are always needed you have to tell the YAPPgenerator the specifics of "your box".

First of all the YAPPgenerator needs the length, width and the thickness of the Printed Circuit Board (PCB) to calculate the size of the project box.

/*
**  The Simplest Project Box
**  The YAPPgenerator.scad library is in the 
**  project box folder
*/

include <YAPPgenerator_v3.scad>

pcbLength     = 40;
pcbWidth      = 30;
pcbThickness  =  2;

YAPPgenerate();

This will result in this project box:

The Lid (green) will fit nicely over the Base (brown). But it would be nice if the Lid snaps on to the Base so it won't come off easily.

Thats where snap joins come in handy.

By simply adding the following array to the code (actually snapJoins is an array that, in this example, has two elements in it that both ara also array's):

//  *** Snap Joins ***
snapJoins   =   
[
    [6, 5, yappLeft, yappRight]
   ,[pcbLength-6, 5, yappLeft, yappRight]
];

The first element tells the YAPPgenerator to add a snap-join with a length of 5mm at 6mm from the back of the box to both the left and right of the box. The second element tells the YAPPgenerator to add a snap-join of also 5mm at 'pcbLength-6' or '40-6' or 34mm from the back (which is 6mm from the front) and also at the left and the right of the box. The resulting box looks like this:

The snapJoins will click in each other and keep the Lid firmly connected with the Base.

Next we like to have control over the height of the Lid and Base. You can do that by adding the next two lines of code:

lidWallHeight  = 10;
baseWallHeight = 15;

The inside height of the project box will now be 25mm.

The complete code to generate the above project box:

/*
**  The Simplest Project Box
**  The YAPPgenerator.scad library is in the 
**  project box folder
*/

include <YAPPgenerator_v3.scad>

pcbLength      = 40;
pcbWidth       = 30;
pcbThickness   =  2;

lidWallHeight  = 10;
baseWallHeight = 15;

snapJoins   =   
[
    [6, 5, yappLeft, yappRight]
   ,[pcbLength -6, 5, yappLeft, yappRight]
];

YAPPgenerate();

To make use of all the available options of the YAPPgenerator you best read the rest of this document and use the YAPP_Template.scad file as a boilerplate (just remove everything you don't need).

What you need
Simplest Project Box
Simple Box with snapJoins
Lid snapped on the Base