Native ifc-lite geometry-data export for Python (welded, IFC Z-up, world coords).
Project description
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_offsetis 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) orValueError(JSON serialization failure).
Examples
Runnable scripts live in examples/:
quickstart_numpy.py- load a file and inspect meshes via numpy.dump_json.py- write the JSON document to disk.export_obj.py- write every element to a single Wavefront.obj(numpy only, no extra deps).
License
MPL-2.0. Part of the ifc-lite project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ifclite_geom-4.2.0-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: ifclite_geom-4.2.0-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 1.8 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a76e2f6234978148ec606006f2d9b52e30f9f4ef1c1c99554377d4691f148347
|
|
| MD5 |
55dc2231f8b90d42993294cfdd074bdd
|
|
| BLAKE2b-256 |
4279a2b7dd87a3ce1742e09ec988bf7c21da349dfbe9fb9d25c52c0c40834f66
|
Provenance
The following attestation bundles were made for ifclite_geom-4.2.0-cp39-abi3-win_amd64.whl:
Publisher:
python-wheels.yml on LTplus-AG/ifc-lite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ifclite_geom-4.2.0-cp39-abi3-win_amd64.whl -
Subject digest:
a76e2f6234978148ec606006f2d9b52e30f9f4ef1c1c99554377d4691f148347 - Sigstore transparency entry: 1926532656
- Sigstore integration time:
-
Permalink:
LTplus-AG/ifc-lite@46df2e7ef4d4e1c62e10d81e5873d1a106faa722 -
Branch / Tag:
refs/tags/ifclite-geom-v4.2.0 - Owner: https://github.com/LTplus-AG
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-wheels.yml@46df2e7ef4d4e1c62e10d81e5873d1a106faa722 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ifclite_geom-4.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: ifclite_geom-4.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9515a7e11be349ba91164babbc49486db47bdde1388b1c716c4bf59353dc2f9b
|
|
| MD5 |
e6d84898a6b13c104725d4bd76baa7f6
|
|
| BLAKE2b-256 |
9faef5470a42bf6ff5bc15183624c4997b39f3898019c174a9f19d292ada97de
|
Provenance
The following attestation bundles were made for ifclite_geom-4.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
python-wheels.yml on LTplus-AG/ifc-lite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ifclite_geom-4.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
9515a7e11be349ba91164babbc49486db47bdde1388b1c716c4bf59353dc2f9b - Sigstore transparency entry: 1926533020
- Sigstore integration time:
-
Permalink:
LTplus-AG/ifc-lite@46df2e7ef4d4e1c62e10d81e5873d1a106faa722 -
Branch / Tag:
refs/tags/ifclite-geom-v4.2.0 - Owner: https://github.com/LTplus-AG
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-wheels.yml@46df2e7ef4d4e1c62e10d81e5873d1a106faa722 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ifclite_geom-4.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: ifclite_geom-4.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ca2630dd5d3fd4795761763952b3f7080f4417bb989b5346715c5302fc7a928
|
|
| MD5 |
f8f1f6a9a5a75bb071c50f987743fbdc
|
|
| BLAKE2b-256 |
671291e1fd893c1bf9ddc0e6c144bfa11469cf0a196583eb81d03e819502afda
|
Provenance
The following attestation bundles were made for ifclite_geom-4.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
python-wheels.yml on LTplus-AG/ifc-lite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ifclite_geom-4.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
1ca2630dd5d3fd4795761763952b3f7080f4417bb989b5346715c5302fc7a928 - Sigstore transparency entry: 1926532542
- Sigstore integration time:
-
Permalink:
LTplus-AG/ifc-lite@46df2e7ef4d4e1c62e10d81e5873d1a106faa722 -
Branch / Tag:
refs/tags/ifclite-geom-v4.2.0 - Owner: https://github.com/LTplus-AG
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-wheels.yml@46df2e7ef4d4e1c62e10d81e5873d1a106faa722 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ifclite_geom-4.2.0-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: ifclite_geom-4.2.0-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9dec8411ebe35a5a28731b686b89db50277aa3b722bdfad04f31e228e6904aa1
|
|
| MD5 |
c5eedadf76313366e58eb3d6c3979fbb
|
|
| BLAKE2b-256 |
b7e9c45e4c0ab889c7aa8458fbb973d4dc206464941ee85cc1f26b46a6889fc4
|
Provenance
The following attestation bundles were made for ifclite_geom-4.2.0-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
python-wheels.yml on LTplus-AG/ifc-lite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ifclite_geom-4.2.0-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
9dec8411ebe35a5a28731b686b89db50277aa3b722bdfad04f31e228e6904aa1 - Sigstore transparency entry: 1926532897
- Sigstore integration time:
-
Permalink:
LTplus-AG/ifc-lite@46df2e7ef4d4e1c62e10d81e5873d1a106faa722 -
Branch / Tag:
refs/tags/ifclite-geom-v4.2.0 - Owner: https://github.com/LTplus-AG
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-wheels.yml@46df2e7ef4d4e1c62e10d81e5873d1a106faa722 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ifclite_geom-4.2.0-cp39-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: ifclite_geom-4.2.0-cp39-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.9+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
946c008ae7b0b222ebb2ab67f989e821c805f07dc1c7618fac2f6b185fb4e525
|
|
| MD5 |
bbe0b6ae871dfc96425b92344d570acd
|
|
| BLAKE2b-256 |
2dba12298d19ec904e75fefa740e858e918df051e666962d5804cd0467b72033
|
Provenance
The following attestation bundles were made for ifclite_geom-4.2.0-cp39-abi3-macosx_10_12_x86_64.whl:
Publisher:
python-wheels.yml on LTplus-AG/ifc-lite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ifclite_geom-4.2.0-cp39-abi3-macosx_10_12_x86_64.whl -
Subject digest:
946c008ae7b0b222ebb2ab67f989e821c805f07dc1c7618fac2f6b185fb4e525 - Sigstore transparency entry: 1926532789
- Sigstore integration time:
-
Permalink:
LTplus-AG/ifc-lite@46df2e7ef4d4e1c62e10d81e5873d1a106faa722 -
Branch / Tag:
refs/tags/ifclite-geom-v4.2.0 - Owner: https://github.com/LTplus-AG
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-wheels.yml@46df2e7ef4d4e1c62e10d81e5873d1a106faa722 -
Trigger Event:
push
-
Statement type: