Reference·JavaScript · @bimworks/viewercommonJavaScript

ViewFitOptions

Type alias in @bimworks/viewercommon.

API catalogue · @bimworks/viewercommon · Type alias

TypeScript#
type ViewFitOptions = {
  animate?: boolean;
  animationTimeMs?: number;
  margin?: number;
  rotation?: ViewFitRotation;
  rotationObject?: Qid;
  target?: vec3;
  updatePivot?: boolean;
  viewDirection?: vec3;
};

Members#

Member Kind Description
animate Property Whether to animate, when omitted this will default to what has been defined on the Viewer
animationTimeMs Property The total animation time in milliseconds, only effective when animate is set to true
margin Property An optional margin (in percentage of total viewer size) to use as a buffer round the selected models. A perspective camera fits the bounding sphere of the ob…
rotation Property How the fit rotates a plan, default "KEEP": the Viewer2d's, and the Viewer3d's in a plan from the top or bottom
rotationObject Property The object whose oriented bounding box orients the plan for rotation "OBJECT_AXIS" (plans only)
target Property Optional target in 3D
updatePivot Property Whether the pivot should be updated to the center of the aabb of the given objects. Without it, the next orbit that starts on nothing pivots under the cursor…
viewDirection Property Optional view direction in 3D

animate#

TypeScript#
animate?: boolean

Whether to animate, when omitted this will default to what has been defined on the Viewer

animationTimeMs#

TypeScript#
animationTimeMs?: number

The total animation time in milliseconds, only effective when animate is set to true

margin#

TypeScript#
margin?: number

An optional margin (in percentage of total viewer size) to use as a buffer round the selected models. A perspective camera fits the bounding sphere of the objects, an orthographic one (fov 0) their bounding box as the screen sees it.

rotation#

TypeScript#
rotation?: ViewFitRotation

How the fit rotates a plan, default "KEEP": the Viewer2d's, and the Viewer3d's in a plan from the top or bottom

rotationObject#

TypeScript#
rotationObject?: Qid

The object whose oriented bounding box orients the plan for rotation "OBJECT_AXIS" (plans only)

target#

TypeScript#
target?: vec3

Optional target in 3D

updatePivot#

TypeScript#
updatePivot?: boolean

Whether the pivot should be updated to the center of the aabb of the given objects. Without it, the next orbit that starts on nothing pivots under the cursor, at the depth of the point the fit looks at (one that starts on an object pivots on that object's point under the cursor either way)

viewDirection#

TypeScript#
viewDirection?: vec3

Optional view direction in 3D