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

    Function solveGrasshopperDefinition

    • Runs a Rhino Compute job using the provided tree prototypes and Grasshopper definition.

      Use this for direct compute control. For high-level API, use GrasshopperClient.solve().

      Parameters

      • dataTree: DataTree[]

        An array of DataTree objects representing the input data for the compute job.

      • definition: string | Uint8Array<ArrayBufferLike>

        The Grasshopper definition, which can be:

        • A URL string (e.g., 'https://example.com/definition.gh')
        • A base64-encoded string of the .gh file
        • A plain string (will be base64-encoded)
        • A Uint8Array of the .gh file (will be base64-encoded)
      • config: GrasshopperComputeConfig

        Compute configuration (server URL, API key, etc. along with optional timeout, units, etc.)

      Returns Promise<GrasshopperComputeResponse>

      An object containing the compute result and extracted file data.

      // Using a URL
      await solveGrasshopperDefinition(trees, 'https://example.com/definition.gh', config);

      // Using a base64 string
      await solveGrasshopperDefinition(trees, 'UEsDBBQAAAAIAL...', config);

      // Using binary data
      const fileData = new Uint8Array([...]);
      await solveGrasshopperDefinition(trees, fileData, config);