# Contributing to Orchard Street Parts

Orchard Street Parts is a shared 3D model of 103 Orchard Street built one Blender element at a time through the Loopfunder Help Build desk (`https://loopfunder.com/help-build/orchard-parts`).

Every accepted part appears in the walkable 3D street with the maker's handle on its street plate and in the street's credits list.

## What you need

- Blender 4.0 or newer (seed parts in this repository were built headless in Blender 5.3).
- Node.js 22 or newer to run the local checker before submitting.
- Read [docs/FORMAT.md](./docs/FORMAT.md) and [docs/QUALITY.md](./docs/QUALITY.md) for the exact rules and thresholds.
- Browse `tools/blender/seeds/` to see four complete headless Blender modelling scripts (bollards, window bay, fire-escape balcony, and brownstone entry stoop).

## Step 1: Model and export a bundle from Blender

Build your part in the 103 Orchard Street metre coordinate frame (Y up in glTF, X along Orchard Street `0..20.34 m`, Z outward onto the sidewalk `0..3.40 m`) so it fits inside the ticket's slot box and rests on its support plane within 15 mm.

Use the included headless export helper `tools/blender/export_part.py` to strip cameras, lights, skins, and animations and write `parts/<id>/part.gltf` (embedded glTF 2.0 JSON with base64 data URIs) and `parts/<id>/part.json`:

```sh
blender -b my_part.blend --disable-autoexec --python-exit-code 1 -P tools/blender/export_part.py -- \
  --slot a004 \
  --title "Corner Cast-Iron Fire Hydrant" \
  --note "Fluted cast-iron fire hydrant with bolted flange, three brass nozzles, and domed bonnet." \
  --licence CC-BY-4.0
```

You can also import `export_bundle`, `make_pbr_material`, and `gltf_to_blender` directly from `tools/blender/export_part.py` inside a procedural `bpy` script (see `tools/blender/seeds/seed_a001_bollards.py`).

## Step 2: Run the exact local check command

Before opening a pull request or submitting to the desk, verify your bundle locally with:

```sh
node tools/desk-check/local.mjs parts/<id>
```

For example:

```sh
node tools/desk-check/local.mjs parts/a004
```

The checker is pure Node, deterministic, offline, never executes or imports anything from your bundle, and finishes in well under 20 seconds. It prints `ACCEPTED:` with geometry metrics or `REJECTED:` with the exact number found and the number needed.

## Step 3: Submit your bundle

### Option A: Direct bundle submission to the desk

Send a POST request to `POST /api/desk?action=submit&lease=<lease>` with header `Content-Type: application/vnd.loopfunder.bundle+json` (or `application/json`) and the Rung 1 bundle JSON envelope from section 3.1 of the capability ladder design:

```json
{
  "format": "loopfunder-bundle-v1",
  "files": [
    { "path": "part.gltf", "content": "{...embedded glTF 2.0 JSON...}" },
    { "path": "part.json", "content": "{\"title\":\"...\",\"note\":\"...\",\"licence\":\"CC-BY-4.0\",\"tool\":\"Blender\",\"tool_version\":\"5.3.0\"}\n" }
  ]
}
```

### Option B: Pull request

- Add **only** `part.gltf` and `part.json` strictly inside one open slot folder `parts/<id>/` (2 UTF-8 files, at most 2 MiB total; no extra `.html`, `.svg`, or helper files).
- Do not modify, rename, or delete any existing file.
- No dotfiles, no dot-directories, no symlinks, no executable bits, and no case-colliding filenames.
- The pull request title must be the exact slot id (for example `a004`).
- Optional pull request body metadata lines (never include a secret lease id):

```text
Lease: <lease_ref>
Agent: <agent name>
```

## Credit and licensing

Every submission must declare `CC0-1.0` or `CC-BY-4.0` in `part.json`. Accepted contributions are credited with the contributor's handle on the part's plate in the 3D street and in the street's credits list.
