This tutorial will walk you through connecting a Python Jupyter Notebook to Rhino Compute.
- Introduction
- Presentation
- Installation
- Jupyter notebook intro
- Spatial analytics
- Rhino Compute connection line by line code
- Advanced section
- Q/A
Install the following packages in order.
Anaconda is a distribution of the Python for scientific computing, that aims to simplify package management. The base installer comes with Python 3.8.
Once installed, open the CMD.exe Prompt
This will open a command prompt in the conda default base environment. From here you can install all packages.
If Jupyter Lab is not shown in the Anaconda Navigator install using the following.
pip install jupyterlab
Once, installed, launch JupyterLab in Powershell/Terminal. It will open a browser window in the default directory.
CPython package based on OpenNURBS with a RhinoCommon style.
pip install rhino3dm
Matplotlib Homepage is a library for creating visualizations in Python. The possibilities are almost endless with what you can create from static, animated, and even interactive visualizations all with very few lines of code.
pip install matplotlib
GeoPandas is an open source project to make working with geospatial data in python easier. GeoPandas extends the datatypes used by pandas to allow spatial operations on geometric types. Geometric operations are performed by shapely. Geopandas further depends on fiona for file access and matplotlib for plotting.
conda install geopandas
Scikit-learn
is an open source machine learning library that supports supervised and unsupervised learning. It also provides various tools for model fitting, data preprocessing, model selection and evaluation, and many other utilities. We will be using Kmeans clustering to cluster simliar tax lots together and color them.
pip install scikit-learn
Ladybug allows you to import and analyze standard weather data in Grasshopper; draw diagrams like Sun-path, wind-rose, radiation-rose, etc; customize the diagrams in several ways; run radiation analysis, shadow studies, and view analysis.
- Open Rhino 7
- type
PackageManger
in the Rhino command line. - search for Hops
- Select Hops and install
- Restart Rhino
Open Grasshopper and go to Preferences --> Solver and uncheck Hide Rhino Compute Window. This will open the Rhino Compute window during development.
Grasshopper Setting
Rhino Compute Terminal Window
Debug Environmental Variable
To see debug messages during development in the Rhino Compute terminal window (Windows) go to Edit System Environment Variables --> System Variables and create a New variable RHINO_COMPUTE_DEBUG and set to true