AI assisted CAD for the bonkgotchi project
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-08 02:17:11 -07:00
build Move R3 PCB mounting to rear floor posts for full-case PETG test 2026-09-08 02:17:11 -07:00
scripts Move R3 PCB mounting to rear floor posts for full-case PETG test 2026-09-08 02:17:11 -07:00
step_files Add reference step files 2026-09-07 13:37:39 -07:00
.gitignore Show current enclosure renders at top of README 2026-09-07 15:52:44 -07:00
.python-version Set up isolated uv environment for CadQuery 2026-09-07 14:03:29 -07:00
DESIGN.md Add R3 screw-closed PETG prototype with RESET access and optional plugs 2026-09-07 23:23:24 -07:00
DESIGN_R3.md Move R3 PCB mounting to rear floor posts for full-case PETG test 2026-09-08 02:17:11 -07:00
enclosure.py Move R3 PCB mounting to rear floor posts for full-case PETG test 2026-09-08 02:17:11 -07:00
enclosure_r3.py Move R3 PCB mounting to rear floor posts for full-case PETG test 2026-09-08 02:17:11 -07:00
pyproject.toml Set up isolated uv environment for CadQuery 2026-09-07 14:03:29 -07:00
README.md Move R3 PCB mounting to rear floor posts for full-case PETG test 2026-09-08 02:17:11 -07:00
uv.lock Set up isolated uv environment for CadQuery 2026-09-07 14:03:29 -07:00

README

Revision 3: PETG prototype with four recessed enclosure screws, three rear PCB posts, RESET access, an LCD keeper and keychain loop. BOOT access is intentionally omitted. Latest update: all PCB mounts are on the back; reload both shell STLs before printing.

Revision 3 assembled and exploded views

Interior views with the PCB mounts, corner screw posts, screen retainer and keychain loop:

Revision 3 interior and screen retainer

See DESIGN_R3.md for printing and assembly instructions. The snap-based revision remains in enclosure.py and build/r2/.

Combination AGENTS.md and README file.

Commit often. Reference STEP files exist in ./step_files. The user confirmed that the PCB STEP is current and authoritative. The old enclosure is for an earlier PCB revision: its USB opening and one mounting hole are wrong. Do not use the old case geometry to locate current hardware.

  • bonkgotchi_pcb.step: The PCB step file exported from KiCad
  • case-Back.step: Backside of the reference enclosure
  • case-Front.step: Front of the ref enclosure
  • bonkgotch_joystick_cap.step: Joystick component that friction fits over the joystick switch

The old enclosure used tape for both the closure and LCD retention. The screen position relative to the joystick is unchanged. The battery attaches to the PCB with double-sided 3M foam, confirmed to be about 2 mm thick uncompressed. The screen plugs into the back of the PCB and is "upside down" with the ribbon cable routed over the top of the PCB.

Components

Goal

Design a better enclosure for this project for STL export and 3D printing (either resin or FDM). We have various length self tapping screws (think M1.5-M2) that can be used.

Python / CAD environment

Use CadQuery to work with the reference STEP geometry, build parametric parts, and export STEP or STL files. Dependencies are managed by uv in a local .venv; do not install packages into the system Python.

From the repository root, with uv installed:

uv sync --locked
uv run python -c "import cadquery as cq; print(cq.__version__)"

The project uses Python 3.12 for compatibility with CadQuery's native dependencies. uv will download that Python version if needed. uv.lock records the resolved dependencies; use uv add <package> to add dependencies. Run CAD scripts with uv run python path/to/script.py. Put generated exports in build/, keeping step_files/ as the reference inputs. Generated files are ignored by Git except for the two PNG previews shown above.

PCB-driven enclosure, revision 3

enclosure_r3.py builds the screwed prototype using the current PCB geometry, four M2 × 8 mm shell screws and three M2 × 4 mm PCB screws. Optional tapered plugs cover the recessed rear heads. It retains the glue-secured LCD keeper, protected antenna bay, relocated USB opening and top keychain loop. The obsolete enclosure STEP files are not imported.

uv run python enclosure_r3.py
uv run python scripts/check_exports.py
blender --background --threads 6 --python scripts/render.py
uv run python scripts/package.py

Print-ready STL files, individual STEP files, an assembly STEP and validation results are written to build/r3/. See DESIGN_R3.md for hardware, printing, assembly, the optional Blender render command, and reference clearance assumptions. Proceed to the full case print; additional coupons are not requested.