Skip to main content

Fast native IFC parsing, data extraction, and geometric analytics

Project description

ifcfast

Fast native IFC parsing, data extraction and geometric analytics. Python on top, Rust underneath, no ifcopenshell.open() on the hot path.

Aimed at the "open an IFC, get the data out, run QTO / quality queries" workflow. Tier-1 parse is byte-identical to ifcopenshell and ~20-27× faster on production files.

ifcfast was extracted on 2026-05-13 from the EdvardGK/ifc-workbench scratch repo. See docs/history/origin.md for the trail back and what was renamed.

What it gives you

layer format typical latency on 200 MB IFC
Products (GUID, type, name, storey, parent, tag) dict of parallel lists tier-1 cold: 0.5–2 s
Property sets long-format pandas.DataFrame 137 ms
Element quantities long-format pandas.DataFrame 90 ms
Materials (incl. layer sets) long-format pandas.DataFrame 27 ms
Classifications long-format pandas.DataFrame 17 ms
All data layers (shared scan) bundle 1.3 s
Triangle meshes (extrusion / mapped / face sets / BREP) OBJ / glTF / CSV 2.6 s
Placement-vs-mesh drift report pandas.DataFrame 322 ms
Parquet cache (all of the above) parquet 65 ms hot reload

End-to-end cold parse of a 200 MB IFC: under 5 s. Hot reload from cache: under 100 ms. Memory peak: under 1 GB resident (mmap-based).

Audited at 234,144 products across 5 authoring tools (Tekla, Archicad, Revit IFC4, Revit IFC2X3, MagiCAD, BSProLib) with byte-level parity vs ifcopenshell. See docs/history/audit/.

Install

Needs Rust 1.95+ and Python 3.10+.

pip install maturin
maturin develop --release      # builds the Rust extension, ~30 s first time

For production: maturin build --release produces a wheel.

Quick start

import ifcfast

m = ifcfast.open("model.ifc")
print(len(m), "products,", len(m.storeys), "storeys")
print(m.authoring_app, "→", m.schema)

walls = list(m.filter(entity="IfcWall"))

# Long-format data layers (pandas DataFrames, loaded lazily).
m.psets             # 63k+ rows on a 200 MB Archicad file
m.quantities        # author-supplied Qto_*BaseQuantities
m.materials         # (guid, role, layer, name, thickness, category)
m.classifications   # NS 3451 / Uniformat / OmniClass references
m.drift             # placement-vs-mesh drift report

# Standard QTO query — external walls.
external_walls = m.psets[
    (m.psets.pset_name == "Pset_WallCommon")
    & (m.psets.prop_name == "IsExternal")
    & (m.psets.value == "True")
].guid.unique()

# Quality gate — placement bugs.
suspect = m.drift[m.drift.drift_severity == "error"]

The same model can be re-opened cheaply — the second ifcfast.open(...) returns from the parquet cache in tens of milliseconds.

CLI

ifcfast index   model.ifc           # tier-1 parse + counts
ifcfast extract model.ifc           # extract data layers (writes cache)
ifcfast drift   model.ifc --top 20  # placement / mesh drift report
ifcfast cache   model.ifc           # inspect cache for a file

The Rust binary ifcfast-mesh writes OBJ / glTF / CSV directly:

cargo build --release --bin ifcfast-mesh --no-default-features --features mesh
./target/release/ifcfast-mesh model.ifc model.glb

Cache

Parquet files live under ~/.cache/ifcfast/<cache_key>/, where cache_key is sha256(file_size + first 4 MB + last 4 MB) truncated. Any edit to the IFC invalidates the entry automatically.

Override with the IFCFAST_CACHE environment variable, e.g. IFCFAST_CACHE=/srv/cache ifcfast extract model.ifc.

Disk footprint on a 200 MB Archicad IFC: 2.4 MB total zstd-compressed.

Data schemas

All extractors return long-format (one row per fact, no nested fields). Easy to join, easy to filter, easy to flatten to Excel.

Missing values: string columns use pandas StringDtype with nan as the NULL sentinel (chosen for memory and pyarrow round-trip). Cells corresponding to a STEP $ field hold float('nan'), not Python None. Use .isna() to test, not == None or is None:

