High-performance Python bindings for the ifc-lite IFC parser
Project description
ifc-lite
High-performance Python bindings for the ifc-lite IFC parser.
Installation
pip install ifc-lite
Quick Start
import ifc_lite
# Load an IFC file
model = ifc_lite.process_file("building.ifc")
# List all IFC types in the model
print(model.ifc_types)
# Get all reinforcing bars
bars = model.elements_by_type("IfcReinforcingBar")
for bar in bars:
print(f"{bar.name}: {bar.vertex_count} vertices, {bar.triangle_count} triangles")
print(f" Properties: {bar.properties}")
# Access geometry (vertex positions, normals, triangle indices)
for mesh in model.meshes:
positions = mesh.positions # flat list of x,y,z triplets
normals = mesh.normals # flat list of nx,ny,nz triplets
indices = mesh.indices # triangle indices
color = mesh.color # RGBA tuple
API
Module-level functions
ifc_lite.process_file(path)– Load and process an IFC file from diskifc_lite.process_text(content)– Process IFC content from a stringifc_lite.version()– Get the native library version
IfcModel
model.meshes– List of allMeshDataelementsmodel.ifc_types– All distinct IFC type namesmodel.elements_by_type(type_name)– Filter elements by IFC typemodel.element_by_express_id(id)– Lookup by express IDmodel.element_by_global_id(gid)– Lookup by IFC GlobalIdmodel.metadata– Schema version, entity counts, coordinate infomodel.stats– Processing timing statistics
MeshData
mesh.express_id,mesh.ifc_type,mesh.global_id,mesh.namemesh.positions,mesh.normals,mesh.indices,mesh.colormesh.properties– IFC property set values (dict or None)mesh.vertex_count,mesh.triangle_count
License
MPL-2.0 (same as upstream ifc-lite)
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 Distribution
ifc_lite-0.1.0.tar.gz
(320.6 kB
view details)
File details
Details for the file ifc_lite-0.1.0.tar.gz.
File metadata
- Download URL: ifc_lite-0.1.0.tar.gz
- Upload date:
- Size: 320.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba1ef9a233538b1342fc133dbbda27e0b9b43a144af6c18934b802ff7aafffa2
|
|
| MD5 |
9ffa77700f097a500b4fd1f828e3e4d8
|
|
| BLAKE2b-256 |
0eba6405710f5862332d2ba6e28f57ee02f0bee98e95d3fad29e9ac83be9dc0f
|