Skip to main content

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 disk
  • ifc_lite.process_text(content) – Process IFC content from a string
  • ifc_lite.version() – Get the native library version

IfcModel

  • model.meshes – List of all MeshData elements
  • model.ifc_types – All distinct IFC type names
  • model.elements_by_type(type_name) – Filter elements by IFC type
  • model.element_by_express_id(id) – Lookup by express ID
  • model.element_by_global_id(gid) – Lookup by IFC GlobalId
  • model.metadata – Schema version, entity counts, coordinate info
  • model.stats – Processing timing statistics

MeshData

  • mesh.express_id, mesh.ifc_type, mesh.global_id, mesh.name
  • mesh.positions, mesh.normals, mesh.indices, mesh.color
  • mesh.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


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)

Uploaded Source

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

Hashes for ifc_lite-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ba1ef9a233538b1342fc133dbbda27e0b9b43a144af6c18934b802ff7aafffa2
MD5 9ffa77700f097a500b4fd1f828e3e4d8
BLAKE2b-256 0eba6405710f5862332d2ba6e28f57ee02f0bee98e95d3fad29e9ac83be9dc0f

See more details on using hashes here.

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