Skip to content

Shapemetry API


Shapemetry API / BoundingBox2d

Class: BoundingBox2d

Defined in: core2d/BoundingBox2D.ts:6

An axis-aligned 2D bounding box (min/max corner points).

Constructors

Constructor

new BoundingBox2d(min, max): BoundingBox2d

Defined in: core2d/BoundingBox2D.ts:7

Parameters

min

Point2d

max

Point2d

Returns

BoundingBox2d

Properties

min

min: Point2d

Defined in: core2d/BoundingBox2D.ts:7


max

max: Point2d

Defined in: core2d/BoundingBox2D.ts:7

Accessors

isEmpty

Get Signature

get isEmpty(): boolean

Defined in: core2d/BoundingBox2D.ts:21

Returns

boolean

Methods

empty()

static empty(): BoundingBox2d

Defined in: core2d/BoundingBox2D.ts:9

Returns

BoundingBox2d


fromPoints()

static fromPoints(points): BoundingBox2d

Defined in: core2d/BoundingBox2D.ts:11

Parameters

points

Point2d[]

Returns

BoundingBox2d


expand()

expand(p): BoundingBox2d

Defined in: core2d/BoundingBox2D.ts:25

Parameters

p

Point2d

Returns

BoundingBox2d


center()

center(): Point2d

Defined in: core2d/BoundingBox2D.ts:32

Returns

Point2d


corners()

corners(): Point2d[]

Defined in: core2d/BoundingBox2D.ts:34

Returns

Point2d[]


contains()

contains(p): boolean

Defined in: core2d/BoundingBox2D.ts:39

Parameters

p

Point2d

Returns

boolean


area()

area(): number

Defined in: core2d/BoundingBox2D.ts:43

Returns

number


size()

size(): object

Defined in: core2d/BoundingBox2D.ts:45

Returns

object

x

x: number

y

y: number


intersects()

intersects(other): boolean

Defined in: core2d/BoundingBox2D.ts:47

Parameters

other

BoundingBox2d

Returns

boolean


union()

union(other): BoundingBox2d

Defined in: core2d/BoundingBox2D.ts:52

Parameters

other

BoundingBox2d

Returns

BoundingBox2d


transform()

transform(m): BoundingBox2d

Defined in: core2d/BoundingBox2D.ts:59

Parameters

m

Transformation2d

Returns

BoundingBox2d


toJSON()

toJSON(): BoundingBox2dJSON

Defined in: core2d/BoundingBox2D.ts:63

Returns

BoundingBox2dJSON


fromJSON()

static fromJSON(d): BoundingBox2d

Defined in: core2d/BoundingBox2D.ts:64

Parameters

d

BoundingBox2dJSON

Returns

BoundingBox2d