m.classifications[m.classifications.identification.isna()]   # correct
m.classifications[m.classifications.identification == None]  # always False
[r for r in m.classifications.itertuples() if r.identification is None]  # always False

If you're cross-checking against ifcopenshell (which returns None), normalise NaN→None on the comparison side.

psets

column type description
guid str IfcProduct.GlobalId
pset_name str e.g. Pset_WallCommon
prop_name str e.g. IsExternal
value str | None booleans normalised to True / False / UNKNOWN
value_type str | None IfcBoolean, IfcText, IfcReal, …

quantities

column type description
guid str IfcProduct.GlobalId
qto_name str e.g. Qto_WallBaseQuantities
quantity_name str e.g. NetVolume, GrossArea, Length
value str | None numeric value as string
quantity_type str Area / Length / Volume / Count / Weight / Time
unit_step_id int | None usually None (project default applies)

materials

column type description
guid str IfcProduct.GlobalId
role str direct / list / layer / unknown
layer_index int 0-based for layered materials, -1 otherwise
material_name str | None material label
layer_thickness_mm float | None only set for role="layer"
category str | None IFC4 only

classifications

column type description
guid str IfcProduct.GlobalId
system_name str | None NS 3451, Uniformat II, OmniClass
edition str | None e.g. 2022
identification str | None the actual code
name str | None human label
location str | None URI to spec (rarely populated)
source str | None publisher

drift

column type description
guid, entity, source str identification
triangle_count, surface_area, volume_abs int / float geometric stats
placement_x/y/z float what IfcLocalPlacement says
centroid_x/y/z float where the mesh AABB centre actually is
drift_distance float Euclidean distance, mm
max_extent float largest AABB dimension
drift_ratio float drift_distance / max_extent
drift_severity str ok / warn / error

Severity rule: ok when drift_ratio ≤ 2.0 or drift_distance < 10 mm; error when drift_ratio > 10.0 and drift_distance > 10 mm.

A 100 m wall placed at one end has ratio 0.5 (legitimate). A 50 mm sensor 100 m from its placement has ratio 2000 (clear authoring bug).

Federated floor synthesis

Multi-discipline projects have the same physical floor named differently by ARK / RIB / RIV / RIE authors. ifcfast.federated_floors clusters by elevation across discipline models and applies a project-supplied YAML rule.

# examples/projects/lbk-building-c.yaml
prefix: "C - "
overrides:
  Plan U1: Hav
  C - U1:  Hav
idempotent_labels: [Hav]
apply_drop_leading_zero: true

The module is project-agnostic — project tables live in user config.

Architecture in two paragraphs

The Rust core (crates/core) does one byte-level pass over the IFC's DATA section using a string-aware STEP tokenizer (memchr-accelerated). That pass builds an EntityTable — a step_id → byte_range map of every entity in the file. Each PyO3 entry point (index_ifc, extract_psets, etc.) walks the table once, dispatching on entity type and extracting only the fields that layer needs.

The Python cache (ifcfast.cache) writes each extractor's output as zstd-compressed parquet, keyed by sha256(size + 4 MB head + 4 MB tail) so any IFC edit invalidates automatically. Hot reads are pure pandas / pyarrow — no Rust call needed. There is no ifcopenshell.open() anywhere in the data path; ifcopenshell is an optional dev dep used only for cross-checking parity in tests.

What it doesn't do

  • Write or modify IFCs. Read-only by construction.
  • Schema validation. Trusts the file's syntax. Use bsi-validator for conformance.
  • Tessellate IfcBooleanClippingResult (walls with openings render without cutouts — gross volume correct, net volume not).
  • NURBS / advanced BREP geometry. ~0.5% of elements in typical exports.
  • Property variants beyond IfcPropertySingleValueIfcPropertyEnumeratedValue, IfcPropertyListValue, IfcPropertyBoundedValue, IfcComplexProperty are skipped. Covers ~90% of psets seen on Revit / Archicad / Tekla / MagiCAD exports.

Layout

