> Canonical HTML: https://kerfscript.mylasertools.com/models/project-enclosure/

# Project enclosure

Project enclosure: a box for a small electronics project, its lid held by four M3 screws and nuts so it comes off again. The front has a switch and a power jack, the back a USB port, and the lid and the sides vents. Change the cutouts to suit your board.

This design has 6 parts on 1 sheet. Customize it in the [playground](https://kerfscript.mylasertools.com/playground/?model=project-enclosure).

## Downloads

- [KerfScript source](https://kerfscript.mylasertools.com/models/project-enclosure/project-enclosure.kerf)
- [SVG](https://kerfscript.mylasertools.com/models/project-enclosure/project-enclosure.svg)
- [DXF](https://kerfscript.mylasertools.com/models/project-enclosure/project-enclosure.dxf)

## Parts

| Part | Quantity | Size |
| --- | ---: | --- |
| bottom | 1 | 144 × 94 mm |
| lid | 1 | 150 × 100 mm |
| front | 1 | 144 × 57 mm |
| back | 1 | 144 × 57 mm |
| left | 1 | 94 × 57 mm |
| right | 1 | 94 × 57 mm |

## Settings

| Name | Default | Range or choices |
| --- | --- | --- |
| `width` | `150` | 80 to 300 |
| `depth` | `100` | 60 to 250 |
| `height` | `60` | 40 to 150 |
| `vents` | `true` | on or off |
| `screw` | `3` | 2.5, 3, 4 |
| `screw_length` | `12` | 10 to 25 |
| `$thickness` | `3` | 3 to 6 |
| `$kerf` | `0.15` | 0 to 0.3 |

## Source

```kerf
// Project enclosure: a box for a small electronics project, its lid held
// by four M3 screws and nuts so it comes off again. The front has a
// switch and a power jack, the back a USB port, and the lid and the
// sides vents. Change the cutouts to suit your board.

use <kerf/enclosure>

/* [Box] */
// Outside width, lid included
width = 150; // [80:5:300]
// Outside depth
depth = 100; // [60:5:250]
// Outside height
height = 60; // [40:5:150]
// Vents in the lid and the sides
vents = true;

/* [Screws] */
// Screw diameter
screw = 3; // [2.5, 3, 4]
// Screw length under the head
screw_length = 12; // [10:1:25]

/* [Material] */
// Sheet thickness
$thickness = 3; // [3:0.5:6]
// Beam width
$kerf = 0.15; // [0:0.01:0.3]

/* [Hidden] */
$material = "plywood";
$fn = 48;
// The walls stand in from the lid's edge by a screw's width
w = width - 2 * screw;
d = depth - 2 * screw;
h = height - $thickness;

ports = [
  ["front", [w * 0.25, h / 2], 12.5],
  ["front", [w * 0.75, h / 2], 8],
  ["back", [w / 2, 14], [13, 6.5]],
  ["bottom", [12, 12], 3.2],
  ["bottom", [w - 12, 12], 3.2],
  ["bottom", [12, d - 12], 3.2],
  ["bottom", [w - 12, d - 12], 3.2],
];
air = [
  ["lid", [width / 2, depth / 2], [width * 0.5, depth * 0.35], "vents"],
  ["left", [d / 2, h / 2], [d * 0.5, h * 0.4], "vents"],
  ["right", [d / 2, h / 2], [d * 0.5, h * 0.4], "vents"],
];

enclosure([width, depth, height], screw = screw, screw_length = screw_length,
  cutouts = vents ? concat(ports, air) : ports);
```

Set power, speed and cut order in your laser software. See the [laser software guide](https://kerfscript.mylasertools.com/docs/compatibility/index.md).
