Intermact API Reference / @intermact/render-three / ComputeClient
Interface: ComputeClient
Defined in: worker/client.ts:14
A handle for running ComputeJobs, whether on a Worker or in-process. Always async so callers don't branch on which backend is in use.
Methods
dispose()
dispose():
void
Defined in: worker/client.ts:18
Release resources (terminates an owned Worker).
Returns
void
run()
run<
K>(job):Promise<ResultFor<K>>
Defined in: worker/client.ts:16
Run a job, resolving with its typed result.
Type Parameters
K
K extends "resample" | "triangulate" | "marching-cubes" | "parse-svg-path"
Parameters
job
Extract<{ closed: boolean; count: number; kind: "resample"; points: Float32Array; }, { kind: K; }> | Extract<{ contours: readonly FlatContour[]; kind: "triangulate"; }, { kind: K; }> | Extract<{ dims: readonly [number, number, number]; field: Float64Array; kind: "marching-cubes"; level?: number; max: readonly [number, number, number]; min: readonly [number, number, number]; }, { kind: K; }> | Extract<{ d: string; kind: "parse-svg-path"; options?: SvgPathParseOptions; }, { kind: K; }>
Returns
Promise<ResultFor<K>>