Aardvark.Base


Box2d

Constructors

ConstructorDescription
new(box)
Signature: box:Box2f -> unit
new(min, max)
Signature: (min:V2d * max:V2d) -> unit

Creates a box from minimum and maximum limits.

new(minX, minY, maxX, maxY)
Signature: (minX:float * minY:float * maxX:float * maxY:float) -> unit

Creates a box from minimum and maximum limits.

new(pnt)
Signature: pnt:V2d -> unit

Creates infinitesimal box from single point.

new(p0, p1, p2)
Signature: (p0:V2d * p1:V2d * p2:V2d) -> unit

Creates a box from 3 points.

new(p0, p1, p2, p3)
Signature: (p0:V2d * p1:V2d * p2:V2d * p3:V2d) -> unit

Creates a box from 4 points.

new(range)
Signature: range:Box2d -> unit

Creates copy of existing range.

new(b0, b1)
Signature: (b0:Box2d * b1:Box2d) -> unit

Create a box containing all supplied boxs.

new(b0, b1, b2)
Signature: (b0:Box2d * b1:Box2d * b2:Box2d) -> unit

Create a box containing all supplied boxs.

new(b0, b1, b2, b3)
Signature: (b0:Box2d * b1:Box2d * b2:Box2d * b3:Box2d) -> unit

Create a box containing all supplied boxs.

new(points)
Signature: (points:V2d []) -> unit

Creates box as the bounding box of given points.

new(points, start, count)
Signature: (points:V2d [] * start:int64 * count:int64) -> unit

Creates box as the bounding box of count of the given points starting at start.

new(points)
Signature: points:IEnumerable<V2d> -> unit

Creates box as the bounding box of given points.

new(boxes)
Signature: boxes:IEnumerable<Box2d> -> unit

Creates box as the bounding box of given boxes.

new(rangeX, rangeY)
Signature: (rangeX:Range1d * rangeY:Range1d) -> unit

Creates box from a Range1 in each direction.

Instance members

Instance memberDescription
Area
Signature: float
Bottom()
Signature: unit -> unit

Same as Max.Y.

BoundingBox2d
Signature: Box2d
Modifiers: abstract
Center
Signature: V2d
Modifiers: abstract
Clamped(p)
Signature: p:V2d -> V2d

Return the point in the Box that is closest to the supplied point.

ComputeCorners()
Signature: unit -> V2d []

Computes the corners of the box and returns them in an array. The order of the corners is determined by their index which is constructed as in the method .

ComputeCornersCCW()
Signature: unit -> V2d []
Contains(p)
Signature: p:V2d -> bool
Modifiers: abstract

Returns true if the box contains the given point.

Contains(b)
Signature: b:Box2d -> bool
Modifiers: abstract

Returns true if the box completely contains the given box.

Corner(index)
Signature: index:int -> V2d

Return the corner of the box with the given index. The corner index is constructed in such a way, that bit 0 enumerates the x coordinate (0 ... min, 1 ... max), bit 1 enumerates the y coordinate, and bit 2 enumerates the z coordinate.

Distance(p)
Signature: p:V2d -> float
DistanceSquared(p)
Signature: p:V2d -> float
EnlargeBy(delta)
Signature: delta:V2d -> unit
Modifiers: abstract

Enlarges box by the supplied value in all directions.

EnlargeBy(deltaMin, deltaMax)
Signature: (deltaMin:V2d * deltaMax:V2d) -> unit
Modifiers: abstract

Enlarges box by the supplied values.

EnlargeBy(delta)
Signature: delta:float -> unit

Enlarges box by specified value in all directions.

EnlargeBy(...)
Signature: (deltaMinX:float * deltaMaxX:float * deltaMinY:float * deltaMaxY:float) -> unit

Enlarges the box by the specified values (paddings).

EnlargeByRelativeEps(eps)
Signature: eps:float -> unit

Enlarge the box in all directions by the supplied epsilon which is measured with respect to the box diagonal.

EnlargedBy(increment)
Signature: increment:V2d -> Box2d
Modifiers: abstract

Return box enlarged by the supplied value in all directions.

EnlargedBy(deltaMin, deltaMax)
Signature: (deltaMin:V2d * deltaMax:V2d) -> Box2d
Modifiers: abstract

Return box enlarged by the supplied values.

EnlargedBy(delta)
Signature: delta:float -> Box2d

Returns a box enlarged by the specified value in all directions.

EnlargedBy(...)
Signature: (deltaMinX:float * deltaMaxX:float * deltaMinY:float * deltaMaxY:float) -> Box2d

Returns the box enlarged by the specified values (paddings).

EnlargedByRelativeEps(eps)
Signature: eps:float -> Box2d

Return a box enlarged in all directions by the supplied epsilon which is measured with respect to the box diagonal.

