vflow2 Documentation

IFC Analysis Tools ← Back to App

API Endpoints

Overview

All endpoints are served by Flask (app.py). The web UI and 3D viewer communicate with the backend exclusively through these JSON APIs.

Endpoints

GET /

Main analysis page. Lists uploaded files and available tools.

POST /upload

Upload an IFC file. - Body: multipart/form-data with field file - Returns: {"filename": "test-1.ifc"}

DELETE /delete/<filename>

Remove an uploaded file. - Returns: {"ok": true}

GET /uploads/<filename>

Serve raw IFC file (used by web-ifc in the browser).

POST /analyze

Run an analysis tool. - Body: {"filename": "test-1.ifc", "tool": "element_summary"} - Returns: tool result dict ({title, summary, columns, rows, ...})

GET /spaces/<filename>

Space bounding boxes + IFC world bbox for coordinate mapping. - Returns:

{
  "ifcWorldMin": [0.0, 0.0, -0.18],
  "ifcWorldMax": [6.45, 10.25, 0.0],
  "spaces": [
    {"expressID": 46, "name": "1", "longName": "Raum 1", "globalId": "...",
     "bbox": {"min": [0.3, 5.3, 0.0], "max": [6.3, 10.1, 2.438]}}
  ]
}

GET /connection_graph/<filename>

Connection point graph for all building elements. - Query params: force=1 (optional) — forces recomputation, ignores cache - Returns: {nodes, edges, stats} (see 02_connection_graph.md) - Cached: saves to <stem>.connection_graph.json, loads from cache on subsequent requests

GET /wall_zones/<filename>?mode=normal

DIN 18015-3 installation zones for wall and ceiling surfaces. - Query params: mode=normal|false_ceiling|false_floor, force=1 (optional) - Returns: {walls, ceilings, mode, stats} (see 04_wall_zones.md) - ceilings: per-IfcSpace ceiling zones (ZD-r, ZD-t, dead zones, or false ceiling fly zone) - Cached: saves to <stem>.wall_zones_<mode>.json per mode

GET /storeys/<filename>

Building storeys with contained element express IDs. - Query params: project=<name> (optional) - Returns:

{
  "storeys": [
    {"expressID": 25, "name": "EG", "longName": "Erdgeschoss",
     "elevation": 0.0,
     "elementIDs": [260, 395, 453, 83, 180]}
  ]
}

POST /jobs

Start a background job for long-running computations. - Body: {"operation": "connection_graph|wall_zones|mep_routing", "filename": "...", "project": "...", "mode": "..."} - Returns: {"job_id": "uuid"} - Deduplicates: if an identical job is already running, returns existing job_id

GET /jobs

List all jobs. Optional filters: ?filename=&project=

GET /jobs/<id>

Poll job status. - Returns: {"status": "running|completed|failed", "current_phase": "...", "phases_completed": 3, "total_phases": 6, "elapsed_s": 12.5, "error": null}

GET /jobs/<id>/result

Fetch completed job result data.

GET /has_cache/<cache_type>/<filename>

Check if cached computation results exist. - cache_type: connection_graph or wall_zones - Returns: {"exists": true|false} - Used by viewer on page load to show/hide action buttons

Caching Strategy

Computed results are saved as JSON files alongside the IFC in uploads/:

Endpoint Cache File Regeneration
/connection_graph/ <stem>.connection_graph.json Auto on first request, or via tool
/wall_zones/?mode=X <stem>.wall_zones_X.json Auto on first request
/spaces/ <stem>.spaces.json Auto, invalidated when IFC mtime+size changes

To force recomputation: delete the cached JSON file and reload the viewer.