Geometric Compliance Engine

APPLIED AI · COMPUTATIONAL GEOMETRY · BIM

AI-assisted translation of building regulations into computable rules for models in IFC format

THREE.JS · LLM PIPELINE (GEMINI) · RULE ENGINE · BIM

Overview

A research prototype investigating how natural-language building regulations can be translated into computable geometric constraints and evaluated against BIM (Building Information Management) models using IFC (Industry Foundation Classes), an open data standard for representing the geometry, properties and relationships of building elements.

The system connects building-code documents with BIM models. A browser-based viewer built with Three.js and web-ifc loads IFC models client-side, while a separate LLM pipeline reads building-code PDFs, extracts the clauses relevant to a given building element, and translates them into structured rules mapped onto the IFC schema.

For the current prototype, the scope is narrowed to door regulations under the Spanish accessibility code (CTE DB-SUA). Violations are reported with a reference to the exact code section and page, and non-compliant elements are highlighted directly in the 3D model.

The IFC Code Viewer interface, showing the category panel and a compliance-check result reporting 54 doors with violations
The browser-based viewer used throughout this project: an IFC model loaded client-side, element categories that can be toggled on and off, and the result of a compliance check reported directly in the interface.
Building code
  • CTE DB-SUA
  • Natural language
Relevant requirements
  • Extracted clauses
  • Section + page kept
Structured geometric rules
  • Element · property
  • Operator · value
IFC properties + geometry
  • IfcDoor
  • Width, height …
Rule evaluation
  • Actual vs. required
  • PASS / FAIL
Spatial compliance feedback
  • Highlighted in 3D model
  • Traced to source clause

Concrete example — minimum accessible door width

Natural language IfcDoor.width ≥ 800 mm IFC model PASS / FAIL
01 — Interpreting building regulations

Turning a legal document into searchable, sourced clauses

Building codes contain hundreds of requirements expressed through natural language, diagrams, exceptions and references between sections.

The first stage uses an LLM to search the regulation for requirements associated with a particular building element — in this prototype, doors. The prototype currently extracts requirements such as accessibility conditions, minimum opening widths, door clearances, threshold conditions, relationships with stairs and ramps, and door safety requirements.

Rather than asking the model directly whether a building complies, the system first extracts the relevant clauses and preserves their source, section and context. This creates an intermediate layer between the original regulatory document and the geometric analysis of the building.

A CTE DB-SUA regulation page with the relevant clause highlighted, next to the structured record extracted from it
A clause from the DBSUA accessibility code (Anejo A, page 36) with the relevant sentence highlighted, and the structured record the LLM extraction step produces from it.
02 — From language to geometric rules

Translating a clause into a computable constraint

Relevant clauses are translated into a constrained, machine-readable representation that can be evaluated computationally. Each rule defines a building element, measurable property, comparison operator and required value, while retaining its connection to the original regulation.

Rule structure
ElementIfcDoor
Propertywidth
Operator
Value800 mm
SourceDBSUA / Anejo A

For example:

“Accessible doors must provide a minimum clear opening width of 800 mm.” IfcDoor → width ≥ 800 mm
A door-width clause from the DBSUA accessibility code next to the structured rule the LLM pipeline extracts from it
A clause from the DBSUA accessibility code (top) and the structured rule generated from it, with its source document and page retained.

AI INTERPRETS THE CODE · DETERMINISTIC CODE PERFORMS THE CHECK

The language model therefore acts as an interface between an unstructured regulatory document and a deterministic geometric checking system, rather than making the final compliance decision itself.

03 — IFC as the building representation

What the model actually knows about a door

Alongside the rules, an IFC parser reads the building model itself. For every IfcDoor, it currently extracts:

  • Express ID
  • Global ID
  • Name
  • Width
  • Height
  • External / internal
  • Level

A constrained IFC schema also tells the LLM exactly which properties it is allowed to reason with when generating rules — and this is where the gap between the regulation and the model becomes visible.

Regulation space
clear opening · threshold · turning clearance · distance to stair · clear space in front · accessible route · …
IFC information available
OverallWidth · OverallHeight · IsExternal · …
IFC model loaded in the viewer, shown alongside the category panel
A building IFC model loaded and rendered client-side, with model elements organised into interactive categories that can be toggled on and off. An uploaded code file is checked against the loaded model directly in the browser.
04 — Compliance evaluation

Checking every door against its rules

A conventional, deterministic rule engine compares each IFC door against the rules generated for it.

Actual IFC value logical operator regulatory requirement PASS / FAIL
Door #216401
Width762 mm
Required≥ 800 mm
ResultFAIL

Every violation retains a full trail back to its source, rather than only a pass/fail flag:

  • Actual value
  • Required value
  • Issue description
  • Code document
  • Code section
  • Document page

Instead of only reporting FAIL, the system maintains a chain: building element ↔ failed rule ↔ source regulation.

05 — Connecting the result back to geometry

Making violations visible in the model

The browser-based IFC viewer closes the loop between the compliance check and the building itself.

IFC upload Three.js / web-ifc model IFC categories compliance API violating Express IDs red 3D subset
Compliance check highlighting non-compliant elements in red on an otherwise grey and white 3D model
Compliance results mapped back onto the model. Non-compliant elements are highlighted directly in the 3D geometry.

Compliance results are mapped back to IFC element IDs, allowing failed requirements to be located directly within the 3D building model.

The limitation this prototype exposed

Regulations describe relationships, not just properties

The current schema tells the model it can reason with a door’s own attributes — width, height, is_external. But the regulation also contains requirements that are not attributes of the door itself: distance between a door and a staircase, clearance to a fixed object, turning diameter in front of a door, threshold height.

Because the schema has no way to express those relationships, the model falls back to the properties it does have — sometimes producing rules that are syntactically valid but semantically wrong:

Regulation says

Minimum horizontal distance from a door to a stair: 400 mm

Generated rule door.width ≥ 400
Regulation says

Threshold height: 50 mm

Generated rule door.height ≤ 50

That second rule causes an obviously false violation, since the IFC door height is typically around 2100 mm. This isn’t just a bug worth hiding — it reveals the actual research problem: building regulations describe relationships, not just properties.

To evaluate these regulations correctly, the system needs to move from single-element properties to geometric predicates — relationships between elements and their context:

  • distance(door, stair) ≥ 400
  • threshold_height(door) ≤ 50
  • clear_space_in_front_of(door) ≥ 1200
  • IF door ∈ accessible_route THEN clear_width(door) ≥ 800

The prototype exposed a fundamental challenge in automated code compliance: many regulations cannot be reduced to attributes stored directly on BIM elements. They describe spatial relationships, context and derived geometry.

The next stage of the research therefore moves from property checking toward constructing geometric predicates — distance, clearance, adjacency, accessibility and spatial containment — from IFC geometry.

Simple property rule door.width ≥ 800
Spatial rule distance(door, stair) ≥ 400
Contextual rule IF door ∈ accessible_route → width ≥ 800