Equals(obj)
Signature: obj:obj -> bool
Modifiers: abstract
ExtendBy(box)
Signature: box:Box2d -> unit
Modifiers: abstract

Extends the box to contain the supplied box.

ExtendBy(point)
Signature: point:V2d -> unit
Modifiers: abstract

Extends the box to contain the supplied value.

ExtendDimBy(dim, x)
Signature: (dim:int * x:float) -> Box2d
ExtendedBy(b)
Signature: b:Box2d -> Box2d
Modifiers: abstract

Returns the box extended to contain the supplied box.

ExtendedBy(v)
Signature: v:V2d -> Box2d
Modifiers: abstract

Returns the box extended to contain the supplied value.

ExtendXBy(x)
Signature: x:float -> Box2d
ExtendYBy(y)
Signature: y:float -> Box2d
GetHashCode()
Signature: unit -> int
Modifiers: abstract
GetMinMaxInDirection(v, vMin, vMax)
Signature: (v:V2d * vMin:byref<V2d> * vMax:byref<V2d>) -> unit

Gets the minimal and maximal points of the box when seen from the supplied direction vector v.

II
Signature: V2d
Intersection(b)
Signature: b:Box2d -> Box2d
Intersects(box)
Signature: box:Box2d -> bool
Modifiers: abstract

Returns true if 2 boxes intersect each other.

Intersects(box, eps)
Signature: (box:Box2d * eps:V2d) -> bool
Modifiers: abstract

Returns true if 2 boxes intersect each other with tolerance parameter.

Intersects(box, eps)
Signature: (box:Box2d * eps:float) -> bool

Returns true if 2 boxes intersect each other with tolerance parameter.

Invalidate()
Signature: unit -> Box2d
InvLerp(p)
Signature: p:V2d -> V2d

Inverse of Lerp.

InvLerp(x, y)
Signature: (x:float * y:float) -> V2d

Inverse of Lerp.

IO
Signature: V2d
IsEmpty
Signature: bool
Modifiers: abstract

True if the box is invalid or has a zero volume.

IsInfinite
Signature: bool

True if the box is infinite.

IsInvalid
Signature: bool
Modifiers: abstract

True if the box is invalid.

IsNonEmpty
Signature: bool
Modifiers: abstract

True if the box has a non-zero volume.

IsValid
Signature: bool
Modifiers: abstract

True if the box is valid.

Left()
Signature: unit -> unit

Same as Min.X.

Lerp(x)
Signature: x:float -> V2d

Linearly interpolates between min and max.

Lerp(p)
Signature: p:V2d -> V2d

Interpolate linearly in each dimension.

Lerp(x, y)
Signature: (x:float * y:float) -> V2d

Interpolate linearly in each dimension.

MajorDim
Signature: int

Index of the longest dimension of the box.

MinorDim
Signature: int

Index of the shortest dimension of the box.

OI
Signature: V2d
OO
Signature: V2d
OutsideFlags(p0)
Signature: p0:V2d -> Flags

Returns where a points coordinates are outside a given box

OutsideFlags(b)
Signature: b:Box2d -> Flags

Returns where the planes of the supplied box b are outside of the box.

RangeX
Signature: Range1d
RangeY
Signature: Range1d
Repair()
Signature: unit -> Box2d
Modifiers: abstract

Checks if the box is still valid and repairs if not.

Right()
Signature: unit -> unit

Same as Max.X.

Scaled(factor)
Signature: factor:V2d -> Box2d

Returns a scaled box. WARNING: scaling is performed around the origin! A negative scale factor will resut in an invalid box!

ScaledFromCenterBy(factor)
Signature: factor:float -> Box2d

Return box scaled by the supplied factor around its center.

ScaledFromCenterBy(vectorFactor)
Signature: vectorFactor:V2d -> Box2d

Return box scaled by the supplied factor around its center.

ShrinkBy(delta)
Signature: delta:V2d -> unit
Modifiers: abstract

Shrinks box by the supplied value in all directions.

ShrinkBy(deltaMin, deltaMax)
Signature: (deltaMin:V2d * deltaMax:V2d) -> unit
Modifiers: abstract

Shrinks box by the supplied values.

ShrinkBy(delta)
Signature: delta:float -> unit

Shrinks box by specified value in all directions.

ShrinkBy(...)
Signature: (deltaMinX:float * deltaMaxX:float * deltaMinY:float * deltaMaxY:float) -> unit

Shrinks the box by the specified values (paddings).

ShrunkBy(delta)
Signature: delta:V2d -> Box2d
Modifiers: abstract

Return box shrunk by the supplied value in all directions.

ShrunkBy(deltaMin, deltaMax)
Signature: (deltaMin:V2d * deltaMax:V2d) -> Box2d
Modifiers: abstract

Return box shrunk by the supplied values.

