Skip to main content
Loading navigation

Build an IFC Staircase Egress Compliance Auditor — implementation

Prompt source

implementation71 lines11 sectionsNo variables1 code block
## Build
Inspect emergency staircases in architectural IFC models to assess life safety compliance. Validate tread depths and riser heights against standard building codes to flag evacuation hazards.

## User
Life Safety Code Inspector

## Workflow
1. Upload an architectural IFC model into the compliance analysis engine.
2. Extract IfcStair and IfcStairFlight entities with associated dimensional boundaries.
3. Calculate average tread run and riser height dimensions.
4. Output a life safety audit summary highlighting non-compliant staircase geometries.

## Interface
Audit dashboard showing 3D stair elements color-coded by geometric compliance, detailed riser/tread metrics, and an exportable PDF report.

## Data
Download public hospital and school IFC sample designs from open-source BuildingSMART test libraries.
Starter examples below are synthetic. They are not downloaded records.

## Source
[IfcOpenShell](https://raw.githubusercontent.com/IfcOpenShell/IfcOpenShell/v0.8.0/README.md)
Parses IfcStair and IfcStairFlight geometry and dimensional attributes using IfcOpenShell Python.

## Tools
pydantic-ai, ifcopenshell, fastapi.
Pydantic AI ensures validated output structures conforming strictly to safety reporting standards.
API-based instruction model capable of interpreting architectural safety criteria and summarizing violations.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Identifies all stair flight instances and extracts vertical riser and horizontal tread dimensions.
- Flags any stair flight with a riser height exceeding 180mm or tread depth below 280mm.
- Validates stair widths against the minimum 1000mm standard clearance.

## Starter Examples
```json
[
  {
    "input": {
      "stair_id": "Stair_Flight_Egress_01",
      "riser_height_mm": 175,
      "tread_depth_mm": 280,
      "flight_width_mm": 1200,
      "has_handrails": true
    },
    "expected_output": {
      "stair_id": "Stair_Flight_Egress_01",
      "riser_compliant": true,
      "tread_compliant": true,
      "width_compliant": true,
      "status": "APPROVED",
      "remarks": "Complies with standard egress stair geometry thresholds.",
      "schema_note": "simplified synthetic app records, not complete official schema files"
    }
  },
  {
    "input": {
      "stair_id": "Stair_Flight_Service_02",
      "riser_height_mm": 210,
      "tread_depth_mm": 240,
      "flight_width_mm": 850,
      "has_handrails": false
    },
    "expected_output": {
      "stair_id": "Stair_Flight_Service_02",
      "riser_compliant": false,
      "tread_compliant": false,
      "width_compliant": false,
      "status": "REJECTED",
      "remarks": "Excessive riser height and insufficient tread depth; below width clearance.",
      "schema_note": "simplified synthetic app records, not complete official schema files"
    }
  }
]
```

## Safety
Audit outcomes provide guidance for design revisions. On-site field measurements remain mandatory before municipal occupancy certification.
Use mock external writes. Require human review before any real deployment.