An OrientedBox is a 3D shape, composed of eight corner points, that forms a straight-edged volume. Unlike a conventional 3D bounding box, that is aligned to the axes of its reference system, an OrientedBox can adopt any arbitrary orientation, which is determined by its associated Affine3DTransformation object.

Because OrientedBox relies on Cartesian coordinates for defining its shape, it's not available for geodetic references.

Note: OrientedBox instances should be created using the createOrientedBox factory function.

Hierarchy

Constructors

Accessors

  • get bounds(): Bounds
  • The bounds of this shape. This property is to be treated in a read only manner. An error will be thrown when trying to assign to this property. Note that the bounds property is not immutable. Modifying properties of the bounds property may corrupt your data.

    Returns Bounds

  • get coordinateType(): CoordinateType
  • The coordinate type this shape. This property is read only. An Error will be thrown when trying to assign to this property.

    Returns CoordinateType

  • get focusPoint(): Point
  • Retrieves the read-only center point of this oriented box. This property contains an object but should be treated with value semantics: changes to the shape will not be reflected in the focusPoint that was retrieved from this Polygon before the modification.

    Returns Point

  • get reference(): null | CoordinateReference
  • The spatial reference of this shape. This property is read only. An Error will be thrown when trying to assign to this property.

    Returns null | CoordinateReference

Methods

  • Determines whether a given point is inside this shape. This method checks containment only in two dimensions: on the (x,y)-axis or the (lon,lat)-axis (depending on the spatial reference of the shape).

    Parameters

    • x: number | Point | Bounds

      The point for which containment must be checked. If a 3D point is passed to this function, it will be treated as a 2D point: the z coordinate (height) will be ignored. The reference of this point must be the same reference as this Shape

    • Optional y: number

    Returns boolean

    true when the given point is contained in this shape

    Throws

    Point with another spatial reference

    Deprecated

    Please use contains2DPoint instead.

  • Determines whether the given point is inside this oriented box. This method checks containment only in two dimensions: on the (x,y)-axis

    Note that since oriented box is a 3D shape, this function will perform its calculation on a projected version of the box.

    Parameters

    • x: number

      The x coordinate of the point for which containment must be checked

    • y: number

      The y coordinate of the point for which containment must be checked

    Returns boolean

    true when the given point is contained in this shape

    Throws

    InvalidReferenceError when passing a Point with another spatial reference

  • Determines whether the given point is inside this oriented box. This method checks containment only in two dimensions: on the (x,y)-axis.

    Note that since oriented box is a 3D shape, this function will perform its calculation on a projected version of the box.

    Parameters

    • point: Point

      The point for which containment must be checked.

    Returns boolean

    true when the given point is contained in this shape

    Throws

    InvalidReferenceError when passing a Point with another spatial reference

  • Indicates whether this shape is equal to another.

    Parameters

    • otherShape: Shape

      the other shape this shape is compared with.

    Returns boolean

    true if both shapes are equal, false otherwise.

  • Gets the 8 corners of this OrientedBox, in the form of an array of Point objects.

    Note that this is a convenience method that will create copies of the corner points as Point objects.

    Returns Point[]

    an array of Point objects that are copies corner points of this oriented box.

  • Gets the 8 corners of this OrientedBox, in the form of an array of Vector3 objects.

    Returns Vector3[]

    an array of coordinates.

  • Invalidate cache of this oriented box.

    Returns void

  • Converts the oriented box to a string. This functionality is for debugging purposes only. Results of toString cannot be used to uniquely identify a shape instance.

    Returns string

    a string version of this oriented box

  • Translates the shape over the given vector in 2D space. The z-coordinate is not touched

    Parameters

    • x: number

      The x coordinate of the translation vector

    • y: number

      The y coordinate of the translation vector

    Returns void

  • Translates the shape over the given vector in 3D space.

    Parameters

    • x: number

      The x coordinate of the translation vector

    • y: number

      The y coordinate of the translation vector

    • z: number

      The z coordinate of the translation vector

    Returns void