Demo

Connector snapping

Pieces are placed by joining typed connectors, so nobody types coordinates. The SDK computes every position to within 1 mm and refuses connectors that do not fit or are already taken.

Close render of a plaza: a bench, a lamp and a market stall standing on sidewalk sockets next to the road

Connector types in this kit

TypeJoins withFound on
awning-socketawning-plugcafe-01, shop-01
fence-2mfence-2mfence-01
ground-edgeground-edge, road-sidelawn-tile-01, plaza-tile-01
hedge-2mhedge-2mhedge-01
lot-frontroad-sidecafe-01, house-01, house-02, shop-01, townhall-01
prop-baseprop-socketbench-01, bus-stop-01, mailbox-01, market-stall-01, shrub-01, street-lamp-01, trash-bin-01, tree-01, tree-02
prop-socketprop-baselawn-tile-01, plaza-tile-01, road-corner-01, road-straight-01, road-tee-01
road-4mroad-4mroad-corner-01, road-cross-01, road-crosswalk-01, road-straight-01, road-tee-01
road-sideground-edge, lot-frontroad-corner-01, road-crosswalk-01, road-straight-01, road-tee-01

A snapped instance

In the scene file, attach_to names the piece and the connector to join. No position is written.

From town-small.scene.json
[
  {
    "instance_id": "tile-a3",
    "asset": "stylized-town/road-straight-01@0.3.0",
    "position_m": [
      -4,
      0,
      0
    ],
    "rotation_euler_rad": [
      0,
      0,
      0
    ],
    "uniform_scale": 1,
    "customize": {}
  },
  {
    "instance_id": "house",
    "asset": "stylized-town/house-01@0.2.0",
    "attach_to": {
      "instance_id": "tile-a3",
      "anchor_id": "anchor-side-north",
      "connector": "anchor-lot-front"
    },
    "uniform_scale": 1,
    "customize": {
      "front-door": "door-02",
      "roof": "roof-hip-01",
      "wall-color": "paving"
    }
  }
]

Check a scene with npx agent-ready-assets scene validate and the --resolve option: it prints every computed position. Three.js guide.

What the SDK refusesall or nothing

A scene with a snap that cannot be made is refused as a whole; nothing is placed approximately. The error names the cause: SNAP_INCOMPATIBLE, SNAP_OCCUPIED, SNAP_CYCLE, SNAP_TILTED, SNAP_ANCHOR_UNKNOWN or INSTANCES_OVERLAP.