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

Box.constructor([min[, max]])

Creates a new box.

Arguments
Return type

Box()

Properties

Box.max
Type

Point3()

The point of maximum extent for the box.

Box.min
Type

Point3()

The point of minimum extent for the box.

Methods

addBox

Box.addBox(box)

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

Arguments
  • box (Box()) – The box to add.

Return type

void

addPoint

Box.addPoint(point)

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

Arguments
  • point (Point3()) – The point to add.

Return type

void

center

Box.center()

Gets the center point for the box.

Return type

Point3()

Returns

The center point of this box.

copy

Box.copy()

Creates a copy of the box.

Return type

Box()

Returns

A copy of this box.

equals

Box.equals(box)

Strictly compares this box with another box.

Arguments
  • box (Box()) – Box to compare with.

Return type

boolean

Returns

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

extents

Box.extents()

Gets the extents of the box.

Return type

Point3()

Returns

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

forJson

Box.forJson()
Deprecated

Use toJson instead.

Return type

Object

getCorners

Box.getCorners()

Gets all eight corner points for the box.

Return type

[Point3()]

Returns

The corner points of this box.

isDegenerate

Box.isDegenerate()

Returns whether or not the box is degenerate.

Return type

boolean

Returns

whether or not the box is degenerate.

toJson

Box.toJson()

Creates an object ready for JSON serialization.

Return type

Object

Returns

The prepared object.

static construct

Box.construct(obj)
Deprecated

Use fromJson instead.

Arguments
  • obj (any()) –

Return type

Box()

static fromJson

Box.fromJson(objData)

Creates a new Box from an object given by toJson

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

Return type

Box()

Returns

The prepared object.

static invalid

Box.invalid()

Creates and returns an invalid bounding box.

Return type

Box()

Returns

an invalid bounding box.