Xeokit Bim Viewer Versions Save

A browser-based BIM viewer, built on the xeokit SDK

v2.5.1-beta-20

2 months ago

What's Changed

Full Changelog: https://github.com/xeokit/xeokit-bim-viewer/compare/v2.5.1-beta-19...v2.5.1-beta-20

v2.5.1-beta-19

2 months ago

v2.5.1-beta-18

2 months ago

Includes a xeokit-sdk alternative technique for implementing a custom setInterval that runs in a background tab, for the purpose of loading models in the background.

Previously we used a Worker, but one user reports security issues using the Worker behind Apache (see https://github.com/xeokit/xeokit-bim-viewer/issues/168), so we needed to change to a different technique that does not use a Worker.

Before


class WorkerInterval {
    worker = null;

    constructor(callback, interval) {
        const blob = new Blob([`setInterval(() => postMessage(0), ${interval});`]);
        const workerScript = URL.createObjectURL(blob);
        this.worker = new Worker(workerScript);
        this.worker.onmessage = callback;
    }

    stop() {
        this.worker.terminate();
    }
}

const interval = new WorkerInterval(frame, 100);

After

function customSetInterval(callback, interval) {
    let expected = Date.now() + interval;
    function loop() {
        const elapsed = Date.now() - expected;
        callback();
        expected += interval;
        setTimeout(loop, Math.max(0, interval - elapsed));
    }
    loop();
    return {
        cancel: function() {
            // No need to do anything, setTimeout cannot be directly cancelled
        }
    };
}

customSetInterval(() => {
    frame();
}, 100);

v2.5.1-beta-13

3 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/xeokit/xeokit-bim-viewer/compare/v2.5.1-beta-12...v2.5.1-beta-13