geometryKernel.loadGeometryKernel

Load, initialise and register the kernel3d and kernel2d WASM modules once, or register ones the host already loaded.

GeometricSince 0.3.0

Usage

TypeScript
loadGeometryKernel(k3d?: Kernel3dModule, k2d?: Kernel2dModule, options?: LoadGeometryKernelOptions): Promise<void>

Parameters

  • k3dKernel3dModule

    An initialised kernel3d module to register instead of loading one. Default undefined.

  • k2dKernel2dModule

    An initialised kernel2d module to register instead of loading one (since 0.4.0). Default undefined.

  • optionsLoadGeometryKernelOptions

    threads: "auto" loads the threaded kernel3d when threadsPossible() and the build is present, "off" never does; threadedModule: how to import that build, e.g. () => import("@havn-earth/kernel/wasm3d-threaded") in a bundled host (since 0.10.0). Both builds give the same results bit for bit. Default { threads: "auto" }.

Returns

A promise that settles when the modelling operations can run.

Guarantees

  • geometryKernelReady() is true afterwards

Example

TypeScript
typeof loadGeometryKernel // → "function"

See also