DOI: 10.18419/darus-5685
title: Opossum

description: &lt;h1&gt;Opossum&lt;/h1&gt;

&lt;p&gt;Opossum is an optimization plug-in for Grasshopper (for Rhino) that implements model-based and evolutionary optimization algorithms for single- and multi-objective problems. The plugin integrates GUI components into Grasshopper to configure runs, visualize results, and persist optimizer state inside Grasshopper documents.&lt;/p&gt;

&lt;p&gt;This repository contains a .NET/Grasshopper plugin project targeting .NET Framework 4.8.&lt;/p&gt;

&lt;h2&gt;Highlights&lt;/h2&gt;
&lt;ul&gt;
 &lt;li&gt;Model-based single-objective optimization (RBFOpt)&lt;/li&gt;
 &lt;li&gt;Evolutionary single-objective optimizer (CMA-ES)&lt;/li&gt;
 &lt;li&gt;Multi-objective RBFMOpt optimizer&lt;/li&gt;
 &lt;li&gt;Multiple multi-objective algorithms via pygmo&lt;/li&gt;
 &lt;li&gt;Interactive Grasshopper window and result serialization&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Notable folders and classes&lt;/h2&gt;
&lt;ul&gt;
 &lt;li&gt;&lt;code&gt;Opossum2_0_Proto_A/&lt;/code&gt; — main plugin project. Contains component classes, UI windows, serialization utilities, and resources.
 &lt;ul&gt;
 &lt;li&gt;&lt;code&gt;OptComponent.cs&lt;/code&gt; — main Grasshopper component implementation: UI hooks, serialization/deserialization, and component registration.&lt;/li&gt;
 &lt;li&gt;&lt;code&gt;Resources/&lt;/code&gt; — embedded icons, images, and other resource files used by the plugin.&lt;/li&gt;
 &lt;li&gt;&lt;code&gt;Solver/&lt;/code&gt; — optimization solver interface and implementations (RBFOpt, pygmo, etc.).&lt;/li&gt;
 &lt;/ul&gt;
 &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Requirements and dependencies&lt;/h2&gt;

&lt;h3&gt;Development / build&lt;/h3&gt;
&lt;ul&gt;
 &lt;li&gt;Microsoft Visual Studio (2017, 2019, or 2022) with .NET Framework 4.8 targeting pack installed.&lt;/li&gt;
 &lt;li&gt;The Grasshopper and Rhino SDK (or runtime assemblies) to resolve references to &lt;code&gt;Grasshopper.dll&lt;/code&gt;, &lt;code&gt;GH_IO.dll&lt;/code&gt;, and &lt;code&gt;RhinoCommon.dll&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Runtime&lt;/h3&gt;
&lt;ul&gt;
 &lt;li&gt;Rhino with a matching version of Grasshopper (the plugin runs inside Grasshopper).&lt;/li&gt;
 &lt;li&gt;Opossum installed via Food4Rhino or PackageManager to obtain Python backend and dependencies.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The plugin expects to be loaded inside Grasshopper; it does not run as a standalone .NET application.&lt;/p&gt;

&lt;h2&gt;Build instructions&lt;/h2&gt;
&lt;ol&gt;
 &lt;li&gt;Open the solution in Visual Studio.&lt;/li&gt;
 &lt;li&gt;Ensure project references to Rhino/Grasshopper assemblies are valid (point to the installed Rhino/Grasshopper runtime or SDK). These references are typically not committed and must be resolved on your machine.&lt;/li&gt;
 &lt;li&gt;Restore NuGet packages.&lt;/li&gt;
 &lt;li&gt;Build the &lt;code&gt;Opossum2_0_Proto_A&lt;/code&gt; project in &lt;code&gt;Debug&lt;/code&gt; or &lt;code&gt;Release&lt;/code&gt; configuration.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The produced assembly will generally be a &lt;code&gt;.dll&lt;/code&gt; file or &lt;code&gt;.gha&lt;/code&gt; (Grasshopper plugin), depending on how the project is configured.&lt;/p&gt;

&lt;h2&gt;Install and run&lt;/h2&gt;
&lt;ol&gt;
 &lt;li&gt;Install Opossum from Food4Rhino or PackageManager.&lt;/li&gt;
 &lt;li&gt;Copy the built &lt;code&gt;.gha&lt;/code&gt;/&lt;code&gt;.dll&lt;/code&gt; to Grasshopper's Components folder.&lt;/li&gt;
 &lt;li&gt;Restart Rhino/Grasshopper.&lt;/li&gt;
 &lt;li&gt;The plugin registers its component(s) under the category set in the component registration (for example &lt;code&gt;Params&lt;/code&gt; -&gt; &lt;code&gt;Util&lt;/code&gt;).&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Usage notes&lt;/h2&gt;
&lt;ul&gt;
 &lt;li&gt;&lt;code&gt;OptComponent&lt;/code&gt; manages component serialization (stores GUIDs of linked variables, simulators, and objectives) so saved Grasshopper files keep references and results across sessions.&lt;/li&gt;
 &lt;li&gt;Results can be serialized into the Grasshopper document and later reloaded. The component distinguishes whether results were produced by the optimizer or loaded from a file.&lt;/li&gt;
 &lt;li&gt;If your installation uses an external Python optimizer, verify that the Python environment is accessible from the host machine and any interop code is configured to find the Python interpreter and libraries.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Development notes&lt;/h2&gt;
&lt;ul&gt;
 &lt;li&gt;To debug the plugin, run Rhino and attach the Visual Studio debugger to the Rhino process.&lt;/li&gt;
 &lt;li&gt;When changing serialization formats (chunk names, GUIDs, or data layout), be careful to preserve compatibility with existing saved Grasshopper documents or provide migration logic.&lt;/li&gt;
 &lt;li&gt;UI classes (windows) are created at runtime and registered with Grasshopper's &lt;code&gt;FormShepard&lt;/code&gt;; ensure proper disposal to avoid resource leaks.&lt;/li&gt;
&lt;/ul&gt;