/YAPP_Box

Yet Another Parametric Projectbox Box

Primary LanguageOpenSCADMIT LicenseMIT

YAPP_Box

Yet Another Parametric Projectbox generator

You can find the complete and official documentation here


Rev. 1.6

  • new cutoutGrills array
//-- cutoutGrills    -- origin is box[x0,y0]
// (0) = xPos
// (1) = yPos
// (2) = grillWidth
// (3) = grillLength
// (4) = gWidth
// (5) = gSpace
// (6) = gAngle
// (7) = plane [ "base" | "lid" ]
// (8) = {polygon points} (optional)


cutoutGrills = [
                 [22, 22, 90, 90, 2, 3, 50, "base", [  [0,15],[20,15],[30,0],[40,15],[60,15]
                                                      ,[50,30],[60,45], [40,45],[30,60]
                                                      ,[20,45], [0,45],[10,30] ]
                 ]
                ,[15, 10, 50, 10, 2, 3, -20, "base"]
                ,[15, 15, 10, 50, 2, 3, -45, "lid"]
                ,[15, 85, 50, 10, 2, 3,  20, "base"]
                ,[85, 15, 10, 50, 2, 3,  45, "lid"]
               ];

cutoutGrills-v16

Be aware: this functionality needs a huge amount of rendering elements.

You can set this at Preferences->Advanced->Turn of rendering at 100000 elements


Rev. 1.5

  • Various bug-fixes
  • Connectors now have a flange at the basePlane and lidPlane for a better adhesion

This release breaks with previous releases in the extra parm "depth" in the labels array!!

The labels now have this syntax:

//-- origin of labels is box [0,0,0]
// (0) = posx
// (1) = posy/z
// (2) = orientation
// (3) = depth
// (4) = plane {lid | base | left | right | front | back }
// (5) = font
// (6) = size
// (7) = "label text"

Example:

labelsPlane = [
                [10,  10,   0, 0.6, "lid",   "Liberation Mono:style=bold", 15, "YAPP" ]
               ,[100, 90, 180, 0.8, "base",  "Liberation Mono:style=bold", 11, "Base" ]
               ,[8,    8,   0, 1.0, "left",  "Liberation Mono:style=bold",  7, "Left" ]
               ,[10,   5,   0, 1.2, "right", "Liberation Mono:style=bold",  7, "Right" ]
               ,[40,  23,   0, 1.5, "front", "Liberation Mono:style=bold",  7, "Front" ]
               ,[5,    5,   0, 2.0, "back",  "Liberation Mono:style=bold",  8, "Back" ]
              ];

For your box to work with this release as before you have to add this extra parm (as "wallThickness/2", "basePlaneThickness/2" or "lidPlaneThickness/2").

Thanks to Keith Hadley

There now is a new array for connectors that holds the PCB. This array is called "connectorsPCB".

//-- connectorsPCB -- origin = pcb[0,0,0]
// (0) = posx
// (1) = posy
// (2) = screwDiameter
// (3) = insertDiameter
// (4) = outsideDiameter
// (5) = { yappAllCorners }

Example:

connectorsPCB = [
                  [pcbLength/2, 10, 2.5, 3.8, 5]
                 ,[pcbLength/2, pcbWidth-10, 2.5, 3.8, 5]
                ];

It takes in account the "pcbThickness" to calculate the hight of the lid-connector.

Thanks to Oliver Grafe

connectorTypes


Rev. 1.4

This release breaks with previous releases in the extra parm "angle" in all the cutouts array's!!!

All plane array's now have this syntax:

//-- plane    -- origin is pcb[0,0,0]
// (0) = posx
// (1) = posy
// (2) = width
// (3) = length
// (4) = angle
// (5) = { yappRectangle | yappCircle }
// (6) = { yappCenter }

For your box to work with this release you have to add this extra parm (as "0") to all your cutOut-array-row's

THIS IS WORK IN PROGRESS!!

See: This Post (English) or This Post (in Dutch)


I have done my best but it can probably be done simpler. So, if you think you can help please contact me or make a Merge Request.

TO DO

  • I want rounded corners! Do you have an idear howto do that?? (done)
  • modules (Hooks) that can be (re)defined by the user (almost there ;-)) (done)
  • screw connector between the top- and bottomPlanes (for bigger boxes) (done)
  • snap-ons in the ridges (done)
  • Rotate rectangular cutOuts (orientation) v1.4
  • Connectors that holds the PCB in place v1.5 (Oliver Grafe)
  • Variable depth of labels v1.5 (Keithe Hadley)
  • anything else? Anyone?

How to program your Project Box

It all starts with some dimensions of the pcb you want your Project Box for and some other dimensions:

printBaseShell      = true;
printLidShell       = true;

// Edit these parameters for your own board dimensions
wallThickness       = 1.0;
basePlaneThickness  = 1.0;
lidPlaneThickness   = 1.0;

// Total height of box = basePlaneThickness + lidPlaneThickness 
//                     + baseWallHeight + lidWallHeight

baseWallHeight      = 7;
lidWallHeight       = 4;

pcbLength           = 88;
pcbWidth            = 49;
pcbThickness        = 1.5;
                            
// padding between pcb and inside wall
paddingFront        = 4;
paddingBack         = 1;
paddingRight        = 1;
paddingLeft         = 1;

// ridge where Base- and Lid- off the box can overlap
// Make sure this isn't less than lidWallHeight
ridgeHeight         = 3;
ridgeSlack          = 0.2;
roundRadius         = 2.0;  // don't make this to big..

//-- How much the PCB needs to be raised from the base
//-- to leave room for solderings and whatnot
standoffHeight      = 5.0;
pinDiameter         = 1.0;
pinHoleSlack        = 0.5;
standoffDiameter    = 4;

You probably want some cutouts in your box for connectors and stuff. For every plane (side) of the Project Box there is an array that holds the cutouts for that plane.

These examples are made with Rev. 1.3!

For Rev. 1.4 to work you need to add the extra parm angle in all cutouts array's!!

A picture is worth a thousand words ...

cutouts in the Right Plane:

YAPP_cutoutsRight

cutouts in the Left Plane:

YAPP_cutoutsLeft

cutouts in the Back Plane:

YAPP_cutoutsBack

cutouts in the Front Plane:

YAPP_cutoutsFront

cutouts in the Base:

YAPP_cutoutsBase

cutouts in the Lid:

YAPP_cutoutsLid

Using the (new) angle parm (rotate around the x/y corner):

yappRectangle40dgrs

With yappCenter the rectangle will rotate around it's center point:

yappRectangleCenter10dgrs

Base mounts:

Screenshot 2022-01-25 at 11 25 46

pcbStands:

pcbStands fixate the PCB between the base and the lid. YAPP_pcbStands

Connectors between Base and Lid:

YAPP_connectors

ConnectorsPCB between Base and Lid that fixates the PCB:

connectorTypes

YAPP_connector_D

Inserts are great for making a screw connection between the base and the lid. Ruthex-insert-a

Thats it! Press F5 or F6 to see the results of your work!

Snap Joins:

snapJoins1

snapJoins2

Snap Joins Symmetrical:

snapJoinsSymetric

(more) Base Mounts:

yappBaseStand

yappBaseStand3D

Hooks:

There are two type of "hooks"; at the inside of the box or at the outside of the box

baseHookOutside():

baseHookOutside

baseHookOutside3D

lidHookInside():

lidHooksInside1

lidHooksInside3Db

lidHooksInside3Da


Buy me a coffee (please)!

If you like this project or it saved you time, you can give me a cup of coffee :)

bmc-button-75