Install in Rhino 8 and Grasshopper¶
The Grasshopper components are a compiled plugin, CompasAcoustics.gha, for Rhino 8 on Windows and macOS.
Everything they compute runs in the worker, a Python 3.12 environment with compas_acoustics that the installer
creates.
Install¶
- Download
compas_acoustics_installer.zipfrom the latest release. It holds the wheel, the plugin (gha/) andcompas_acoustics_installer.gh. - Unzip it and open
compas_acoustics_installer.ghin Grasshopper. - Press Install. When the component says Restart Rhino, restart Rhino.
The components are then in the COMPAS Acoustics tab. The first installation downloads PyTorch for the worker, several GB, and takes a few minutes.
What the installer does¶
- Copies the plugin into Grasshopper's Libraries folder, in a
compas_acousticssubfolder, and removes the CPython components (.ghuser) of earlier versions from UserObjects. - Installs
compas_acousticsinto a Rhino script environment, for your own Python scripts in Rhino. - Creates the worker with
uvunder~/.compas_acoustics/workers/and records it in~/.compas_acoustics/worker.json.
Installer options, the inputs of the installer component:
source- Path of the
.whlfile in the bundle. Empty: the.whlfile next to the.ghfile. The plugin must be next to it, ingha/. venv- Name of the Rhino script environment that gets
compas_acousticstoo. Empty:default. worker- Ignored; the worker is always set up.
On Windows, if Grasshopper reports the plugin as blocked, unblock the files in the Libraries folder (Properties > Unblock).
The worker¶
The worker starts with the first component that needs it (a few seconds; half a minute the first time) and stops
with Rhino. Every Rhino session starts its own, on a free port of 127.0.0.1, and shares a random token with it:
it answers only requests that carry the token, and exits when Rhino ends or dies.
The worker must run the same compas_acoustics version and protobuf schema as the plugin; otherwise the components
say to run the installer again. To use another interpreter that has this version of compas_acoustics, set the
environment variable COMPAS_ACOUSTICS_WORKER_PYTHON to its path. A Python script can use the same worker through
compas_acoustics.worker.client().
The Worker component (Util panel) shows the worker's state; every component's right-click menu has Open worker log. See Troubleshooting when the worker does not start.
Update¶
Download the installer of the new release and run it as above. It replaces the plugin and the worker's
compas_acoustics; restart Rhino afterwards.
Uninstall¶
- Close Rhino.
- Delete the
compas_acousticsfolder in Grasshopper's Libraries folder (in Grasshopper: File > Special Folders > Components Folder). - Delete
~/.compas_acoustics/, which holds the worker.