Box

class Communicator.Box()

Represents an axis-aligned bounding box. A box is represented by a minimum and maximum point which describe the extents of the box.

Constructors

Properties


Constructors

constructor

Communicator.Box.constructor(min, max)

Creates a new box.

Arguments
Return type

Communicator.Box

Properties

Communicator.Box.max

The point of maximum extent for the box.

Communicator.Box.min

The point of minimum extent for the box.

Methods

addBox

Communicator.Box.addBox(box)

Expands the extents of the box so that it will contain another box.

Arguments
Return type

void

addPoint

Communicator.Box.addPoint(point)

Expands the extents of the box so that it will contain a particular point.

Arguments
Return type

void

center

Communicator.Box.center()

Gets the center point for the box.

Return type

Communicator.Point3

Returns

The center point of this box.

copy

Communicator.Box.copy()

Creates a copy of the box.

Return type

Communicator.Box

Returns

A copy of this box.

equals

Communicator.Box.equals(box)

Strictly compares this box with another box.

Arguments
Return type

boolean

Returns

True if the values of this box equals the other. False otherwise.

extents

Communicator.Box.extents()

Gets the extents of the box.

Return type

Communicator.Point3

Returns

A point with members set to extent values for each corresponding axis.

forJson

Communicator.Box.forJson()

Note

forJson is deprecated: Use toJson instead.

Return type

Object

getCorners

Communicator.Box.getCorners()

Gets all eight corner points for the box.

Return type

[Communicator.Point3]

Returns

The corner points of this box.

isDegenerate

Communicator.Box.isDegenerate()

Returns whether or not the box is degenerate.

Return type

boolean

Returns

whether or not the box is degenerate.

toJson

Communicator.Box.toJson()

Creates an object ready for JSON serialization.

Return type

Object

Returns

The prepared object.

construct

Communicator.Box.construct(obj)

Note

construct is deprecated: Use fromJson instead.

Arguments
  • obj (any()) –

Return type

Communicator.Box

fromJson

Communicator.Box.fromJson(objData)

Creates a new Box from an object given by toJson

Arguments
  • objData (any()) – An object given by toJson

Return type

Communicator.Box

Returns

The prepared object.

invalid

Communicator.Box.invalid()

Creates and returns an invalid bounding box.

Return type

Communicator.Box

Returns

an invalid bounding box.