Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Advanced Python: IFC + computational geometry

Thomas Krijnen
December 06, 2022

Advanced Python: IFC + computational geometry

Thomas Krijnen

December 06, 2022
Tweet

More Decks by Thomas Krijnen

Other Decks in Education

Transcript

  1. Advanced python
    IFC + computational geometry

    View Slide

  2. Guest lecturer
    • Thomas Krijnen
    • past: Post-doctoral researcher @ TU Delft, NL
    • past: PhD @ TU Eindhoven, NL
    • Founder AECgeeks
    • Maintainer IfcOpenShell.org
    • ✉ [email protected]
    • 🐤 @aothms

    View Slide

  3. Why python
    - Batteries included:
    - web: flask, django, e.g view.ifcopenshell.org
    - machine learning: pytorch, tensorflow, keras, scikit, …
    - geometry: pythonOCC, shapely, …
    - graphs: networkx, rdflib, …
    - Readable syntax, reasonable semantics wrt typing, expressive
    types (e.g sets, containment operators, …)
    - Interpreted (no lengthy compilation times) and high performance
    possible (e.g numpy, numba, pypy, …)

    View Slide

  4. Work (1) - geometric analysis for code
    compliance checking
    https://github.com/opensourceBIM/voxelization_toolkit

    View Slide

  5. Work (2) -
    model validation
    https://github.com/buildingSMART/validate

    View Slide

  6. Setup
    https://docs.conda.io/en/latest/miniconda.html
    conda create -n course2022
    conda activate course2022
    conda install -c conda-forge pythonocc-core ifcopenshell jupyter

    View Slide

  7. Anatomy of a simple Python script

    View Slide

  8. Data extraction using IfcOpenShell
    Python

    View Slide

  9. Entities and attributes

    View Slide

  10. Inverse attributes

    View Slide

  11. Comparison with a SPARQL query

    basic graph pattern
    aggregate function
    / makes this a property path, a sequence of two predicates in this
    used because in IfcOWL the specific type of the property nominal
    is emitted. IfcAreaMeasure in this case.

    View Slide

  12. Example with geometry

    View Slide

  13. The complexity of IFC

    View Slide

  14. Continue on
    http://web.archive.org/web/20200711032105/http://www.
    pythonocc.org/quick-examples/machine-learning-and-
    building-models/
    https://academy.ifcopenshell.org/posts/using-ifcopenshell-
    and-pythonocc-to-construct-new-geometry/
    https://github.com/AECgeeks/tue-python-workshop-2022

    View Slide