CAD / BIM / Synthetic Assets
Convert architectural or synthetic assets into WebAR³ VPS maps for construction, indoor navigation, or digital twin scenarios.
Geometry Preparation
- Import the CAD/BIM model into Blender, Unity, or similar tools.
- Collapse instanced objects and remove hidden or irrelevant geometry.
- Reduce polygon count while preserving key features (aim for ≤5 million triangles).
- Generate UVs and bake lightweight textures if you plan to preview the model.
Anchor Planning
[
{ "name": "lobby", "position": [0.0, 0.0, 0.0] },
{ "name": "elevator_north", "position": [12.4, 0.0, 28.9] }
]
- Coordinates are expressed in metres relative to the model origin.
- Use stable identifiers (
lobby,loading_dock) so SDK code can consume them directly.
Upload with the Python REST API
# upload_cad.py
from pathlib import Path
import json
import os
import requests
API_BASE = "https://was-vps.web-ar.xyz/vps/api/v3"
TOKEN = os.environ["WEBAR3_TOKEN"]
MODEL = Path("exports/mall.glb")
ANCHORS = Path("exports/anchors.json")
headers = {"Authorization": f"Bearer {TOKEN}"}
payload = {
"name": "Mall Digital Twin",
"dataType": "mesh",
"sourceFormat": "glb",
"anchors": json.loads(ANCHORS.read_text()),
"publish": False
}
init = requests.post(f"{API_BASE}/maps/import", json=payload, headers=headers)
init.raise_for_status()
info = init.json()
map_id, upload_url = info["mapId"], info["uploadUrl"]
with MODEL.open("rb") as src:
put = requests.put(upload_url, data=src, headers={"Content-Type": "model/gltf-binary"})
put.raise_for_status()
finalize = requests.post(f"{API_BASE}/maps/{map_id}/finalize", json={}, headers=headers)
finalize.raise_for_status()
print(f"CAD map {map_id} queued → {finalize.json()['status']}")
- Anchors can be embedded in the initial payload; alternatively call
POST /maps/{id}/anchorsafterwards. - Append
coordinateif the model is georeferenced ({"lat": ..., "lon": ..., "alt": ...}).
Validation
- Preview the map in space.web-ar.studio and adjust anchor offsets if required.
- Test localisation with the Unity SDK; align virtual props using the same anchor IDs.
- When the CAD model changes, re-run the import. The
mapIdstays stable if you callPOST /maps/{id}/updaterather than creating a new map.