All measuring related methods are available on this class. Generally the Viewer3d has a reference to an instance of this class. There can only be one measurement "active" at a time. A measurement that is "active" is still being constructed by the user. When an active measurement is being "finished" it will stop being editable.

Constructors

Methods

  • Add a distance measurement programmatically, for example a measurement that was stored in a database earlier

    Parameters

    • id: string

      A unique id that can be used to reference this measurement later. The user is responsible to make sure the id's of all active measurements are unique

    • coordinate1: vec3

      The first coordinate in 3D space

    • coordinate2: vec3

      The second coordinate in 3D space

    • Optionalnormal: vec3

      The normal that was used on the first coordinate, this is not really used anywhere and can be left empty

    • Optionalconstrain: false

      Whether the original measurement was constrained, also not used anywhere to optional

    Returns DistanceMeasurement

    The DistanceMeasurement object

  • Add a path measurement programmatically, for example a measurement that was stored in a database earlier

    Parameters

    • id: string

      A unique id that can be used to reference this measurement later. The user is responsible to make sure the id's of all active measurements are unique

    • coordinates: vec3[]

      An array of coordinates in 3D space

    • Optionalnormal: vec3

      The normal that was used on the first coordinate, this is not really used anywhere and can be left empty

    • Optionalconstrain: boolean

      Whether the original measurement was constrained, also not used anywhere to optional

    Returns PathMeasurement

    The PathMeasurement object

  • Get the active measurement

    Returns Measurement

    The currently active measurement (being constructed), or null when no measurement is active

  • Get the Axis Aligned Bounding Box (AABB) of the main content. For most models (or model sets) these are just the bounds of all 3D geometry. In certain cases the "Main" bounds are smaller than the real bounds, for example in models that have line geometry that extends beyond the 3D geometry, als certain IFC types are generally regarded as not being part of the main bounds.

    Returns AxisAlignedBoundingBox3D

    An AxisAlignedBoundingBox3D object

  • Returns boolean

    Whether a measurement is currently active (being constructed)

  • Remove all the measurements

    Returns void

  • Remove a measurement by its id

    Parameters

    • id: string

      The unique if of the measurement

    Returns void

  • Start a new distance measurement

    Parameters

    • Optionalconstrain: boolean

      Whether this measurement should be constrained (perpendiculair to the starting face)

    Returns DistanceMeasurement

    A reference to the started DistanceMeasurement

  • Stops the currently active measurement and removes it

    Returns void