# Ohmforge PCB Enclosure Generator (STL) > Board outline, holes, parts and connectors in – a verified, printable base and lid STL out. Describe a circuit board as JSON – outline, mounting holes, component boxes, edge connectors and keep-outs – and get a two-part 3D-printable enclosure: base with standoffs for heat-set inserts or self-tapping screws, connector cut-outs, and a lid with a snap-fit or friction lip or corner screws, optional vents and windows. Both STL files are checked to be watertight and manifold, cut-outs and standoffs are probed on the final mesh, and every part is tested for collisions. Includes a dimensioned drawing and an OBJ assembly. Part of usefulweb.app (https://usefulweb.app/). Part of [Ohmforge](https://ohmforge.usefulweb.app/) (ownerApp: ohmforge). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://ohmforgeenclosuregenerator.usefulweb.app/ (interactive tool at https://ohmforgeenclosuregenerator.usefulweb.app/tool) - JSON API: POST https://ohmforgeenclosuregenerator.usefulweb.app/api/v1/calculate with a JSON object of inputs (schema: https://ohmforgeenclosuregenerator.usefulweb.app/api/v1/tool) - OpenAPI: https://ohmforgeenclosuregenerator.usefulweb.app/openapi.json - MCP (Streamable HTTP): https://ohmforgeenclosuregenerator.usefulweb.app/mcp - tool `ohmforge_enclosure_generator` ## Inputs - board (textarea): Board model (JSON) - Fields: name, thickness, outline {shape: rect | rounded | polygon, width, height, radius, points}, holes [{id, x, y, diameter}], parts [{id, kind, x, y, width, depth, height, side}], connectors [{id, kind, edge: left | right | bottom | top, position, width, height, depth, overhang, offsetZ, side}], keepouts [{id, label, x, y, width, depth, heightAbove, lidOpening}]. Millimetres; part x and y are centres. Part kinds: smd-ic, dip-ic, electrolytic, pin-header, tactile-button, led-5mm, relay, radio-module, display-module, power-inductor, custom. Connector kinds: usb-c, micro-usb, usb-a, barrel-jack, header-right-angle, rj45, screw-terminal, micro-sd, custom. An Ohmforge project with a saved board also works. - wall (number): Wall thickness - floor (number): Floor thickness - lidThickness (number): Lid thickness - clearance (number): Gap between board and wall - Around the board's bounding box. - topClearance (number): Space above the tallest part - cornerRadius (number): Outer corner radius - Drawn with straight facets on the arc. - standoffHeight (number): Standoff height (under the board) - Also the depth of the screw or insert holes. - screw (select): Screw size - fixing (select): Board fixing - lid (select): Lid - lipHeight (number): Lip height - lipWidth (number): Lip width - lipGap (number): Gap between lip and wall - Per side; 0.15–0.3 mm suits most FDM printers. - snapDepth (number): Snap bump depth - How far the bumps reach beyond the lip; the catch is this minus the lip gap. - connectorClearance (number): Clearance around connectors - vents (boolean): Ventilation slots in the lid - ventWidth (number): Vent slot width - ventPitch (number): Vent slot pitch - circleSegments (integer): Facets per circle - Holes are drawn with their flats at the nominal diameter. - stlFormat (select): STL format ## Method - The cavity is the board's bounding box plus the gap on every side; the outer shell adds the wall. With lid screws the cavity grows until the corner posts (overlapping the walls) clear the board. Heights: floor, standoff, board, the tallest part or connector plus the space above it (at least the lip height plus 0.5 mm above the board), then the lid. - Base and lid are each built as one layered solid: ordered add and subtract polygons over height ranges (shell, cavity, standoffs with blind holes, posts, connector cut-outs = connector box + clearance extended through the wall, snap grooves; lid plate, lip, snap bumps, vents, windows, notches where parts reach the lip). All polygon edges form one planar arrangement split at every crossing; a trapezoidal decomposition gives convex cells that share whole edges, and the surface consists of the cell faces between filled and empty prisms. This yields closed, consistently oriented meshes without mesh booleans. - Verification on the final meshes: watertight, manifold, positive volume and a single shell (shared Renderloom mesh engine), again after a binary-STL round trip through the mesh analyzer; surface volume (divergence theorem) equal to the volume of the filled prisms; generalised winding numbers 0.005 mm inside and outside every opening edge and around every standoff hole and ring; every part, connector and the board tested as boxes against every material prism of base and lid. - Typical sizes: clearance holes per ISO 273 (medium: M2 2.4, M2.5 2.9, M3 3.4 mm); pilot holes for self-tapping screws in printed plastic about 0.8 × d (1.6, 2.0, 2.5 mm); common short brass heat-set inserts need 3.2, 3.6 and 4.0 mm holes and are 3–4 mm long. Holes are polygons whose flats lie on the nominal diameter; bosses are inscribed polygons. - Snap fit: bumps on the outside of the lip reach the snap depth past the lip, so they catch (snap depth − lip gap) in grooves cut 0.1 mm deeper into the wall, in the middle of each straight wall that has room and no opening. The lid STL is turned over for printing (plate on the bed); the base prints as it stands. ## Limits - Screw, insert and boss sizes are typical values, and connector dimensions in the catalogue are generic. Check them against your parts' datasheets. Printability and fit are not guaranteed: tolerances depend on your printer, material and slicer, so print a test piece first.