What you need

Download the YAPP_Box as a .zip file

You can download the YAPP_Box as a “.zip” file from github.

Extract the “YAPP_Box-main.zip” file into your openSCAD projects folder. You now have a new folder “YAPP_Box-main” containing several sample files and the YAPPgenerator.scad library. As there are many examples in this folder I would leave the folder structure as it is and copy the examples (in the examples sub-folder) you want to try out to your opensSCAD project folder. Also best practise is not to change the YAPP_Template.scad file but save a copy to the folder where you want to make a new project box. That way you leave the YAPP_Template.scad in tact for your next project.

Depending on how you downloaded YAPP (git clone or by a .zip file) YAPP_Box_main sometimes is named YAPP_Box

Clone the YAPP_Box from github

If you have git installed on your computer you can also clone the YAPP_Box. Click on the two squares icon to copy the URL to the clipboard.

Now, in a terminal window go to the folder where you want to save the library and clone the YAPP_Box using the URL you just copied to the clipboard:

cd <myOpenScadProject Folder>
git clone https://github.com/mrWheel/YAPP_Box.git

You now have a folder that looks like this:

Where to put the YAPPgenerator.scad

In the folder "YAPP_Box" you will find the YAPPgenerator.scad file that is the backbone of the library. There are three ways to organize the way you want to work with the YAPPgenerator.

  • [1] Save the YAPPgenerator.scad library in the library folder of your openSCAD installation

And place the YAPPgenerator.scad file in that folder.

Now, in your openSCAD programs you can include this (now global) library with the following code:

// your openSCAD program
include <YAPPgenerator.scad>
   .
// your program code goes here
   .
//---- This is where the magic happens ----
YAPPgenerate();
  • [2] Save the YAPPgenerator library in a convenient folder of your choice or leave it at YAPP_Box (if you git-cloned the library) or at YAPP_Box-main (if you downloaded the library as a .zip file). In all your openSCAD programs you need to use the exact location of the YAPPgenerator.scad library. If, for instance, you have placed the library in the folder "/User/openScadProjects/YAPP_Box-main" your program should look like this:

// your openSCAD program
include </User/openScadProjects/YAPP_Box-main/YAPPgenerator.scad>
   .
// your program code goes here
   .
//---- This is where the magic happens ----
YAPPgenerate();
  • [3] Save the YAPPgenerator library in the same folder where you write the code for a box you want to make. You can now insert the library as in the next code fragment:

// your openSCAD program
include <YAPPgenerator.scad>
// or: include <./YAPPgenerator.scad>
   .
// your program code goes here
   .
//---- This is where the magic happens ----
YAPPgenerate();

Pros and Cons of the three methods

  1. If you place the library in the openSCAD global library folder:

    • Pro: Conveniënt especially if you are not over organized. You have only one copy of the YAPPgenerator library.

    • Con: If you update the library to a new version there is a change your previously created boxes won't compile or have a different outcome.

  2. If you place the library in a folder of your choosing:

    • Pro: You only have one copy of the library.

    • Con: You have to use the whole path to the library in all your box-programs. If you update the library to a new version there is a change your previously created boxes won't compile or won't look the same.

  3. If you save the YAPPgenerator library in the same folder where you create a project:

    • Pro: Even if you install a new version of the YAPPgenerator library this won't influence your box-program (as long as you don't save the new library in your project-box folder).

    • Con: You have multiple copies of the library on your system.

Of course you can store a "production version" in the global library folder (1) and a "new version" in the same folder where create a project box (3) so you can test the new functionality/API of the library.

Last updated