Skip to content

Instantly share code, notes, and snippets.

@rileywong311
Last active September 7, 2023 19:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rileywong311/c5dd453740ac7e80107398032698b081 to your computer and use it in GitHub Desktop.
Save rileywong311/c5dd453740ac7e80107398032698b081 to your computer and use it in GitHub Desktop.
Riley Wong's Google Summer of Code 2023 with BRL-CAD, IfcOpenShell
GSOC banner

Google Summer of Code 2023 with BRL-CAD, IfcOpenShell

Link to my Google Summer of Code page: https://summerofcode.withgoogle.com/programs/2023/projects/bSgYCNuV

Student Info

  • Name: Riley Wong
  • Email: rnwong@scu.edu
  • University: Santa Clara University

Mentor Info

Project Description

Note: Brick is a semantic structure and ontology designed to represent the relationships between building services. Find out more about Brick and Brick Schema from the blogpost I wrote mid-program!

This project further bridges the IfcOpenShell and Brick Schema open-source communities and shared mission to evolve the common exchange of building information. By upgrading the Brick module in IfcOpenShell’s Blender addon, BlenderBIM, this project allows users to seamlessly edit Brick entities and relationships. This is particularly important to the continued management phase of a building’s life cycle, so this project will contribute to BlenderBIM’s coverage over building lifetimes. Furthermore, although the IFC and Brick schemas exist separately, there is value utilizing Brick to enhance the granularity of IFC and vice versa: this project is the foundation for such endeavor.

Project Milestones

✅ Update to the most recent brickschema python library and rework the backend tools to fit this.

  • Updated the addon’s makefile to download and parse the most recent py-brickschema library.
  • Converted the Brick graph into a VersionedGraphCollection to support undo/redo.

✅ Create the feature to save changes to a selected file.

  • Added options to serialize the Brick graph to a selected or new file.
  • Separated the Brick metadata from the graph data when saving the project.

✅ Implement undo/redo support for the operators.

  • Supported the ability to undo/redo within the native Blender environment using graph versioning.

✅ Add utility to manage namespaces.

  • Created a panel to select the active namespace of the project
  • Created an operator to bind new namespaces.

✅ Improve the module’s utilities to add Brick entities and update their properties.

  • Improved the dropdown list of class options to quickly filter and add desired entity types.
  • Created an input to assign labels to entities on creation.

✅ Add utilities to edit Brick feed relationships and search for entities.

  • Added the ability to create and delete relationships manually.
  • Created a split screen feature to more seamlessly add relationships between targeted entities.
  • Restored displaying blank nodes in a Brick graph which supports certain special formats.

✅ Add feature to assign references and convert between IFC and Brick entities.

  • Created a Brick classification library to assign IFC to Brick types directly.
  • Updated the tools to add references to IFC by using the standardized Brick predicates.
  • Restored the functionality of adding references when creating a Brick entity with an IFC selected.
  • Restored the functionality of converting IFC to Brick using the ifcopenshell python API.

✅ Make the module interface polished and the new operators easily accessible.

  • Used labels instead of global ID’s where possible to improve readability.
  • Split the module into separate dropdown panels to designate features.
  • Fixed alignment problems in the UI relations list.
  • Filtered out unnecessary metadata from UI relations list.

Merged Code

Project Screenshots

Before:

Demo Before


After:

Demo After

Demo

https://www.youtube.com/watch?v=8bbuyzT5-rc

Future Work

  • Improve the ifcopenshell python package’s lookup dictionary for conversions between IFC and Brick entities. There attempts at doings this mapping by using large language models, but more work will need to be done to refine the results. See brick-vocab-mapper.
  • Improve the speed of the VersionedGraphCollection directly in the brickschema package for querying and other functionalities. This will improve the BlenderBIM Addon’s performance.
  • Add the ability to link to timeseries databases.
  • Quality of life UI features:
    • Consider other ways to display entities in the Brick project to improve user workflow.
    • Only show the valid relationships to add when selecting two Brick entities. See connections.py.
    • Make it possible to use the label of entities when adding relationships manually.
    • Create an IFC project reference(s) manager.
  • Consider supporting reasoning/expanding graphs in the module.

What I Learned

  • BIM and the facility services industry: through this experience, I was able to learn about the significance of building information modeling (BIM) in the civil infrastructure industry. After learning about challenges faced in standardizing such data, this project pointed me toward Brick Schema, which ultimately allowed me to learn even more in depth about facility management and how computer science intersects with smart building infrastructure.

  • Build for the target use and not for an ill-defined use: I learned that it’s okay to close off doors if it means that the tool will become more targeted for the likely and valuable scenario. It’s not worth prioritizing a method that a user might only have a 1% chance of wanting to do, even if it may seem neat or impossible to do otherwise. This is especially true given that the nature of open source is to actively iterate based on feedback; plus, this module serves to expand pre-existing workflows, not create an entirely new one.

  • Often big abstract features can be broken into already solved problems: I learned that, when it comes to design philosophy, I can draw analogies to other existing workflows in order to better approach my implementations. For example, when figuring out how to best let users create relations between Brick entities, my mentor and I drew analogy to computer file browsers which pointed to the benefit of having a second screen to search and connect data.

  • The value of open source: by working on an open source project, I realized the value of entire communities to draw on for feedback and to actively iterate on my development. Meanwhile, I learned how to efficiently format GitHub issues and forum posts as I interacted with other developers to gain further insight on certain code or implementations. In fact, since I was working with Brick Schema, another open-source organization, I was working in an entire open-source ecosystem that I could get immediate insight from.

  • Software design: my development skills have improved through this firsthand experience. This includes understanding the model-view-controller design pattern used in the addon, learning how to better format lines of code for the sake of readability, setting up my developer environment for a unique project, writing unit and UI test cases, and analyzing documentation.

Acknowledgements

I am deeply grateful to Google, the IfcOpenShell community members, the Brick Schema community members, and my mentor Dion Moult for granting me this remarkable opportunity during the course of this summer. The privilege of participating in this program has enabled me to not only enhance my skill set, but also make meaningful contributions to IfcOpenShell‘s BlenderBIM Addon initiative.

I would also like to extend my appreciation to Gabe Fierro and Erik Paulson for their invaluable industry insights, which have greatly contributed to refining the module. Their guidance on essential features to focus on and their patience in addressing my uncertainties have been instrumental in shaping the success of this endeavor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment