Rhino Compute Server

repository·9.x·Indexed 18 days ago

https://github.com/mcneel/compute.rhino3d

A RESTful API interface for RhinoCommon and Grasshopper that enables remote geometric computation and Grasshopper script execution. Built on Rhino 8 for Windows, it includes the compute.geometry core engine, compute.components for Hops integration, and tools for generating client libraries in C#, Python, and JavaScript. Version 0.18.0 introduces strict compatibility with Rhino 9 and support for Model Object serialization in Rhino 9 Grasshopper files.

Tokens
14.3K
Snippets
31
Records
79
Agent score
61%

What's inside compute.rhino3d

  1. Overview of Rhino Compute Server

    9.x
    Rhino Compute is a REST API that provides access to RhinoCommon and Grasshopper. It is built on top of Rhino 8 for Windows and can be deployed in any environment where Rhino 8 for Windows is supported. It allows developers to run Rhino-based geometry and Grasshopper computations remotely via web services.
  2. Understand the Rhino Compute project structure

    9.x
    The compute.rhino3d repository is split into specialized components for geometry processing and communication. The core logic resides in compute.geometry, while compute.components provides the Grasshopper (Hops) integration required to communicate with a geometry server from within Grasshopper.
  3. Model Object serialization in Rhino.Compute v0.18.0

    9.x

    Version 0.18.0 introduced support for the serialization and deserialization of Model Objects from Grasshopper definitions within Rhino.Compute.

    Important Compatibility Note: This feature requires specific changes to the serialization code within Grasshopper files. Consequently, this functionality is only compatible with Rhino 9 Grasshopper files.

  4. Internalize referenced definitions in Hops

    9.x

    Hops can internalize referenced definitions that are saved on a local file system. Internalizing a definition removes the reference to the external file and instead serializes the definition directly inside the Hops component.

    Benefit: Once internalized, you no longer need to share the accompanying referenced file alongside your Hops file.

  5. Use compute.components for Grasshopper Hops integration

    9.x
    The compute.components directory contains the Grasshopper component project (Hops). Use this to enable Grasshopper to communicate with a running compute.geometry server, allowing you to run remote geometry computations as standard Grasshopper components.
  6. Use Optional inputs in Hops

    9.x

    In version 0.16.11 and later, you can make certain parameters act as Optional inputs.

    To do this, use a Context Get component and set the AtLeast value to 0. This tells the system that the parameter is not strictly required for the solve routine.

  7. Use a Hops component in Grasshopper

    9.x

    Once your Python server is running (e.g., at http://127.0.0.1:5000/pointat):

    1. Open Rhino and Grasshopper.
    2. Drop a Hops component onto the canvas.
    3. Right-click the Hops component and enter the full URL of the component (including the path) into the input field.
    4. The component will automatically update its inputs, outputs, and icon based on the server's schema.
  8. Configure Hops client timeout

    9.x

    For long-running calculations, you may need to increase the timeout for the HTTP client used by Hops to communicate with the rhino.compute server.

    This can be configured in the Hops App Settings dialog under Preferences/Solver by entering a value in seconds in the provided textbox.

    Default value: 100s.

  9. Enable DataTree access in Hops

    9.x

    In Rhino builds $\ge$ 7.19.22130.15001 and 8.0.22131.04306, DataTrees are supported.

    All contextual getter components include a menu item to enable or disable DataTree access. When enabled, this setting overrides the default AtMost value used by Hops for item or list access.

    Note: This setting has no effect when using the GH Player command.