src/utils/xbim-viewer.debug.bundle.js
function (bBox) {
        var size = Math.max(bBox[3], bBox[4], bBox[5]);
        var ratio = Math.max(viewer._width, viewer._height) / Math.min(viewer._width, viewer._height);
        viewer._distance = size / Math.tan(viewer.perspectiveCamera.fov * Math.PI / 180.0) * ratio * 1.0;
    }
function (bBox) {
        var size = Math.max(bBox[3], bBox[4], bBox[5]);
        var ratio = Math.max(viewer._width, viewer._height) / Math.min(viewer._width, viewer._height);
        viewer._distance = size / Math.tan(viewer.perspectiveCamera.fov * Math.PI / 180.0) * ratio * 1.0;
    }
helper function for setting of the distance based on camera field of view and size of the product's bounding box