· Lora · getting started

Getting started with Connectors: infrared.city in Grasshopper

Learn how to integrate infrared.city with Rhino/Grasshopper workflows in this comprehensive tutorial. Follow step-by-step instructions to install the plugin, authenticate your account, load projects, set up analysis, and run simulations.

Learn how to integrate infrared.city with Rhino/Grasshopper workflows in this comprehensive tutorial. Follow step-by-step instructions to install the plugin, authenticate your account, load projects, set up analysis, and run simulations.
In this article, you will learn how to integrate infrared.city in your Rhino/ Grasshopper based workflows. You will install the grasshopper plugin and authenticate, load your project, setup analysis, update geometry and run simulations. Follow these steps to get started.
In future tutorials we will dive-in to advanced workflows that use the instant simulation response of infrared.city together with fast iteration capability of parametric design to empower your optioneering and design space exploration strategy.

Step 1: Install infrared.city plugin for Grasshopper

    You can find and install infrared.city plugin like any other plugin for Grasshopper in Rhino 7 and Rhino 8.
    The latest version of the plugin is available for one click install through the Rhino Package Manager command. Type PackageManager in the command line, then search for InfraredCity and follow the instructions to install.
    For the changes to take effect, you will need to Close down and Re-start Rhino after installation.
    You can also find the plugin on the Food For Rhino website. From here you can install directly through the package manager, or download and add to the Libraries folder of Grasshopper manually.
    As the plugin makes a connection to our cloud server, ensuring that you have the latest version installed is critical. Once you already have a working version, the tool will warn you anytime that an update is required.

    Step 2: Understanding the tools

      Our plugin consists of a small set of tools grouped into 3 panels, enabling you to manage your projects, manage your analysis and run simulations.
      On the account panel, you can log in and out, load a project from your list of active projects (or get linked to a project creation workflow on the web), and update the active project with new geometry or analysis set.
      On the Analysis panel, you will find a list of our available analysis. While you can simply run any analysis list that you already have saved on the projects created on the web, you can also use the components of this tab to update the set of analysis at any time without going to the web.
      On the Simulations panel, you can manage runs and display simulation results. There are two ways in which you can run simulations. IRC_RunSimulations_Async should be used to run multiple simulations at once. This component computes in the background, allowing you to continue working on your definition while results are being generated. To avoid undesired usage, this component is meant to use within manual workflows, and requires the user to press a button to run simulations. The IRC_RunSimulations is the method to use for automated workflows, when the rate of update of the Update Project component controls the trigger to Run simulations. This method, alows to run a single simulation at a time, meaning that you can either use a list item component to select the analysis you wish to run, or, the component will take the first analysis of the list by default.
      It is important to note, that by default the run simulations component will not output any visual display. To dysplay the results you will need to connect the Display results component to any of the analysis you wish to visualise. This component will generate a colored mesh, as well as an associated value list which you can use for conditional manipulation and computing KPI.

      # Step 3: Setting up your script

        Now that you have an understanding about the components and their function, let's load our first project.
        On the account panel, you will find the component to authenticate with your infrared.city credentials. Let's add this to the canvas and begin the authentication process by clicking the login button on the component.
        NOTE: depending of your system configuration, you may see the browser redirect to an unfound page ( http://localhost:8080/?code=83…. ). If this happens, but your Grasshopper component does not appear in error mode, the login was completed correctly and you can simply close the browser window.
        Once you are logged in successfully, the component will output a list of your active projects. If you have already setup a project in the web, you can pick it up here by using the IRC_Project component.
        When adding the IRC_Project component to a script that has an infrared.city user authenticated, a dropdown list will be added to help you select the project you wish to work on. To continue with a selected project, click on Load button on the component.
        From this point, you can also create a new project by clicking the Create button, which will open a browser window to the project creation steps. You can check out our First steps tutorial here for information on how to create a new project.
        Once a project is loaded, two internalized data components will be added to your script: A Geometry component, containing any existing editable geometry that is currently stored in your project; and an Analysis component, containing the current set of analysis setup.
        Given the explicit history nature of Grasshopper, these two components are necessarily dissociated from the load project component to allow user to update geometry without duplication. therefore, we recomend that you rename these components, or bake and delete the geometry component from the script to avoid confusion. Generally, the geometry loaded with the project will be considered context geometry, so it's safe to bake, make any changes required, or completely replace with your existing site geometry if this is available.
        You can switch projects at any time during your work by selecting a new project and clicking Load again. Please make sure that the project output of the IRC_Project component is disconnected from any other components when loading a new project.
        To use this geometry and simulation setup to run simulations, you can directly add a IRC_RunSimulations_Async. Your analysis will be running in the background, and the command line will show the state of the simulations in process and those completed.
        In order to view the results, you will need to add an IRC_DisplayResults component. This has two outputs, one being the visible colored mesh, and the other being the data organized in a 1x1 meter grid. You can use this to perform minimum, maximum, average or conditional operations.
        In general, you will need to update aspects of your project before running new analysis. For example, adding a new geometry, can be realized by using the IRC_UpdateProject component.
        For instance, you can bake the context geometry (the Geometry output at project load) and remove any unnecessary elements, or make any changes. In this case, I removed the tower which was uploaded previously on the web. I will use a geometry pipeline component, standard in grasshopper, to load the adjusted context and any new design.
        In this case, we can use a Geometry pipeline to reference all meshes from the layer "Context”, and another pipeline to reference all breps from the layer "Design".
        You can of course use a fully parametric generation method, or simply manually referencing objects from Rhino into relevant components.
        It's important to note here, that minimal postprocessing is required on your geometry. Infrared.city accepts triangulated meshes as geometry input. It is simple to convert brep geometry to the required format by using a brep to mesh followed by a triangulate mesh component. Most geometries will require no specific setup for the mesh conversion, however more complex geometries may need attention to the settings. The goal is to balance between face efficiency and accuracy of the conversion, so generally a Setup(speed) mesh setup works best.
        To update the geometry of an infrared.city project, you can use the IRC_UpdateProject component. This, takes in a project ID and either a Analysis or a Geometry input. This means that you can use it to setup desired analysis settings for your project, generally needed at the beginning of the project setup; or you can use it to continuously update the geometry on the project. In this case, let's add the new geometry to the project.
        The combined context + design geometry are fed into the IRC_UpdateProject component.
        Note that Update project component will send data to the cloud to be updated to the root project. This means that, the initial state of a loaded project will be different from any updated version. To ensure project consistency is maintained, and that Rhino/Grasshopper geometry isn't passed to an unwanted project in case of accidentally clicking the load project button, we recommend that you add a DataDam component to block the flow of the ProjectID.
        Once the new geometry is set up, you can click the Update button on the Update Project component to send the new data to the cloud. This process is essentially instant.
        You can now use the analysis list directly from the Update Project component to to run analysis.
        While you can also use the Update project component to change the analysis set, this action is recommended in case multiple settings of the analysis scenarios must be changed. If your goal is to minimize credit use, by running only selected analysis on multiple designs, you can simply use any list management components to filter out the unwanted analysis. In this case, the Annual Wind Comfort analysis will only be used for selected designs.

        Managing analysis list

          At times, you may need to update the analysis list from from Grasshopper. This offers several advantages, as you can easily manage parameters, connect to your own data sources, or even iterate to find the right settings.
          All the available analysis can be created using components on the analysis panel. You can add a relevant name, and input parameters as required by the component. You can set one or multiple analysis to the project, and will still have the ability to decide which analysis to run according to the exploration focus.
          Pro Tip

          At times, you may require to set multiple wind speed analysis distributed across directions according to specific criteria. You can use data generation techniques and create multiple analysis of the same type with a single component. To make these easy to trace, you can use a concatenate text component to append the parameters to the analysis name.

          Once your new set of analysis are updated to the project, you will be able to see the updated names and run the selected analysis set. You may need to delete and replace the RunSymulationAsync component in order for the updated outputs to appear.

          Check your project on the web

            As infrared.city connects your work instantly to our cloud service, your latest design and analysis versions will be available on the web, and your updates can be seen by you or your colleauges in realtime.

            Next Steps

            • In a next tutorial, we will look at more advanced functions, like managing output data and using the auto-update state to connect Wind comfort simulations directly into advanced design space exploration workflows.

            If you think that infrared.city is right for you but need more support, please register your interest here and we will follow up more info.

            We are preparing an open Q&A session where we can address the burning topic of how to add real-time simulation feedback to your companies current standard workflows. If you'd be interested to participate, register your interest here.

            Back to Resources