Viewer3dSettings
Type alias in @bimworks/viewer3d.
API catalogue · @bimworks/viewer3d · Type alias
type Viewer3dSettings = {
autoRender?: boolean;
browserFullscreenElement?: HTMLElement;
cacheGeometry?: boolean;
clustering?: boolean;
debugging?: { renderStatistics?: { gpu: GroupStat; viewer?: GroupStat } };
fatWireframes?: { cache?: boolean; enabled?: boolean; pregenerate?: boolean };
gisRadiusMeters?: number;
hideObjectOnMiddleClick?: boolean;
navigationMode?: NavigationMode;
navigationModes?: Record<string, NavigationModeSettings>;
nearPlane?: NearPlane;
planLabels?: { dropLines?: boolean; enabled?: boolean; fontSize?: number; height?: "top" | "bottom"; maxTilt?: number; occlusion?: boolean; orientation?: "HORIZONTAL" | "AUTO"; spaces?: boolean };
pointClouds?: boolean;
preLoadTriangles?: boolean;
proximityFade?: { enabled?: boolean; fadeFar?: number | "auto"; fadeNear?: number | "auto"; minRampRatio?: number; nearPlaneMargin?: number; smoothingTauMs?: number };
realtimeSettings?: { annotationLimit?: number; annotationScaleByDistance?: boolean; culling?: boolean; cullingSettlingMs?: number; cullingTargetFps?: number | null; cullingTriangleBudget?: number; drawWireframes?: WireframeRendering; dynamicCullingBudget?: boolean; experimentalCapStyles?: boolean; experimentalObjectEndcaps?: boolean; forceTwoSidedRendering?: boolean; orderIndependentTransparency?: boolean; persistCullingBudget?: boolean; pickTargetHighlight?: { enabled?: boolean; onTopAlpha?: number; outlineColor?: [number, number, number, number]; outlinePx?: number; rampSeconds?: number; settleSpeed?: number; tint?: number }; pointCloudIdlePointBudget?: number; pointCloudPointBudget?: number; pointCloudScanStations?: boolean; progressiveFullDetail?: boolean; sectionCulling?: boolean; sectionPlaneAnnotationMode?: SectionPlaneAnnotationMode; sectionPlaneAnnotationReach?: number; textAnnotationMode?: "label" | "dot" };
rendering?: { antialias?: boolean; sharedFrames?: boolean };
rightMouseClick?: (event: MouseEvent, qid: Qid | null, pick: PickResult | null) => void;
showLoader?: boolean;
spatialQuerying?: { implementationPreferences?: (SpatialQueryingPreference)[] };
technologyAllowed?: { sharedArrayBuffer?: boolean; transferable?: boolean; webGl2?: boolean; webGpu?: boolean; webWorker?: boolean };
tileSets?: { [id: string]: { [key: string]: unknown } | "separator" };
};The settings available for the 3D Viewer
Members#
| Member | Kind | Description |
|---|---|---|
| autoRender | Property | Ignored: the viewer always runs its own render loop (Viewer3d.start/Viewer3d.stop) |
| browserFullscreenElement | Property | The element that goes full screen (Viewer3d.toggleFullScreen, game and drone navigation); default the container. Pass a parent to take overlays such as a min… |
| cacheGeometry | Property | Whether to cache geometry data in the browser if possible |
| clustering | Property | Group models that lie far apart into clusters the user can switch between. Default false. |
| debugging | Property | Developer diagnostics |
| fatWireframes | Property | Settings related to fat wireframes (currently used in selection visualization) |
| gisRadiusMeters | Property | GIS margin in metres outside the bounding circle of all loaded buildings. Default 500. Applies to drawing, picking and content requests; reload GIS layers af… |
| hideObjectOnMiddleClick | Property | Whether objects should be made invisible when clicking with the middle mouse button |
| navigationMode | Property | Camera navigation mode. Defaults to default. Use a predefined mode or a custom name from navigationModes. |
| navigationModes | Property | Custom named navigation configurations available through navigationMode and startNavigationMode. |
| nearPlane | Property | Perspective near plane in meters. Defaults to "auto". |
| planLabels | Property | Text labels in plan views (Viewer3D/docs/plan-labels-design.md): the labels of ObjectStateManager.setLabels and, with spaces, a default label (name, long n… |
| pointClouds | Property | Whether the viewer loads the ModelManager's point clouds (E57, LAS, LAZ, PLY). Default true. false leaves them out, as the minimap's plan does: they are neit… |
| preLoadTriangles | Property | 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 intr… |
| proximityFade | Property | The camera-proximity fade of the soft-occluder set (ObjectStateManager.setSoftOccluderSet). enabled: false disables the feature entirely; the other keys ar… |
| realtimeSettings | Property | Settings that apply to realtime rendering |
| rendering | Property | Rendering settings |
| rightMouseClick | Property | Function to call when the right-mouse is clicked, or more specifically when the contextmenu event is triggered on the canvas; the browser's own menu is sup… |
| showLoader | Property | Whether to show the "LOADER" div whenever a model is loading, this div can be styled by using the .viewer3d.loader CSS class |
| spatialQuerying | Property | Setting for spatial querying |
| technologyAllowed | Property | |
| tileSets | Property | TileSets |
autoRender#
autoRender?: booleanIgnored: the viewer always runs its own render loop (Viewer3d.start/Viewer3d.stop)
browserFullscreenElement#
browserFullscreenElement?: HTMLElementThe element that goes full screen (Viewer3d.toggleFullScreen, game and drone navigation); default the container. Pass a parent to take overlays such as a minimap along
cacheGeometry#
cacheGeometry?: booleanWhether to cache geometry data in the browser if possible
clustering#
clustering?: booleanGroup models that lie far apart into clusters the user can switch between. Default false.
debugging#
Developer diagnostics
fatWireframes#
fatWireframes?: { cache?: boolean; enabled?: boolean; pregenerate?: boolean }Settings related to fat wireframes (currently used in selection visualization)
gisRadiusMeters#
gisRadiusMeters?: numberGIS margin in metres outside the bounding circle of all loaded buildings. Default 500. Applies to drawing, picking and content requests; reload GIS layers after changing it.
hideObjectOnMiddleClick#
hideObjectOnMiddleClick?: booleanWhether objects should be made invisible when clicking with the middle mouse button
navigationMode#
navigationMode?: NavigationModeCamera navigation mode. Defaults to default. Use a predefined mode or a custom name from navigationModes.
navigationModes#
navigationModes?: Record<string, NavigationModeSettings>Custom named navigation configurations available through navigationMode and startNavigationMode.
nearPlane#
Perspective near plane in meters. Defaults to "auto".
planLabels#
planLabels?: { dropLines?: boolean; enabled?: boolean; fontSize?: number; height?: "top" | "bottom"; maxTilt?: number; occlusion?: boolean; orientation?: "HORIZONTAL" | "AUTO"; spaces?: boolean }Text labels in plan views (Viewer3D/docs/plan-labels-design.md): the labels of ObjectStateManager.setLabels and,
with spaces, a default label (name, long name, floor area) on every space, drawn inside their objects when the
text fits, horizontal on screen at any turn of the plan
pointClouds#
pointClouds?: booleanWhether the viewer loads the ModelManager's point clouds (E57, LAS, LAZ, PLY). Default true. false leaves them out, as the minimap's plan does: they are neither loaded nor reported loaded
preLoadTriangles#
preLoadTriangles?: booleanWhether 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
proximityFade#
proximityFade?: { enabled?: boolean; fadeFar?: number | "auto"; fadeNear?: number | "auto"; minRampRatio?: number; nearPlaneMargin?: number; smoothingTauMs?: number }The camera-proximity fade of the soft-occluder set (ObjectStateManager.setSoftOccluderSet). enabled: false disables the feature entirely;
the other keys are the starting values of Viewer3d.setProximityFadeConfig, distances in model units (usually mm).
Default: enabled, fadeNear and fadeFar "auto", minRampRatio 2, smoothingTauMs 100, nearPlaneMargin 100
realtimeSettings#
realtimeSettings?: { annotationLimit?: number; annotationScaleByDistance?: boolean; culling?: boolean; cullingSettlingMs?: number; cullingTargetFps?: number | null; cullingTriangleBudget?: number; drawWireframes?: WireframeRendering; dynamicCullingBudget?: boolean; experimentalCapStyles?: boolean; experimentalObjectEndcaps?: boolean; forceTwoSidedRendering?: boolean; orderIndependentTransparency?: boolean; persistCullingBudget?: boolean; pickTargetHighlight?: { enabled?: boolean; onTopAlpha?: number; outlineColor?: [number, number, number, number]; outlinePx?: number; rampSeconds?: number; settleSpeed?: number; tint?: number }; pointCloudIdlePointBudget?: number; pointCloudPointBudget?: number; pointCloudScanStations?: boolean; progressiveFullDetail?: boolean; sectionCulling?: boolean; sectionPlaneAnnotationMode?: SectionPlaneAnnotationMode; sectionPlaneAnnotationReach?: number; textAnnotationMode?: "label" | "dot" }Settings that apply to realtime rendering
rendering#
rendering?: { antialias?: boolean; sharedFrames?: boolean }Rendering settings
rightMouseClick#
rightMouseClick?: (event: MouseEvent, qid: Qid | null, pick: PickResult | null) => voidFunction to call when the right-mouse is clicked, or more specifically when the contextmenu event
is triggered on the canvas; the browser's own menu is suppressed. Not called when the button is bound
to a viewer action in the active navigation mode. Use it to open your own context menu: position
the menu with event.clientX / event.clientY, and keep pick for the menu's actions. See
SectionPlanes.startPlaneAt for a "Section plane" entry on the right-clicked face.
showLoader#
showLoader?: booleanWhether to show the "LOADER" div whenever a model is loading, this div can be styled by using the .viewer3d.loader CSS class
spatialQuerying#
spatialQuerying?: { implementationPreferences?: (SpatialQueryingPreference)[] }Setting for spatial querying
technologyAllowed#
technologyAllowed?: { sharedArrayBuffer?: boolean; transferable?: boolean; webGl2?: boolean; webGpu?: boolean; webWorker?: boolean }tileSets#
tileSets?: { [id: string]: { [key: string]: unknown } | "separator" }TileSets