Several quality improvements including top and bottom bus bar, seperate downloads for bus bars and a sharable configuration link

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Finn Tews
2026-04-27 23:04:13 +02:00
parent 0cd23b8198
commit e033ce35fa
375 changed files with 250919 additions and 293 deletions

View File

@@ -32,15 +32,46 @@ Live at https://generate.waak.me/
## Running it
Any static file server will work. The project ships an OpenCascade WASM build under `vendor/`.
This project now uses a Node-managed Vite workflow.
```bash
python -m http.server 8000
# or
npx serve .
npm install
npm run dev
```
Then open `http://localhost:8000`.
Then open the URL printed by Vite (typically `http://localhost:5173`).
Production build and preview:
```bash
npm run build
npm run preview
```
The OpenCascade runtime files stay in `vendor/` and are resolved automatically in both dev and preview builds.
## Shareable URL configuration
All UI parameters are encoded into the URL hash so a link can reproduce the same setup.
- Format: `#config=<payload>_<checksum>`
- Payload: Base64URL-encoded JSON
- Checksum: first 16 hex chars of SHA-256 over the raw JSON payload
- Schema version: `v` field in the payload enables future migrations
Included in the shared config:
- Pack mode (`sp` or `mm`) and dimensions (`series`, `parallel`, `xDim`, `yDim`)
- Cell and holder parameters (`cellSize`, `layoutType`, `spacing`, `height`, `coverThickness`, `ledgeWidth`, `roundedCorners`)
- BMS settings (`bmsHolesType`, `bmsHoleDiameter`, `tabWidth`, `tabDepth`)
- Busbar export format and full busbar list (`id`, `name`, `color`, `thickness`, `cellIndices`, `activeId`)
Behavior notes:
- URL hash updates are debounced while editing.
- If payload, checksum, or schema version is invalid, the app rejects the shared config entirely and continues with defaults.
- The checksum protects integrity against typos and tampering, but does not encrypt data.
- Use the **Copy Share URL** button to copy a current, checksum-valid link.
## Project layout
@@ -69,7 +100,7 @@ vendor/
## Tech
- Vanilla ES modules, no build step.
- Vanilla ES modules with Vite dev/build tooling.
- OpenCascade WASM for CAD operations and STEP export.
- HTML5 Canvas 2D for the preview with DPR scaling and pan or pinch zoom.
- DXF is hand rolled AutoCAD R12 so it opens cleanly in LightBurn, Fusion, and the usual suspects.