BIM.works SDKs - v2.0.6
    Preparing search index...

    Type Alias Viewer3dSettings

    The settings available for the 3D Viewer

    type Viewer3dSettings = {
        cacheGeometry?: boolean;
        fatWireframes?: {
            cache?: boolean;
            enabled?: boolean;
            pregenerate?: boolean;
        };
        hideObjectOnMiddleClick?: boolean;
        navigationMode?: NavigationMode;
        navigationModes?: Record<string, NavigationModeSettings>;
        nearPlane?: NearPlane;
        preLoadTriangles?: boolean;
        realtimeSettings?: { culling?: boolean };
        rendering?: { antialias?: boolean };
        rightMouseClick?: (event: unknown, qid: Qid) => void;
        showLoader?: boolean;
        spatialQuerying?: {
            implementationPreferences?: SpatialQueryingPreference[];
        };
        technologyAllowed?: {
            sharedArrayBuffer?: boolean;
            transferable?: boolean;
            webGl2?: boolean;
            webGpu?: boolean;
            webWorker?: boolean;
        };
        tileSets?: { [id: string]: { [key: string]: unknown }
        | "separator" };
    }
    Index

    Properties

    cacheGeometry?: boolean

    Whether to cache geometry data in the browser if possible

    fatWireframes?: { cache?: boolean; enabled?: boolean; pregenerate?: boolean }

    Settings related to fat wireframes (currently used in selection visualization)

    Type Declaration

    • Optionalcache?: boolean

      Whether the fat wireframes should be cached, so they load faster the second time, default value is true

    • Optionalenabled?: boolean

      Whether fat wireframes are enabled at all, default value is true

    • Optionalpregenerate?: boolean

      Whether fat wireframes should be generated immediately when loading a model, this makes showing them later on faster, but takes a little more time to load the models, default value is false

    hideObjectOnMiddleClick?: boolean

    Whether objects should be made invisible when clicking with the middle mouse button

    navigationMode?: NavigationMode

    Camera navigation mode. Defaults to default. Use a predefined mode or a custom name from navigationModes.

    navigationModes?: Record<string, NavigationModeSettings>

    Custom named navigation configurations available through navigationMode and startNavigationMode.

    nearPlane?: NearPlane

    Perspective near plane in meters. Defaults to "auto".

    preLoadTriangles?: boolean

    Whether triangle data should be pre-loaded. This speeds up the initial use of the laser measurement tools, and also temporarily circumvents a Chrome 149 introduced crash

    realtimeSettings?: { culling?: boolean }

    Settings that apply to realtime rendering

    Type Declaration

    • Optionalculling?: boolean

      Whether culling should be enabled. Determines which objecs do not have to be rendered by the GPU and can make a big difference in performance on larger models. The actual culling calculations are either done on the CPU or GPU (using WebGL or WebGPU) based on the available technologies

    rendering?: { antialias?: boolean }

    Rendering settings

    Type Declaration

    • Optionalantialias?: boolean

      Whether to apply anti aliasing

    rightMouseClick?: (event: unknown, qid: Qid) => void

    Function to call when the right-mouse is clicked, or more specifically when the contextmenu event is triggered.

    showLoader?: boolean

    Whether to show the "LOADER" div whenever a model is loading, this div can be styled by using the .viewer3d.loader CSS class

    spatialQuerying?: { implementationPreferences?: SpatialQueryingPreference[] }

    Setting for spatial querying

    Type Declaration

    • OptionalimplementationPreferences?: SpatialQueryingPreference[]

      An array of SpatialQueryingPreference. This array sets a list of preferences, the first one having the highest priority. Based on actual availability of technology an implementation is chosen by the viewer. The default for this setting is an array with only the CPU setting defined

    technologyAllowed?: {
        sharedArrayBuffer?: boolean;
        transferable?: boolean;
        webGl2?: boolean;
        webGpu?: boolean;
        webWorker?: boolean;
    }

    Which technologies are allowed to be used. The default setting only allows WebGL2, which is also a required technology for the viewer to work at all.

    Type Declaration

    • OptionalsharedArrayBuffer?: boolean

      SharedArrayBuffer minimizes memory copying between threads by allowing controlled shared access. SharedArrayBuffer is only available in a secure context and in cross-origin isolated environments. See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer

    • Optionaltransferable?: boolean

      When SharedArrayBuffer is not available/allowed, "transferable" is a good alternative, it also avoids copying data between threads, but does so by transferring ownership. Security restrictions for transferable are less, so chances of it being available are higher.

    • OptionalwebGl2?: boolean

      WebGL2 is always required for rendering

    • OptionalwebGpu?: boolean

      WebGPU is currently not used for rendering, but can significantly speed up culling and a few other functionalities

    • OptionalwebWorker?: boolean

      Using web workers offloads work from the main thread and generally results in a much smoother viewing experience. WebWorkers are usually available, but there can be issues with build systems such as Vite/Webpack, which can often be a reason to disable web workers. The above issues can usually not be detected during runtime, therefore explicitly disabling web workers in those cases is needed.

    tileSets?: { [id: string]: { [key: string]: unknown } | "separator" }

    TileSets