ShrunkBy(delta)
Signature: delta:float -> Box2d

Returns a box shrunk by the specified value in all directions.

ShrunkBy(...)
Signature: (deltaMinX:float * deltaMaxX:float * deltaMinY:float * deltaMaxY:float) -> Box2d

Returns the box shrunk by the specified values (paddings).

Size()
Signature: unit -> unit
Modifiers: abstract

Calculates size of the box.

Size2d
Signature: V2d
Modifiers: abstract
SizeX()
Signature: unit -> unit
SizeY()
Signature: unit -> unit
SplitBottom(splitAtY)
Signature: splitAtY:float -> Box2d
SplitLeft(splitValue)
Signature: splitValue:V2d -> Box2d
Modifiers: abstract
SplitLeft(splitAtX)
Signature: splitAtX:float -> Box2d
SplitLeftBottom(splitAt)
Signature: splitAt:V2d -> Box2d
SplitLeftTop(splitAt)
Signature: splitAt:V2d -> Box2d
SplitRight(splitValue)
Signature: splitValue:V2d -> Box2d
Modifiers: abstract
SplitRight(splitAtX)
Signature: splitAtX:float -> Box2d
SplitRightBottom(splitAt)
Signature: splitAt:V2d -> Box2d
SplitRightTop(splitAt)
Signature: splitAt:V2d -> Box2d
SplitTop(splitAtY)
Signature: splitAtY:float -> Box2d
Top()
Signature: unit -> unit

Same as Min.Y.

ToPolygon2dCCW()
Signature: unit -> Polygon2d
ToString()
Signature: unit -> string
Modifiers: abstract
ToString(format)
Signature: format:string -> string
ToString(format, fp)
Signature: (format:string * fp:IFormatProvider) -> string
Modifiers: abstract
ToString(...)
Signature: (format:string * fp:IFormatProvider * beginB:string * betweenB:string * endB:string * beginV:string * betweenV:string * endV:string) -> string

Outputs e.g. a Box2 in the form "(beginB)(beginV)min.x(betweenV)min.y(endV)(betweenB)(beginV)max.x(betweenV)max.y(endV)(endB)".

Transformed(trafo)
Signature: trafo:M33d -> Box2d
Transformed(trafo)
Signature: trafo:Trafo2d -> Box2d
Translated(shift)
Signature: shift:V2d -> Box2d
Union(b)
Signature: b:Box2d -> Box2d

Static members

Static memberDescription
FromCenterAndSize(center, size)
Signature: (center:V2d * size:V2d) -> Box2d

Returns new box [center - size / 2, center + size / 2].

FromCenterAndSize(center, iSize)
Signature: (center:V2d * iSize:ISize2d) -> Box2d

Returns new box [center - iSize / 2, center + iSize / 2].

FromCenterAndSize(center, width, height)
Signature: (center:V2d * width:float * height:float) -> Box2d
FromCenterAndSize(...)
Signature: (centerX:float * centerY:float * width:float * height:float) -> Box2d
FromMinAndSize(min, size)
Signature: (min:V2d * size:V2d) -> Box2d

Returns new box [min, min + size].

FromMinAndSize(min, iSize)
Signature: (min:V2d * iSize:ISize2d) -> Box2d

Returns new box [min, min + iSize].

FromMinAndSize(min, width, height)
Signature: (min:V2d * width:float * height:float) -> Box2d
FromMinAndSize(...)
Signature: (minX:float * minY:float * width:float * height:float) -> Box2d
FromPoints(p0, p1)
Signature: (p0:V2d * p1:V2d) -> Box2d

Creates box from 2 points which need not be Min and Max.

FromSize(size)
Signature: size:V2d -> Box2d

Returns new box [0, size].

FromSize(iSize)
Signature: iSize:ISize2d -> Box2d

Returns new box [0, iSize].

FromSize(width, height)
Signature: (width:float * height:float) -> Box2d
Intersection(a, b)
Signature: (a:Box2d * b:Box2d) -> Box2d
op_Addition(box, v)
Signature: (box:Box2d * v:V2d) -> Box2d

Returns a box shifted by the supplied value.

op_Equality(a, b)
Signature: (a:Box2d * b:Box2d) -> bool

Checks if 2 boxes are equal.

op_Explicit(box)
Signature: box:Box2f -> Box2d
op_Inequality(a, b)
Signature: (a:Box2d * b:Box2d) -> bool

Checks if 2 boxes are not equal.

op_Subtraction(box, v)
Signature: (box:Box2d * v:V2d) -> Box2d

Returns a box shifted by the negative supplied value.

Parse(s)
Signature: s:string -> Box2d
Parse(t)
Signature: t:Text -> Box2d
Union(a, b)
Signature: (a:Box2d * b:Box2d) -> Box2d
Fork me on GitHub