crates/core/         Rust extension (PyO3) — tokenizer, indexer, extractors, mesh
  src/
    lib.rs           PyO3 entry points
    lexer.rs         STEP tokenizer
    indexer.rs       tier-1 product / storey index
    entity_table.rs  step_id → byte range lookup
    extractors/      psets, quantities, materials, classifications
    mesh/            extrusion, mapped, face sets, BREP, glTF writer
    bin/             ifcfast-bench, ifcfast-mesh CLIs
python/ifcfast/      Public Python API
  __init__.py        ifcfast.open(), Model, header, classify
  header.py          STEP header reader (tier-0)
  model.py           Model class + native tier-1 driver
  cache.py           parquet cache for index + data layers
  classify.py        element-mode policy (count / measure / linear / skip)
  federated_floors.py multi-discipline floor synthesiser
  cli.py             ifcfast CLI
docs/history/        origin doc + audit issues from ifc-workbench
examples/projects/   project YAMLs for federated_floors
tests/               pytest suite

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ifcfast-0.1.0.tar.gz (76.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ifcfast-0.1.0-cp310-abi3-win_amd64.whl (335.4 kB view details)

Uploaded CPython 3.10+Windows x86-64

ifcfast-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (413.4 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

ifcfast-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (392.3 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

ifcfast-0.1.0-cp310-abi3-macosx_11_0_arm64.whl (373.5 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

ifcfast-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl (390.4 kB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file ifcfast-0.1.0.tar.gz.

File metadata

  • Download URL: ifcfast-0.1.0.tar.gz
  • Upload date:
  • Size: 76.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ifcfast-0.1.0.tar.gz
Algorithm Hash digest
SHA256 689194b7429538b8d870790953a1b7eb162b3ff547c6a877a483ecbc83223e11
MD5 233f4e2e99008ed9fc6c7ec7d8007e4f
BLAKE2b-256 216e1b0c78f45ef9a301c4bbcfd2b8f940d83e6113e5e114223fc240dbb6945a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifcfast-0.1.0.tar.gz:

Publisher: release.yml on EdvardGK/ifcfast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ifcfast-0.1.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: ifcfast-0.1.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 335.4 kB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ifcfast-0.1.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a6c0c6c868c5d67ba810114a9576fb774d360770ee8d0eda47203e90acb88511
MD5 428a4a0e845d91018e84b9610cef496c
BLAKE2b-256 9a7f6f085a3dd57e2b13f12713af73c6c6761b08f343e35c0c43264c026c1a4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifcfast-0.1.0-cp310-abi3-win_amd64.whl:

Publisher: release.yml on EdvardGK/ifcfast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ifcfast-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ifcfast-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 20100ef2f1ca1f978423f85b5fc1677b4ae827665ea06d933e1e6f3def444837
MD5 1659c6e932330a6e471214f0bc3dee66
BLAKE2b-256 bad100d6677ad724cee59d81f0c38eda7022fdb4bbb49fee9552090a0c874a43

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifcfast-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on EdvardGK/ifcfast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ifcfast-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ifcfast-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9b2dca190616dcd573a3e41a1838778c8646962d1bc53f40d9cbf1c1cd5c6916
MD5 5c167f3ad9e5c83a1c794d859a0be76a
BLAKE2b-256 0af10ebdcdeed572dca628d728c09aa3e8c2e22743731b9df06b4908952106f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifcfast-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on EdvardGK/ifcfast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ifcfast-0.1.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ifcfast-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5e3c2c61e90038428cb81222ad0589ac857a08c8f839f69e67559f2acf48f3c6
MD5 15ae4941bdaad1275e615cf56958b965
BLAKE2b-256 48be483af3cb0d1636feae5c1ba04dacbefb0053cb3684f8815628314d897324

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifcfast-0.1.0-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on EdvardGK/ifcfast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ifcfast-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ifcfast-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3b6799f79eeb6615c013f73a10939e19aaad342d58e7118d5fc294481b8cf73b
MD5 700daf8a4b318f2bcfcadb18b7efd881
BLAKE2b-256 4318f67009ce07c11798c006c39f7302dd0eb2894ab5adfa9d77bf48b86e0d7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifcfast-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on EdvardGK/ifcfast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page