Rhino 3D Tip: Best Practices for RhinoCommon Plugin Development

November 15, 2025 2 min read

Rhino 3D Tip: Best Practices for RhinoCommon Plugin Development

Building robust Rhino plugins? RhinoCommon gives you deep, safe access to Rhino’s geometry kernel and document system. Here are focused ways to elevate your next tool.

  • Start smart
    • Target the right runtime: Rhino 7 uses .NET Framework 4.8; Rhino 8 uses .NET 7. Match your project template to your users’ Rhino version.
    • Reference RhinoCommon via official templates and NuGet where applicable to keep dependencies clean.
    • Separate your plug-in into core (geometry/compute) and shell (commands/UI). This keeps code testable and reusable in Grasshopper components.
  • Command architecture that scales
    • Keep RunCommand lean: parse options, validate input, call core logic, return result.
    • Avoid document side-effects during option prompts; commit geometry changes in a single, controlled block.
    • Respect undo: group edits with Rhino’s undo recording toggles to avoid bloating the stack.
  • Geometry best practices
    • Always read tolerances from the document: doc.ModelAbsoluteTolerance and doc.ModelAngleToleranceRadians. Hardcoding leads to fragile tools.
    • Prefer “TryCreate/TryGet” methods and validate with IsValid checks before adding to the document.
    • Duplicate when needed (DuplicateCurve/DuplicateBrep) and dispose temporary geometry promptly to reduce memory churn.
    • Boolean/offset/shell operations are tolerance-sensitive. Guide users to set reasonable file units and tolerances before running complex operations.
  • Events, safely
    • Subscribe to RhinoDoc events (e.g., AddRhinoObject, DeleteRhinoObject) to react to changes.
    • Throttle event handlers to avoid repeated heavy computations; debounce with a short timer.
    • Always unsubscribe on plug-in unload to prevent leaks.
  • Cross‑platform UI with Eto.Forms
    • Use Eto for Windows and macOS parity; avoid platform-specific dialogs unless necessary.
    • Marshal UI work to the main thread with RhinoApp.InvokeOnUiThread.
    • Persist user preferences using your PlugIn class settings and expose sane defaults.
  • Performance tips
    • Batch document updates and minimize redraws; only call RhinoApp.SetRedraw or RhinoDoc.Views.Redraw when needed.
    • RhinoCommon is not generally thread-safe. Do heavy math on background threads, but add/modify document geometry on the main thread.
    • When appropriate, operate on meshes for speed, then convert to NURBS at the end of a pipeline.
  • Testing and diagnostics
    • Log with RhinoApp.WriteLine and a file logger (e.g., rolling logs per session) for field debugging.
    • Create small, deterministic test files that represent your hardest edge cases (tiny tolerances, nearly coplanar faces, sliver edges).
  • Packaging and delivery
    • Use Yak for distribution: semantic versioning, clear description, icon, and platform tags.
    • Provide a concise “Getting Started” command and sample files to reduce support load.
    • Share common geometry code with your Grasshopper components to offer both scripted and node-based workflows.

Need the latest Rhino license to test across versions or to equip your team? Get competitive pricing and expert guidance from NOVEDGE. Looking to expand your toolchain and keep plugins current? Explore Rhino-related solutions and upgrades at NOVEDGE—their specialists can help you choose the right setup for development and production.



You can find all the Rhino products on the NOVEDGE web site at this page.







Also in Design News

Subscribe