Skip to content

world bounds: tessellate islands, build to the street centerline - #434

Closed
bnolan wants to merge 2 commits into
mainfrom
world-bounds
Closed

world bounds: tessellate islands, build to the street centerline#434
bnolan wants to merge 2 commits into
mainfrom
world-bounds

Conversation

@bnolan

@bnolan bnolan commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

each parcel gets a bigger buildable AABB (`world_x1..world_z2`) that tessellates the island: faces grow 1m at a time, round-robin, until they meet the neighbour across the street. facing parcels split the road at the centerline. ground parcels also get 10m of underground. on-chain `x1..z2` stay as the owned interior.

verified on the full production dump (8,398 parcels, 40 islands): zero overlaps, 100% street coverage, runs in 0.6s. architect island is skipped.

how

  • `scripts/world-bounds.mjs` - computes world bounds from /api/parcels.json, `--apply` writes the new `world_*` columns
  • `scripts/resize-parcel-fields.mjs` - repads every voxel field into the world shape (voxels keep their world position) and shifts ungrouped feature anchors by the bounds-centre delta. idempotent, verified voxel-for-voxel on the dev DB
  • engine payloads (`cached.json`, `Parcel.load`) serve world bounds as `x1..z2` - field shape, meshing, voxel indexing and build checks all follow for free. token metadata and public `/api/parcels.json` still serve on-chain bounds
  • `featureBounds` is now exactly the parcel box; the streetWidth 4 / overHeight 8 / underHeight 1 fudge is deleted (client + version validator)
  • server `parcelCenter` anchors to bounds instead of the geometry polygon so feature auth matches the client anchor

deploy order

migrate -> `world-bounds.mjs --apply` -> `resize-parcel-fields.mjs --apply` -> deploy. serving world bounds against un-resized content decodes fields with the wrong shape.

known debts (flagged as todos in the script): pre-resize property_versions restores look scrambled until re-saved; lightmaps want a rebake since mesh-local coords shifted.

world bounds render

parcel 4580 running off world bounds: voxels and features unmoved, info panel already reports the 16m-wide buildable box with basement.

Made with Cursor

bnolan and others added 2 commits July 21, 2026 14:05
Each parcel gets a world_x1..world_z2 AABB grown out to meet its
neighbours (greedy 1m round-robin growth, zero overlaps on the full
production dump) plus 10m of underground for ground parcels. On-chain
x1..z2 stay as the owned interior.

- scripts/world-bounds.mjs computes and applies the world bounds
- scripts/resize-parcel-fields.mjs repads voxel fields and shifts
  feature anchors so nothing moves in world space
- engine payloads (cached.json, Parcel.load) serve world bounds as
  x1..z2, so field shape, meshing and build checks follow for free
- featureBounds is now exactly the parcel box; the streetWidth 4 /
  overHeight 8 / underHeight 1 fudge is gone
- server parcelCenter anchors to bounds, not the geometry polygon

Deploy order: migrate, world-bounds --apply, resize --apply, deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
@bnolan
bnolan marked this pull request as draft August 12, 2026 00:20
@bnolan bnolan closed this Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant