This release aligns the package with the front-end data model described in
chapter 4 of the underlying PhD thesis. The user-facing API now consists of
two classes (BuildingInformationModel, GenericElement) plus an
explicit spatial tree, an interaction graph, a Pydantic-based validation
engine, and a parametric geometry layer. Internal helpers have been
reorganised accordingly and the legacy compas_ifc.model entry point is
gone.
Added
compas_ifc.bim.BuildingInformationModel— the front-end model class,
combiningElementFactoryMixin,InteractionMixin, andTreeMixin.compas_ifc.element.GenericElement— unified element abstraction with
bidirectional sync to the underlying IFC entity. Replaces per-product
subclasses for everyday usage.compas_ifc.factory.ElementFactoryMixin— typed creators
(create_wall,create_slab, …) plus atemplate()classmethod that
scaffolds default IfcProject / IfcSite / IfcBuilding / IfcBuildingStorey.create_elementnow normalises arbitrary type strings ("IfcWall",
"Wall","wall"→IfcWall) and falls back to
IfcBuildingElementProxy(withObjectTypepreserved) for unknown
custom strings.compas_ifc.tree.TreeMixin— IFC import with placement-chain
rectification,extract/exportfor self-contained subsets,
print_hierarchy.compas_ifc.interactions.InteractionMixin— typed interaction graph
populated from IFC relationships, pluscompute_connections,
compute_collisions, andshow_collisions.compas_ifc.validation—Specificationdataclass,validate_model,
validate_element, and Pydantic schemas for the standard IFC psets.
Specifications attached tomodel.specificationsenforce validation at
insertion time;model.validate(specs)runs advisory checks.compas_ifc.representations— parametric geometry types (Extrusion,
Revolution,Pipe,ClippedExtrusion,BooleanResult,HalfSpace)
that round-trip losslessly through IFC.compas_ifc.algorithms.contactsandalgorithms.collisions— vectorised
NumPy + Shapely broadphase + narrowphase replacements for the previous
pure-Python implementations.thesis/appendix/A/— reproducible evaluation suite for chapter 4 of
the thesis, with arun_all.pyrunner that writes a consolidated
outputs/A-summary.txt.tests/test_bim.pyandtests/test_validation.py— minimal pytest
coverage of the front-end API.
Changed
- The package entry point is now
from compas_ifc.bim import BuildingInformationModel. The previous
from compas_ifc.model import Modelimport path has been removed. - Spatial hierarchy is materialised as
model.tree(a COMPASTree
instance) with directparent/childrenpointers; non-hierarchical
IFC relationships go intomodel.graph. - Documentation has been rewritten end to end (
README.md,docs/index,
docs/architecture,docs/api/*,docs/tutorials/*,
docs/examples).
Removed
compas_ifc.model.Model(replaced by
compas_ifc.bim.BuildingInformationModel).src/compas_ifc/__main__.py(no-op stub).tests/test_placeholder.py(replaced by real tests).- Stale documentation: old tutorial and example pages, the
compas_ifc.entities.generatedAPI page, the development planning
notes underthesis/. compas_ifc.entities.generated.{IFC2X3,IFC4,IFC4X3}— the runtime
per-class wrappers (~3,000 files, ~20 MB) have been replaced by three
PEP 561 stub files (IFC2X3.pyi,IFC4.pyi,IFC4X3.pyi) bundled
with the package. IDE autocomplete on raw IFC attributes is preserved
through the stubs; runtime code uses dynamic dispatch through
Base.__getattr__/__setattr__. Users who relied on
isinstance(x, IfcWall)should switch tox.is_a("IfcWall");
runtime imports ofcompas_ifc.entities.generated.IFC4.IfcWall
no longer work — type-time imports underif TYPE_CHECKING:
continue to resolve via the stubs.
Migration notes
- The hand-written extensions in
compas_ifc/entities/extensions/
now register through the new
:func:compas_ifc.entities.base.extendsdecorator rather than by
class name. Each extension class is renamed toIfc<Name>Extras
and inherits fromBase; the previousclass IfcElement(IfcElement)
shadowing pattern is gone. External code that imported these classes
by name (e.g.from compas_ifc.entities.extensions import IfcProduct)
should switch to the newIfcProductExtrasname.