brepjs API Reference
    Preparing search index...

    Function init

    brepjs — Public API

    • Auto-detect and initialise the best available kernel.

      Tries occt-wasm (the default kernel) first, then falls back to brepjs-opencascade, then brepkit-wasm. occt-wasm loads via its browser-safe OcctKernel.init() (auto-locates the .wasm via import.meta.url), so no manual registration is required.

      Idempotent — calling it again after a kernel is registered is a no-op that returns the current kernel ID immediately.

      Returns Promise<string>

      The kernel ID that was initialised ('occt-wasm', 'occt', or 'brepkit').

      If no kernel package can be imported.

      import { init, box } from 'brepjs';

      await init();
      const myBox = box(10, 10, 10);