Skip to main content

ifclite-geom

Native ifc-lite geometry tessellation for Python. It turns an IFC file into per-entity triangle meshes with no Node, no WASM, and no subprocess: the Rust geometry kernel runs directly inside the Python process.

Meshes come back welded, IFC Z-up, in absolute world metres, keyed by IFC STEP id (occurrences only). This is the analysis-ready export, distinct from the render-oriented GLB the viewer uses.

Install

pip install ifclite-geom

Prebuilt wheels ship for CPython 3.9+ on Linux (x86_64, aarch64), macOS (Apple silicon and Intel), and Windows (x64). No Rust toolchain needed.

Quick start

The module is ifclite_geom and exposes two functions. Both take the raw IFC file as bytes and return the same geometry; they differ only in the output format.

import ifclite_geom
import numpy as np

with open("model.ifc", "rb") as f:
    ifc_bytes = f.read()

data = ifclite_geom.geometry_data_buffers(ifc_bytes)

print(data["element_count"], "elements")
print("up axis:", data["up_axis"], "| units:", data["units"])
print("rtc offset:", data["rtc_offset"])

for step_id, el in data["elements"].items():
    verts = np.frombuffer(el["vertices"], dtype=np.float64).reshape(-1, 3)
    faces = np.frombuffer(el["faces"],    dtype=np.uint32 ).reshape(-1, 3)
    print(step_id, el["ifc_type"], el["global_id"], verts.shape, faces.shape)

Prefer no numpy dependency? Use the JSON variant, which returns the same data as arrays of numbers:

import ifclite_geom, json

doc = json.loads(ifclite_geom.geometry_data_json(ifc_bytes))
first = next(iter(doc["elements"].values()))
print(first["ifc_type"], first["vertices"][0])  # [x, y, z] in metres

API

geometry_data_buffers(ifc_bytes: bytes) -> dict

The fast path. Vertices and faces come back as raw little-endian byte buffers so you can hand them straight to numpy.frombuffer with zero parsing.

{
  "up_axis": "Z",            # always Z (IFC native)
  "units": "m",              # always metres
  "rtc_offset": [x, y, z],   # geo-reference offset already folded into vertices
  "element_count": 1234,
  "elements": {
    <step_id:int>: {
      "ifc_type":  "IfcWall",
      "global_id": "3vB2...",   # may be None
      "name":      "Basic Wall:...",  # may be None
      "color":     [r, g, b, a],      # 0..1
      "vertices":  <bytes>,           # f64 little-endian, xyz triplets
      "faces":     <bytes>,           # u32 little-endian, triangle indices
    },
    ...
  }
}

Decode the buffers with:

verts = np.frombuffer(el["vertices"], dtype=np.float64).reshape(-1, 3)  # (V, 3)
faces = np.frombuffer(el["faces"],    dtype=np.uint32 ).reshape(-1, 3)  # (F, 3)

geometry_data_json(ifc_bytes: bytes) -> str

The same geometry as a readable ifc-lite-geometry-data JSON document (a string; call json.loads on it). Vertices are [x, y, z] arrays and faces are [a, b, c] index arrays, so no numpy is required. Each element also carries global_id and name when the source entity has them.

Notes

  • One mesh per element. Per-material submeshes of an element are merged into a single indexed triangle soup, keyed by its IFC STEP id.
  • Coordinates are absolute world metres. The per-element local frame and the model RTC offset are folded back into every vertex. For geo-referenced models rtc_offset is non-zero; subtract it if you want f32-friendly local coordinates.
  • Welded and indexed. Coincident corners are merged (1 micron grid), so closed-mesh consumers (volume, watertightness checks) work directly.
  • Occurrences only. Type-product / RepresentationMap geometry is not emitted, matching what occurrence-based tessellators produce.
  • Errors surface as RuntimeError (geometry pipeline failure) or ValueError (JSON serialization failure).

Examples

Runnable scripts live in examples/:

License

MPL-2.0. Part of the ifc-lite project.

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

ifclite_geom-4.2.1-cp39-abi3-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.9+Windows x86-64

ifclite_geom-4.2.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB view details)

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

ifclite_geom-4.2.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.1 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

ifclite_geom-4.2.1-cp39-abi3-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

ifclite_geom-4.2.1-cp39-abi3-macosx_10_12_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file ifclite_geom-4.2.1-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: ifclite_geom-4.2.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for ifclite_geom-4.2.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 990c4999eab8ad573ceedfe0ae50926fad65d66e4e8e14b4717fd5d41597acd3
MD5 3337032052d1a86aaa9b65f42ff9f4ae
BLAKE2b-256 3814797b9a1d88ff12a39e2b8dff8e68a9cca5d9829cd0c5f608d258f9a1051b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifclite_geom-4.2.1-cp39-abi3-win_amd64.whl:

Publisher: python-wheels.yml on LTplus-AG/ifc-lite

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

File details

Details for the file ifclite_geom-4.2.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ifclite_geom-4.2.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 257fd1e04c11ae9b088da08a7076841a1e7f35e398edde677b1a0cb8b01a998e
MD5 da587036b73dbb7844580472260307b3
BLAKE2b-256 6e06bb74c0994421e5d82a324b947ef08345811dfc56d9d42d9bf4375c2e3ac2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifclite_geom-4.2.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-wheels.yml on LTplus-AG/ifc-lite

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

File details

Details for the file ifclite_geom-4.2.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ifclite_geom-4.2.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 537613efcf281f17b1af740f1469a400c25d0c2fcd490e44586755c3ddeb51f3
MD5 e860c3da3398dead78ad7292b61c1cb7
BLAKE2b-256 fad0778357fe8fa46e9ea6e224ad67bca5a3e2a6b7b2a7478fcf4a68380d9031

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifclite_geom-4.2.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: python-wheels.yml on LTplus-AG/ifc-lite

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

File details

Details for the file ifclite_geom-4.2.1-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ifclite_geom-4.2.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1568e54620bef09c2a65abfc575039344860714f84335f1057a560ff3b135c1a
MD5 bba745568d77f61a6894490531778c93
BLAKE2b-256 40df13556b78303cbecfbd7f482d80c7b4c0a9d5fcc9c11bc360d2ce9fd08191

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifclite_geom-4.2.1-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: python-wheels.yml on LTplus-AG/ifc-lite

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

File details

Details for the file ifclite_geom-4.2.1-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ifclite_geom-4.2.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 154c6ed782f151aed02d97ba06e628a6174ce8e9437b238195e6433e49d62ab5
MD5 d5fafd06c4588529e24016e965c12336
BLAKE2b-256 f9a4193983359154a3aaa82494c09f1cccfc7c295ece7e5822ff1d17a3dcadb5

See more details on using hashes here.

Provenance

The following attestation bundles were made for ifclite_geom-4.2.1-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: python-wheels.yml on LTplus-AG/ifc-lite

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

Release history Release notifications | RSS feed

4.4.0

5 files

4.3.0

5 files

This release

4.2.1 This release

5 files

4.2.0

5 files

4.1.0

5 files

Supported by

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