import { OcctKernel } from "https://YOUR-INSTANCE.example.com/api/notes/__OCCT_JS_ID__/download";
let kernel = null;
let initP = null;
self.onmessage = async function (e) {
    var d = e.data;
    if (d.type !== "parse") return;
    try {
        if (!initP) initP = OcctKernel.init({ wasm: d.wasm });
        kernel = await initP;
        var shape = kernel.importStep(d.data);
        var mesh = kernel.tessellate(shape, d.params);
        kernel.release(shape);
        self.postMessage({ type: "done", positions: mesh.positions, normals: mesh.normals, indices: mesh.indices }, [mesh.positions.buffer, mesh.normals.buffer, mesh.indices.buffer]);
    } catch (err) {
        self.postMessage({ type: "error", message: "parse: " + (err && err.message || err) });
    }
};