Selva Compute API Reference - v1.1.2
    Preparing search index...

    Function fetchRhinoCompute

    • Generic Rhino Compute fetch function. Sends a POST request to any Compute endpoint with pre-prepared arguments.

      Use this for advanced, low-level control over compute requests. For most use cases, prefer higher-level APIs.

      Type Parameters

      • E extends string

        The endpoint name (e.g., 'grasshopper', 'io'). Determines the response type for better type safety.

      Parameters

      • endpoint: E

        The Compute API endpoint (e.g., 'grasshopper', 'io', 'mesh').

      • args: Record<string, any>

        Pre-prepared arguments for the request body.

      • config: ComputeConfig | GrasshopperComputeConfig

        Compute configuration (server URL, API key, timeout, debug).

      Returns Promise<ComputeResponseFor<E>>

      The parsed JSON response from the server, typed according to the endpoint.

      // Basic usage for the Grasshopper endpoint:
      const response = await fetchRhinoCompute(
      'grasshopper',
      {
      pointer: { url: 'https://example.com/definition.gh' },
      values: [{ ParamName: 'x', InnerTree: { '0': [{ type: 'System.Double', data: 10 }] } }]
      },
      { serverUrl: 'https://my-server.com', debug: true, timeoutMs: 30000 }
      );