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 full-size 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 full-size 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 full-size slide

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

    View full-size slide

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

    View full-size 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 full-size slide

  7. Anatomy of a simple Python script

    View full-size slide

  8. Data extraction using IfcOpenShell
    Python

    View full-size slide

  9. Entities and attributes

    View full-size slide

  10. Inverse attributes

    View full-size 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 full-size slide

  12. Example with geometry

    View full-size slide

  13. The complexity of IFC

    View full-size 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 full-size slide