Logo Euclid

BRect Type

A struct of 4 floats representing an immutable 2D bounding rectangle. Sometimes also called 2D a bounding box. This implementation guarantees the rectangle to be always valid. That means the Min X and Y values are always smaller or equal than the respective Max values.

   Y-axis
   ^
   |
   |             2 max X,Y
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |       local
   +------------+-----> X-axis
  0-min X,Y      1
val max: e1: 'T -> e2: 'T -> 'T (requires comparison)
val min: e1: 'T -> e2: 'T -> 'T (requires comparison)

Record fields

Record Field Description

MaxX

Full Usage: MaxX

Field type: float

The fields holding the maximum X value of this bounding rectangle.

Field type: float

MaxY

Full Usage: MaxY

Field type: float

The fields holding the maximum Y value of this bounding rectangle.

Field type: float

MinX

Full Usage: MinX

Field type: float

The fields holding the minimum X value of this bounding rectangle.

Field type: float

MinY

Full Usage: MinY

Field type: float

The fields holding the minimum Y value of this bounding rectangle.

Field type: float

Instance members

Instance member Description

this.Area

Full Usage: this.Area

Returns: float
Modifiers: inline

Returns the area of this bounding rectangle.

Returns: float

this.AsFSharpCode

Full Usage: this.AsFSharpCode

Returns: string

Format bounding rectangle into an F# code string that can be used to recreate the rectangle.

Returns: string

this.AsRect2D

Full Usage: this.AsRect2D

Returns: Rect2D

Returns a 2D rectangle representation of this bounding rectangle.

Returns: Rect2D

this.AsString

Full Usage: this.AsString

Returns: string

Format bounding rectangle into string with nice floating point number formatting of size and position. But without full type name as in rect.ToString()

Returns: string

this.Center

Full Usage: this.Center

Returns: Pt
Modifiers: inline

The center of the bounding rect.

Returns: Pt

this.Contains

Full Usage: this.Contains

Parameters:
Returns: bool
Modifiers: inline

Returns TRUE if the other bounding rectangle is inside or exactly on this bounding rectangle.

o : BRect
Returns: bool

this.ContainsPt

Full Usage: this.ContainsPt

Parameters:
Returns: bool
Modifiers: inline

Returns TRUE if the point is inside or exactly on this bounding rectangle.

p : Pt
Returns: bool

this.ContainsXY

Full Usage: this.ContainsXY

Parameters:
    x : float
    y : float

Returns: bool
Modifiers: inline

Returns TRUE if the point is inside or exactly on this bounding rectangle.

x : float
y : float
Returns: bool

this.CountZeroSides

Full Usage: this.CountZeroSides

Returns: int
Modifiers: inline

Counts the amount of sides that are smaller than the zeroLength tolerance. This is 0, 1, or 2.

Returns: int

this.Diagonal

Full Usage: this.Diagonal

Returns: Vc
Modifiers: inline

The diagonal 2D vector of the bounding rect. From MinPt to MaxPt.

Returns: Vc

this.Edge01

Full Usage: this.Edge01

Returns: Line2D

The bottom edge. The line from point 0 to 1.

   Y-axis
   ^
   |
   |             2  = max X,Y
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |
   +------------+-----> X-axis
  0 = min X,Y    1
val max: e1: 'T -> e2: 'T -> 'T (requires comparison)
val min: e1: 'T -> e2: 'T -> 'T (requires comparison)

Returns: Line2D

this.Edge03

Full Usage: this.Edge03

Returns: Line2D

The left edge reversed. The line from point 0 to 3. This is the reverse of Edge30.

   Y-axis
   ^
   |
   |             2  = max X,Y
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |
   +------------+-----> X-axis
  0 = min X,Y    1
val max: e1: 'T -> e2: 'T -> 'T (requires comparison)
val min: e1: 'T -> e2: 'T -> 'T (requires comparison)

Returns: Line2D

this.Edge10

Full Usage: this.Edge10

Returns: Line2D

The bottom edge reversed. The line from point 1 to 0. This is the reverse of Edge01.

   Y-axis
   ^
   |
   |             2  = max X,Y
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |
   +------------+-----> X-axis
  0 = min X,Y    1
val max: e1: 'T -> e2: 'T -> 'T (requires comparison)
val min: e1: 'T -> e2: 'T -> 'T (requires comparison)

Returns: Line2D

this.Edge12

Full Usage: this.Edge12

Returns: Line2D

The right edge. The line from point 1 to 2.

   Y-axis
   ^
   |
   |             2  = max X,Y
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |
   +------------+-----> X-axis
  0 = min X,Y    1
val max: e1: 'T -> e2: 'T -> 'T (requires comparison)
val min: e1: 'T -> e2: 'T -> 'T (requires comparison)

Returns: Line2D

this.Edge21

Full Usage: this.Edge21

Returns: Line2D

The right edge reversed. The line from point 2 to 1. This is the reverse of Edge12.

   Y-axis
   ^
   |
   |             2  = max X,Y
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |
   +------------+-----> X-axis
  0 = min X,Y    1
val max: e1: 'T -> e2: 'T -> 'T (requires comparison)
val min: e1: 'T -> e2: 'T -> 'T (requires comparison)

Returns: Line2D

this.Edge23

Full Usage: this.Edge23

Returns: Line2D

The top edge. The line from point 2 to 3.

   Y-axis
   ^
   |
   |             2  = max X,Y
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |
   +------------+-----> X-axis
  0 = min X,Y    1
val max: e1: 'T -> e2: 'T -> 'T (requires comparison)
val min: e1: 'T -> e2: 'T -> 'T (requires comparison)

Returns: Line2D

this.Edge30

Full Usage: this.Edge30

Returns: Line2D

The left edge. The line from point 3 to 0.

   Y-axis
   ^
   |
   |             2  = max X,Y
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |
   +------------+-----> X-axis
  0 = min X,Y    1
val max: e1: 'T -> e2: 'T -> 'T (requires comparison)
val min: e1: 'T -> e2: 'T -> 'T (requires comparison)

Returns: Line2D

this.Edge32

Full Usage: this.Edge32

Returns: Line2D

The top edge reversed. The line from point 3 to 2. This is the reverse of Edge23.

   Y-axis
   ^
   |
   |             2  = max X,Y
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |
   +------------+-----> X-axis
  0 = min X,Y    1
val max: e1: 'T -> e2: 'T -> 'T (requires comparison)
val min: e1: 'T -> e2: 'T -> 'T (requires comparison)

Returns: Line2D

this.Edges

Full Usage: this.Edges

Returns: Line2D[]

Returns all 4 edges of this bounding rectangle in counter-clockwise order: Edge01, Edge12, Edge23 and Edge30.

   Y-axis
   ^
   |
   |             2  = max X,Y
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |
   +------------+-----> X-axis
  0 = min X,Y    1
val max: e1: 'T -> e2: 'T -> 'T (requires comparison)
val min: e1: 'T -> e2: 'T -> 'T (requires comparison)

Returns: Line2D[]

this.EvaluateAt

Full Usage: this.EvaluateAt

Parameters:
    xParameter : ^a
    yParameter : ^c

Returns: Pt
Modifiers: inline
Type parameters: ^a, ^b, ^c, ^d (requires (static member op_Multiply : Microsoft.FSharp.Core.float * ^a -> ^b) and (static member op_Addition : Microsoft.FSharp.Core.float * ^b -> Microsoft.FSharp.Core.float) and (static member op_Multiply : Microsoft.FSharp.Core.float * ^c -> ^d) and (static member op_Addition : Microsoft.FSharp.Core.float * ^d -> Microsoft.FSharp.Core.float))
 Evaluate an X and Y parameter of this bounding rectangle.
  0.0, 0.0 returns the MinPt.
  1.0, 1.0 returns the MaxPt.
xParameter : ^a
yParameter : ^c
Returns: Pt

this.Expand

Full Usage: this.Expand

Parameters:
    dist : float

Returns: BRect
Modifiers: inline

Returns a bounding rectangle expanded by distance. Does check for underflow if distance is negative and raises EuclidException.

dist : float
Returns: BRect

this.ExpandClamped

Full Usage: this.ExpandClamped

Parameters:
    dist : float

Returns: BRect
Modifiers: inline

Returns a bounding rectangle expanded by a distance. If expansion is negative it shrinks the Rectangle. It also prevents the rectangle from collapsing past its center. When the negative expansion is bigger than the size, Min and Max values will be both at the center point.

dist : float
Returns: BRect

this.ExpandClampedXY

Full Usage: this.ExpandClampedXY

Parameters:
    xDist : float
    yDist : float

Returns: BRect

Returns a bounding rectangle expanded by a distance for X- and Y-axis each. If expansion is negative it shrinks the Rectangle. It also prevents the rectangle from collapsing past its center. When the negative expansion is bigger than the size, Min and Max values will be both at the center point.

xDist : float
yDist : float
Returns: BRect

this.ExpandXAxis

Full Usage: this.ExpandXAxis

Parameters:
    startDist : ^a
    endDist : ^b

Returns: BRect
Modifiers: inline
Type parameters: ^a, ^b (requires (static member op_Subtraction : Microsoft.FSharp.Core.float * ^a -> Microsoft.FSharp.Core.float) and (static member op_Addition : Microsoft.FSharp.Core.float * ^b -> Microsoft.FSharp.Core.float))

Returns a bounding rectangle expanded only in X direction by different distances for start(minX) and end (maxX). Does check for underflow if distance is negative and raises EuclidException.

startDist : ^a
endDist : ^b
Returns: BRect

this.ExpandXY

Full Usage: this.ExpandXY

Parameters:
    xDist : ^a
    yDist : ^b

Returns: BRect
Modifiers: inline
Type parameters: ^a, ^b (requires (static member op_Subtraction : Microsoft.FSharp.Core.float * ^a -> Microsoft.FSharp.Core.float) and (static member op_Addition : Microsoft.FSharp.Core.float * ^a -> Microsoft.FSharp.Core.float) and (static member op_Subtraction : Microsoft.FSharp.Core.float * ^b -> Microsoft.FSharp.Core.float) and (static member op_Addition : Microsoft.FSharp.Core.float * ^b -> Microsoft.FSharp.Core.float))

Returns a bounding rectangle expanded by a distance for X- and Y-axis each. Raises EuclidException if the resulting rectangle would be invalid (Min > Max).

xDist : ^a
yDist : ^b
Returns: BRect

this.ExpandYAxis

Full Usage: this.ExpandYAxis

Parameters:
    startDist : ^a
    endDist : ^b

Returns: BRect
Modifiers: inline
Type parameters: ^a, ^b (requires (static member op_Subtraction : Microsoft.FSharp.Core.float * ^a -> Microsoft.FSharp.Core.float) and (static member op_Addition : Microsoft.FSharp.Core.float * ^b -> Microsoft.FSharp.Core.float))

Returns a bounding rectangle expanded only in Y direction by different distances for start(minY) and end (maxY). Does check for underflow if distance is negative and raises EuclidException.

startDist : ^a
endDist : ^b
Returns: BRect

this.GetEdge

Full Usage: this.GetEdge

Parameters:
    edgeIndex : int - Edge index from 0 to 3.

Returns: Line2D The selected edge. Fails for an invalid index.

Returns an edge in counter-clockwise order: 01, 12, 23, 30.

edgeIndex : int

Edge index from 0 to 3.

Returns: Line2D

The selected edge. Fails for an invalid index.

this.GetLine

Full Usage: this.GetLine

Parameters:
    startPointIndex : int - Start corner index from 0 to 3.
    endPointIndex : int - End corner index from 0 to 3.

Returns: Line2D The line. Fails for invalid or equal indices.

Returns a directed line between two distinct corner indices.

startPointIndex : int

Start corner index from 0 to 3.

endPointIndex : int

End corner index from 0 to 3.

Returns: Line2D

The line. Fails for invalid or equal indices.

this.GetPoint

Full Usage: this.GetPoint

Parameters:
    pointIndex : int - Corner index from 0 to 3.

Returns: Pt The selected corner. Fails for an invalid index.

Returns the corner at the given index, in counter-clockwise order from the minimum corner.

pointIndex : int

Corner index from 0 to 3.

Returns: Pt

The selected corner. Fails for an invalid index.

this.HasArea

Full Usage: this.HasArea

Returns: bool
Modifiers: inline

Tests if neither the X nor Y-axis is smaller than the zeroLength tolerance. Same as .IsValid

Returns: bool

this.IntersectRay

Full Usage: this.IntersectRay

Parameters:
    ray : Line2D - The ray (Line2D) to intersect with the bounding rectangle.

Returns: float * float The entry and exit parameters on the ray (tEntry, tExit).

Intersects an infinite ray (Line2D extended infinitely in both directions) with this bounding rectangle. Same as r.TryIntersectRay, but fails if the ray does not intersect the rectangle or if the ray direction is too short. A parameter of 0.0 corresponds to the ray's From point, 1.0 to its To point.

ray : Line2D

The ray (Line2D) to intersect with the bounding rectangle.

Returns: float * float

The entry and exit parameters on the ray (tEntry, tExit).

this.Intersection

Full Usage: this.Intersection

Parameters:
Returns: BRect

Returns the intersection of two bounding rectangles. The returned rectangle is the area that is inside both input rectangles. Just touching rectangles will return a zero area collapsed BRect. Fails if the two rectangles do not overlap. Use b.TryIntersection to get ValueNone instead.

a : BRect
Returns: BRect

this.IsLine

Full Usage: this.IsLine

Returns: bool
Modifiers: inline

Tests if one of the X or Y axes is smaller than the zeroLength tolerance.

Returns: bool

this.IsOverlapping

Full Usage: this.IsOverlapping

Parameters:
Returns: bool
Modifiers: inline

Returns TRUE if the two 2D bounding rectangles do overlap or touch exactly. Also returns TRUE if one box is completely inside the other. Also returns TRUE if one box is completely surrounding the other.

a : BRect
Returns: bool

this.IsOverlappingOrClose

Full Usage: this.IsOverlappingOrClose

Parameters:
    a : BRect
    tolerance : float

Returns: bool
Modifiers: inline

Returns TRUE if the two 2D bounding rectangles do overlap or are apart less than the specified tolerance. Also returns TRUE if one box is completely inside the other. Also returns TRUE if one box is completely surrounding the other. A negative tolerance shrinks the effective boundaries instead of expanding them. The math works out symmetrically:

a : BRect
tolerance : float
Returns: bool

this.IsPoint

Full Usage: this.IsPoint

Returns: bool
Modifiers: inline

Tests if all sides are smaller than the zeroLength tolerance. Same as b.IsZero.

Returns: bool

this.IsTouching

Full Usage: this.IsTouching

Parameters:
    other : BRect
    ?tolerance : float

Returns: bool
Modifiers: inline

Returns TRUE if the two 2D bounding rectangles are just touching within the tolerance. The default tolerance is 1e-6.But can also be specified as a parameter. Returns FALSE if one box is completely inside the other. Returns FALSE if one box is completely surrounding the other.

other : BRect
?tolerance : float
Returns: bool

this.IsValid

Full Usage: this.IsValid

Returns: bool
Modifiers: inline

Tests if neither the X nor Y-axis is smaller than the zeroLength tolerance. Same as .HasArea

Returns: bool

this.IsZero

Full Usage: this.IsZero

Returns: bool
Modifiers: inline

Tests if all sides are smaller than the zeroLength tolerance. Same as b.IsPoint.

Returns: bool

this.LongestEdge

Full Usage: this.LongestEdge

Returns: float
Modifiers: inline

Returns the longest edge of the bounding rectangle.

Returns: float

this.MaxPt

Full Usage: this.MaxPt

Returns: Pt
Modifiers: inline

The point where X and Y are the maximum values.

Returns: Pt

this.MinPt

Full Usage: this.MinPt

Returns: Pt
Modifiers: inline

The point where X and Y are the minimum values.

Returns: Pt

this.Points

Full Usage: this.Points

Returns: Pt[]

Returns the corners of this bounding rectangle in counter-clockwise order, starting at MinPt. Returns an array of 4 Points.

   Y-axis
   ^
   |
   |             2  = max X,Y
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |
   +------------+-----> X-axis
  0 = min X,Y    1
val max: e1: 'T -> e2: 'T -> 'T (requires comparison)
val min: e1: 'T -> e2: 'T -> 'T (requires comparison)

Returns: Pt[]

this.PointsLooped

Full Usage: this.PointsLooped

Returns: Pt[]

Returns a counter-clockwise array of 5 Points, starting at MinPt. Last and first point are the same.

   Y-axis
   ^
   |
   |             2  = max X,Y
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |
   +------------+-----> X-axis
  0 = min X,Y    1
val max: e1: 'T -> e2: 'T -> 'T (requires comparison)
val min: e1: 'T -> e2: 'T -> 'T (requires comparison)

Returns: Pt[]

this.Pt0

Full Usage: this.Pt0

Returns: Pt

Returns the point (0) or minX, minY.

   Y-axis
   ^
   |
   |             2 = max X,Y
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |
   +------------+-----> X-axis
  0 = min X,Y      1
val max: e1: 'T -> e2: 'T -> 'T (requires comparison)
val min: e1: 'T -> e2: 'T -> 'T (requires comparison)

Returns: Pt

this.Pt1

Full Usage: this.Pt1

Returns: Pt

Returns the point (1) or maxX, minY.

   Y-axis
   ^
   |
   |             2 = max X,Y
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |
   +------------+-----> X-axis
  0 = min X,Y      1
val max: e1: 'T -> e2: 'T -> 'T (requires comparison)
val min: e1: 'T -> e2: 'T -> 'T (requires comparison)

Returns: Pt

this.Pt2

Full Usage: this.Pt2

Returns: Pt

Returns the point (2) or maxX, maxY.

   Y-axis
   ^
   |
   |             2 = max X,Y
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |
   +------------+-----> X-axis
  0 = min X,Y      1
val max: e1: 'T -> e2: 'T -> 'T (requires comparison)
val min: e1: 'T -> e2: 'T -> 'T (requires comparison)

Returns: Pt

this.Pt3

Full Usage: this.Pt3

Returns: Pt

Returns the point (3) or minX, maxY.

   Y-axis
   ^
   |
   |             2 = max X,Y
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |
   +------------+-----> X-axis
  0 = min X,Y      1
val max: e1: 'T -> e2: 'T -> 'T (requires comparison)
val min: e1: 'T -> e2: 'T -> 'T (requires comparison)

Returns: Pt

this.ShortestEdge

Full Usage: this.ShortestEdge

Returns: float
Modifiers: inline

Returns the shortest edge of the bounding rectangle.

Returns: float

this.SizeX

Full Usage: this.SizeX

Returns: float
Modifiers: inline

The size in X direction.

Returns: float

this.SizeY

Full Usage: this.SizeY

Returns: float
Modifiers: inline

The size in Y direction.

Returns: float

this.TouchingSide

Full Usage: this.TouchingSide

Parameters:
    other : BRect
    ?tolerance : float

Returns: int
Modifiers: inline
 Returns a value from -1 to 6 indicating the side on which the two 2D
 are just touching within the tolerance.
 The default tolerance is 1e-6.But can also be specified as a parameter.
   -1 : not touching but overlapping / one inside the other
    0 : not touching, apart on at least one axis by more than tolerance
    1 : other is in front  of this (this.MinX touches other.MaxX)
    2 : other is behind    this  (this.MaxX touches other.MinX)
    3 : other is to the left  of this (this.MinY touches other.MaxY)
    4 : other is to the right of this (this.MaxY touches other.MinY)
    5 : this.MinZ touches other.MaxZ
    6 : this.MaxZ touches other.MinZ
other : BRect
?tolerance : float
Returns: int

this.TryIntersectRay

Full Usage: this.TryIntersectRay

Parameters:
    ray : Line2D - The ray (Line2D) to intersect with the bounding rectangle.

Returns: (float * float) voption ValueNone if no intersection, ValueSome(tEntry, tExit) with the entry and exit parameters on the ray.

Intersects an infinite ray (Line2D extended infinitely in both directions) with this bounding rectangle. Uses the slab intersection method. Returns ValueNone if the ray does not intersect the rectangle or if the ray direction is too short. Returns ValueSome with the entry and exit parameters on the ray if it intersects. A parameter of 0.0 corresponds to the ray's From point, 1.0 to its To point.

ray : Line2D

The ray (Line2D) to intersect with the bounding rectangle.

Returns: (float * float) voption

ValueNone if no intersection, ValueSome(tEntry, tExit) with the entry and exit parameters on the ray.

this.TryIntersection

Full Usage: this.TryIntersection

Parameters:
Returns: BRect voption
Modifiers: inline

Returns the intersection of two bounding rectangles. The returned rectangle is the area that is inside both input rectangles. Returns ValueNone if the two rectangles do not overlap. Just touching rectangles will return ValueSome with zero area collapsed BRect.

a : BRect
Returns: BRect voption

this.Union

Full Usage: this.Union

Parameters:
Returns: BRect
Modifiers: inline

Returns a bounding rectangle that contains both input rectangles.

b : BRect
Returns: BRect

this.UnionPt

Full Usage: this.UnionPt

Parameters:
Returns: BRect
Modifiers: inline

Returns a bounding rectangle that contains the input rectangles and the point.

p : Pt
Returns: BRect

Static members

Static member Description

BRect.area r

Full Usage: BRect.area r

Parameters:
Returns: float
Modifiers: inline

Returns the area of this bounding rectangle.

r : BRect
Returns: float

BRect.asFSharpCode r

Full Usage: BRect.asFSharpCode r

Parameters:
Returns: string
Modifiers: inline

Format bounding rectangle into an F# code string that can be used to recreate the rectangle.

r : BRect
Returns: string

BRect.asRect2D r

Full Usage: BRect.asRect2D r

Parameters:
    r : BRect - The bounding rectangle.

Returns: Rect2D The corresponding Rect2D.
Modifiers: inline

Converts the bounds to an axis-aligned rectangle.

r : BRect

The bounding rectangle.

Returns: Rect2D

The corresponding Rect2D.

BRect.asString r

Full Usage: BRect.asString r

Parameters:
Returns: string
Modifiers: inline

Format bounding rectangle into string with nice floating point number formatting of size and position. But without full type name as in rect.ToString()

r : BRect
Returns: string

BRect.center r

Full Usage: BRect.center r

Parameters:
Returns: Pt
Modifiers: inline

The center of the bounding rect.

r : BRect
Returns: Pt

BRect.contains rectInside surroundingRect

Full Usage: BRect.contains rectInside surroundingRect

Parameters:
Returns: bool
Modifiers: inline

Returns TRUE if this bounding rectangle is inside or exactly on the other bounding rectangle. Argument order matters!

rectInside : BRect
surroundingRect : BRect
Returns: bool

BRect.containsPt pt rect

Full Usage: BRect.containsPt pt rect

Parameters:
Returns: bool
Modifiers: inline

Returns TRUE if the point is inside or on this bounding rectangle.

pt : Pt
rect : BRect
Returns: bool

BRect.containsXY x y rect

Full Usage: BRect.containsXY x y rect

Parameters:
    x : float
    y : float
    rect : BRect

Returns: bool
Modifiers: inline

Returns TRUE if the point is inside or on this bounding rectangle.

x : float
y : float
rect : BRect
Returns: bool

BRect.countZeroSides r

Full Usage: BRect.countZeroSides r

Parameters:
Returns: int
Modifiers: inline

Counts the amount of sides that are smaller than the zeroLength tolerance. This is 0, 1, or 2.

r : BRect
Returns: int

BRect.create a b

Full Usage: BRect.create a b

Parameters:
Returns: BRect
Modifiers: inline

Finds min and max values for x and y.

a : Pt
b : Pt
Returns: BRect

BRect.createCentered sizeX sizeY center

Full Usage: BRect.createCentered sizeX sizeY center

Parameters:
    sizeX : float
    sizeY : float
    center : Pt

Returns: BRect
Modifiers: inline

Creates a bounding rectangle from the total X and Y size and a center point. Fails if sizeX or sizeY is negative.

sizeX : float
sizeY : float
center : Pt
Returns: BRect

BRect.createFromIList ps

Full Usage: BRect.createFromIList ps

Parameters:
Returns: BRect
Modifiers: inline

Finds min and max values for x and y. Fails if the IList is null or empty.

ps : IList<Pt>
Returns: BRect

BRect.createFromLine l

Full Usage: BRect.createFromLine l

Parameters:
Returns: BRect
Modifiers: inline

Creates a bounding rectangle of a line.

l : Line2D
Returns: BRect

BRect.createFromRect2D r

Full Usage: BRect.createFromRect2D r

Parameters:
Returns: BRect
Modifiers: inline

Get the axis aligned 2D Bounding rectangle of the 2D Rectangle.

r : Rect2D
Returns: BRect

BRect.createFromRect3D r

Full Usage: BRect.createFromRect3D r

Parameters:
Returns: BRect

Creates a 2D bounding rectangle by projecting a Rect3D onto the World XY plane.

r : Rect3D
Returns: BRect

BRect.createFromSeq ps

Full Usage: BRect.createFromSeq ps

Parameters:
    ps : Pt seq

Returns: BRect
Modifiers: inline

Finds min and max values for x and y. Fails if the sequence is null or empty.

ps : Pt seq
Returns: BRect

BRect.createUnchecked (minX, minY, maxX, maxY)

Full Usage: BRect.createUnchecked (minX, minY, maxX, maxY)

Parameters:
    minX : float
    minY : float
    maxX : float
    maxY : float

Returns: BRect
Modifiers: inline

Does not verify the order of min and max values. Creates a new bounding rectangle. When compiled in DEBUG mode or with the CHECKED_EUCLID symbol defined the input is verified.

minX : float
minY : float
maxX : float
maxY : float
Returns: BRect

BRect.createXY (ptAx, ptAy, ptBx, ptBy)

Full Usage: BRect.createXY (ptAx, ptAy, ptBx, ptBy)

Parameters:
    ptAx : float - X value of point A
    ptAy : float - Y value of point A
    ptBx : float - X value of point B
    ptBy : float - Y value of point B

Returns: BRect A bounding rectangle that contains both points A and B.
Modifiers: inline

Finds min and max values points A and B given as separate X and Y values.

ptAx : float

X value of point A

ptAy : float

Y value of point A

ptBx : float

X value of point B

ptBy : float

Y value of point B

Returns: BRect

A bounding rectangle that contains both points A and B.

BRect.diagonal r

Full Usage: BRect.diagonal r

Parameters:
Returns: Vc
Modifiers: inline

The diagonal 2D vector of the bounding rect. From MinPt to MaxPt.

r : BRect
Returns: Vc

BRect.edge01 r

Full Usage: BRect.edge01 r

Parameters:
Returns: Line2D
Modifiers: inline

The bottom edge. The line from point 0 to 1.

r : BRect
Returns: Line2D

BRect.edge03 r

Full Usage: BRect.edge03 r

Parameters:
Returns: Line2D
Modifiers: inline

The left edge reversed. The line from point 0 to 3. This is the reverse of Edge30.

r : BRect
Returns: Line2D

BRect.edge10 r

Full Usage: BRect.edge10 r

Parameters:
Returns: Line2D
Modifiers: inline

The bottom edge reversed. The line from point 1 to 0. This is the reverse of Edge01.

r : BRect
Returns: Line2D

BRect.edge12 r

Full Usage: BRect.edge12 r

Parameters:
Returns: Line2D
Modifiers: inline

The right edge. The line from point 1 to 2.

r : BRect
Returns: Line2D

BRect.edge21 r

Full Usage: BRect.edge21 r

Parameters:
Returns: Line2D
Modifiers: inline

The right edge reversed. The line from point 2 to 1. This is the reverse of Edge12.

r : BRect
Returns: Line2D

BRect.edge23 r

Full Usage: BRect.edge23 r

Parameters:
Returns: Line2D
Modifiers: inline

The top edge. The line from point 2 to 3.

r : BRect
Returns: Line2D

BRect.edge30 r

Full Usage: BRect.edge30 r

Parameters:
Returns: Line2D
Modifiers: inline

The left edge. The line from point 3 to 0.

r : BRect
Returns: Line2D

BRect.edge32 r

Full Usage: BRect.edge32 r

Parameters:
Returns: Line2D
Modifiers: inline

The top edge reversed. The line from point 3 to 2. This is the reverse of Edge23.

r : BRect
Returns: Line2D

BRect.edges r

Full Usage: BRect.edges r

Parameters:
Returns: Line2D[]
Modifiers: inline

Returns all 4 edges of this bounding rectangle in counter-clockwise order: Edge01, Edge12, Edge23 and Edge30.

r : BRect
Returns: Line2D[]

BRect.equalsExact a b

Full Usage: BRect.equalsExact a b

Parameters:
Returns: bool
Modifiers: inline

Checks if two 2D bounding rectangles are exactly equal. Compares each field with the = operator, so a NaN value is never equal.

a : BRect
b : BRect
Returns: bool

BRect.equalsWithin tol a b

Full Usage: BRect.equalsWithin tol a b

Parameters:
Returns: bool
Modifiers: inline

Checks if two 2D bounding rectangles are equal within tolerance. The tolerance applies to each minimum and maximum coordinate separately, not to the Euclidean distance between the corners. Use BRect.equalsExact to check for an exact match.

tol : float
a : BRect
b : BRect
Returns: bool

BRect.evaluateAt xParameter yParameter r

Full Usage: BRect.evaluateAt xParameter yParameter r

Parameters:
    xParameter : ^a
    yParameter : ^c
    r : BRect

Returns: Pt
Modifiers: inline
Type parameters: ^a, ^b, ^c, ^d (requires (static member op_Multiply : Microsoft.FSharp.Core.float * ^a -> ^b) and (static member op_Addition : Microsoft.FSharp.Core.float * ^b -> Microsoft.FSharp.Core.float) and (static member op_Multiply : Microsoft.FSharp.Core.float * ^c -> ^d) and (static member op_Addition : Microsoft.FSharp.Core.float * ^d -> Microsoft.FSharp.Core.float))

Evaluate an X and Y parameter of this bounding rectangle. 0.0, 0.0 returns the MinPt. 1.0, 1.0 returns the MaxPt.

xParameter : ^a
yParameter : ^c
r : BRect
Returns: Pt

BRect.expand dist r

Full Usage: BRect.expand dist r

Parameters:
Returns: BRect
Modifiers: inline

Returns bounding rectangle expanded by distance. Does check for underflow if distance is negative and raises EuclidException.

dist : float
r : BRect
Returns: BRect

BRect.expandClamped dist r

Full Usage: BRect.expandClamped dist r

Parameters:
Returns: BRect
Modifiers: inline

Returns a bounding rectangle expanded by a distance. If expansion is negative it shrinks the Rectangle. It also makes sure that there is no underflow. When the negative expansion is bigger than the size, Min and Max values will be both in the middle from where they were before.

dist : float
r : BRect
Returns: BRect

BRect.expandClampedXY xDist yDist r

Full Usage: BRect.expandClampedXY xDist yDist r

Parameters:
    xDist : float
    yDist : float
    r : BRect

Returns: BRect
Modifiers: inline

Returns a bounding rectangle expanded by a distance for X- and Y-axis each. If expansion is negative it shrinks the Rectangle. It also prevents the rectangle from collapsing past its center. When the negative expansion is bigger than the size, Min and Max values will be both at the center point.

xDist : float
yDist : float
r : BRect
Returns: BRect

BRect.expandRelative factor r

Full Usage: BRect.expandRelative factor r

Parameters:
    factor : float
    r : BRect

Returns: BRect

Returns the 2D bounding rectangle expanded by a relative factor on all four sides. Values between 0.0 and 1.0 shrink the rectangle. Values larger than 1.0 expand the rectangle. Does check for underflow if factor is negative and raises EuclidException.

factor : float
r : BRect
Returns: BRect

BRect.expandRelativeXY factorX factorY r

Full Usage: BRect.expandRelativeXY factorX factorY r

Parameters:
    factorX : float
    factorY : float
    r : BRect

Returns: BRect

Returns the 2D bounding rectangle expanded by a relative factor on all four sides, separately for X and Y. Values between 0.0 and 1.0 shrink the rectangle. Values larger than 1.0 expand the rectangle. Does check for underflow if any factor is negative and raises EuclidException.

factorX : float
factorY : float
r : BRect
Returns: BRect

BRect.expandXAxis startDist endDist r

Full Usage: BRect.expandXAxis startDist endDist r

Parameters:
    startDist : ^a
    endDist : ^b
    r : BRect

Returns: BRect
Modifiers: inline
Type parameters: ^a, ^b (requires (static member op_Subtraction : Microsoft.FSharp.Core.float * ^a -> Microsoft.FSharp.Core.float) and (static member op_Addition : Microsoft.FSharp.Core.float * ^b -> Microsoft.FSharp.Core.float))

Returns bounding rectangle expanded only in X direction by different distances for start(minX) and end (maxX). Does check for underflow if distance is negative and raises EuclidException.

startDist : ^a
endDist : ^b
r : BRect
Returns: BRect

BRect.expandXY xDist yDist r

Full Usage: BRect.expandXY xDist yDist r

Parameters:
    xDist : float
    yDist : float
    r : BRect

Returns: BRect
Modifiers: inline

Returns a bounding rectangle expanded by a distance for X- and Y-axis each.

xDist : float
yDist : float
r : BRect
Returns: BRect

BRect.expandYAxis startDist endDist r

Full Usage: BRect.expandYAxis startDist endDist r

Parameters:
    startDist : ^a
    endDist : ^b
    r : BRect

Returns: BRect
Modifiers: inline
Type parameters: ^a, ^b (requires (static member op_Subtraction : Microsoft.FSharp.Core.float * ^a -> Microsoft.FSharp.Core.float) and (static member op_Addition : Microsoft.FSharp.Core.float * ^b -> Microsoft.FSharp.Core.float))

Returns bounding rectangle expanded only in Y direction by different distances for start(minY) and end (maxY). Does check for underflow if distance is negative and raises EuclidException.

startDist : ^a
endDist : ^b
r : BRect
Returns: BRect

BRect.getEdge edgeIndex r

Full Usage: BRect.getEdge edgeIndex r

Parameters:
    edgeIndex : int - Edge index from 0 to 3.
    r : BRect - The bounding rectangle.

Returns: Line2D The selected edge. Fails for an invalid index.
Modifiers: inline

Returns an edge in counter-clockwise order: 01, 12, 23, 30.

edgeIndex : int

Edge index from 0 to 3.

r : BRect

The bounding rectangle.

Returns: Line2D

The selected edge. Fails for an invalid index.

BRect.getLine startPointIndex endPointIndex r

Full Usage: BRect.getLine startPointIndex endPointIndex r

Parameters:
    startPointIndex : int - Start corner index from 0 to 3.
    endPointIndex : int - End corner index from 0 to 3.
    r : BRect - The bounding rectangle.

Returns: Line2D The line. Fails for invalid or equal indices.
Modifiers: inline

Returns a directed line between two distinct corner indices.

startPointIndex : int

Start corner index from 0 to 3.

endPointIndex : int

End corner index from 0 to 3.

r : BRect

The bounding rectangle.

Returns: Line2D

The line. Fails for invalid or equal indices.

BRect.getPoint pointIndex r

Full Usage: BRect.getPoint pointIndex r

Parameters:
    pointIndex : int - Corner index from 0 to 3.
    r : BRect - The bounding rectangle.

Returns: Pt The selected corner. Fails for an invalid index.
Modifiers: inline

Returns a corner in counter-clockwise order from the minimum corner.

pointIndex : int

Corner index from 0 to 3.

r : BRect

The bounding rectangle.

Returns: Pt

The selected corner. Fails for an invalid index.

BRect.hasArea r

Full Usage: BRect.hasArea r

Parameters:
Returns: bool
Modifiers: inline

Tests if neither the X nor Y-axis is smaller than the zeroLength tolerance. Same as .IsValid.

r : BRect
Returns: bool

BRect.intersectRay ray r

Full Usage: BRect.intersectRay ray r

Parameters:
    ray : Line2D - The ray (Line2D) to intersect with the bounding rectangle.
    r : BRect - The bounding rectangle to intersect with.

Returns: float * float The entry and exit parameters on the ray (tEntry, tExit).
Modifiers: inline

Intersects an infinite ray (Line2D extended infinitely in both directions) with the bounding rectangle. Same as BRect.tryIntersectRay, but fails if the ray does not intersect the rectangle or if the ray direction is too short. A parameter of 0.0 corresponds to the ray's From point, 1.0 to its To point.

ray : Line2D

The ray (Line2D) to intersect with the bounding rectangle.

r : BRect

The bounding rectangle to intersect with.

Returns: float * float

The entry and exit parameters on the ray (tEntry, tExit).

BRect.intersection a b

Full Usage: BRect.intersection a b

Parameters:
Returns: BRect
Modifiers: inline

Returns the intersection of two bounding rectangles. The returned rectangle is the area that is inside both input rectangles. Just touching rectangles will return a zero area collapsed BRect. Fails if the two rectangles do not overlap. Use BRect.tryIntersection to get ValueNone instead.

a : BRect
b : BRect
Returns: BRect

BRect.isLine r

Full Usage: BRect.isLine r

Parameters:
Returns: bool
Modifiers: inline

Tests if one of the X or Y axes is smaller than the zeroLength tolerance.

r : BRect
Returns: bool

BRect.isOverlapping a b

Full Usage: BRect.isOverlapping a b

Parameters:
Returns: bool
Modifiers: inline

Returns TRUE if the two 2D bounding rectangles do overlap or touch exactly. Also returns TRUE if one box is completely inside the other. Also returns TRUE if one box is completely surrounding the other.

a : BRect
b : BRect
Returns: bool

BRect.isOverlappingOrClose tolerance a b

Full Usage: BRect.isOverlappingOrClose tolerance a b

Parameters:
Returns: bool
Modifiers: inline

Returns TRUE if the two 2D bounding rectangles do overlap or are apart less than the specified tolerance. Also returns TRUE if one box is completely inside the other. Also returns TRUE if one box is completely surrounding the other. A negative tolerance shrinks the effective boundaries instead of expanding them. The math works out symmetrically:

tolerance : float
a : BRect
b : BRect
Returns: bool

BRect.isPoint r

Full Usage: BRect.isPoint r

Parameters:
Returns: bool
Modifiers: inline

Tests if all sides are smaller than the zeroLength tolerance. Same as BRect.isZero.

r : BRect
Returns: bool

BRect.isTouching tolerance other this

Full Usage: BRect.isTouching tolerance other this

Parameters:
Returns: bool
Modifiers: inline

Returns TRUE if the two 2D bounding rectangles are just touching within a given specified tolerance. Returns FALSE if one box is completely inside the other. Returns FALSE if one box is completely surrounding the other.

tolerance : float
other : BRect
this : BRect
Returns: bool

BRect.isValid r

Full Usage: BRect.isValid r

Parameters:
Returns: bool
Modifiers: inline

Tests if neither the X nor Y-axis is smaller than the zeroLength tolerance. Same as .HasArea.

r : BRect
Returns: bool

BRect.isZero r

Full Usage: BRect.isZero r

Parameters:
Returns: bool
Modifiers: inline

Tests if all sides are smaller than the zeroLength tolerance. Same as BRect.isPoint.

r : BRect
Returns: bool

BRect.longestEdge r

Full Usage: BRect.longestEdge r

Parameters:
Returns: float
Modifiers: inline

Returns the longest edge of the bounding rectangle.

r : BRect
Returns: float

BRect.maxPt r

Full Usage: BRect.maxPt r

Parameters:
Returns: Pt
Modifiers: inline

The point where X and Y are the maximum values.

r : BRect
Returns: Pt

BRect.minPt r

Full Usage: BRect.minPt r

Parameters:
Returns: Pt
Modifiers: inline

The point where X and Y are the minimum values.

r : BRect
Returns: Pt

BRect.move v r

Full Usage: BRect.move v r

Parameters:
Returns: BRect
Modifiers: inline

Returns a new 2D-bounding-rectangle moved by a vector.

v : Vc
r : BRect
Returns: BRect

BRect.moveX translation r

Full Usage: BRect.moveX translation r

Parameters:
    translation : float
    r : BRect

Returns: BRect
Modifiers: inline

Returns a new 2D-bounding-rectangle moved in X-axis direction.

translation : float
r : BRect
Returns: BRect

BRect.moveY translation r

Full Usage: BRect.moveY translation r

Parameters:
    translation : float
    r : BRect

Returns: BRect
Modifiers: inline

Returns a new 2D-bounding-rectangle moved in Y-axis direction.

translation : float
r : BRect
Returns: BRect

BRect.notEqualsWithin tol a b

Full Usage: BRect.notEqualsWithin tol a b

Parameters:
Returns: bool
Modifiers: inline

Check if two 2D bounding rectangles are not equal within a given tolerance. The tolerance applies to each minimum and maximum coordinate separately, not to the Euclidean distance between the corners.

tol : float
a : BRect
b : BRect
Returns: bool

BRect.points r

Full Usage: BRect.points r

Parameters:
Returns: Pt[]
Modifiers: inline

Returns the corners of this bounding rectangle in counter-clockwise order, starting at MinPt. Returns an array of 4 Points.

r : BRect
Returns: Pt[]

BRect.pointsLooped r

Full Usage: BRect.pointsLooped r

Parameters:
Returns: Pt[]
Modifiers: inline

Returns a counter-clockwise array of 5 Points, starting at MinPt. Last and first point are the same.

r : BRect
Returns: Pt[]

BRect.pt0 r

Full Usage: BRect.pt0 r

Parameters:
Returns: Pt
Modifiers: inline

Returns the point (0) or minX, minY.

r : BRect
Returns: Pt

BRect.pt1 r

Full Usage: BRect.pt1 r

Parameters:
Returns: Pt
Modifiers: inline

Returns the point (1) or maxX, minY.

r : BRect
Returns: Pt

BRect.pt2 r

Full Usage: BRect.pt2 r

Parameters:
Returns: Pt
Modifiers: inline

Returns the point (2) or maxX, maxY.

r : BRect
Returns: Pt

BRect.pt3 r

Full Usage: BRect.pt3 r

Parameters:
Returns: Pt
Modifiers: inline

Returns the point (3) or minX, maxY.

r : BRect
Returns: Pt

BRect.scale factor r

Full Usage: BRect.scale factor r

Parameters:
    factor : float
    r : BRect

Returns: BRect
Modifiers: inline

Scales the 2D bounding rectangle by a given factor. Scale center is World Origin 0,0. A factor of 0.0 will collapse the rectangle to a point at the origin. Negative factors would flip the rectangle, breaking the Min/Max invariant, so this is raising an EuclidException.

factor : float
r : BRect
Returns: BRect

BRect.shortestEdge r

Full Usage: BRect.shortestEdge r

Parameters:
Returns: float
Modifiers: inline

Returns the shortest edge of the bounding rectangle.

r : BRect
Returns: float

BRect.sizeX r

Full Usage: BRect.sizeX r

Parameters:
Returns: float
Modifiers: inline

The size in X direction.

r : BRect
Returns: float

BRect.sizeY r

Full Usage: BRect.sizeY r

Parameters:
Returns: float
Modifiers: inline

The size in Y direction.

r : BRect
Returns: float

BRect.touchingSide other tolerance this

Full Usage: BRect.touchingSide other tolerance this

Parameters:
Returns: int
Modifiers: inline
 Returns a value from -1 to 6 indicating the side on which the two 2D
 are just touching within a given specified tolerance.
   -1 : not touching but overlapping / one inside the other
    0 : not touching, apart on at least one axis by more than tolerance
    1 : other is in front  of this (this.MinX touches other.MaxX)
    2 : other is behind    this  (this.MaxX touches other.MinX)
    3 : other is to the left  of this (this.MinY touches other.MaxY)
    4 : other is to the right of this (this.MaxY touches other.MinY)
    5 : this.MinZ touches other.MaxZ
    6 : this.MaxZ touches other.MinZ
other : BRect
tolerance : float
this : BRect
Returns: int

BRect.tryIntersectRay ray r

Full Usage: BRect.tryIntersectRay ray r

Parameters:
    ray : Line2D - The ray (Line2D) to intersect with the bounding rectangle.
    r : BRect - The bounding rectangle to intersect with.

Returns: (float * float) voption ValueNone if no intersection, ValueSome(tEntry, tExit) with the entry and exit parameters on the ray.
Modifiers: inline

Intersects an infinite ray (Line2D extended infinitely in both directions) with the bounding rectangle. Uses the slab intersection method. Returns ValueNone if the ray does not intersect the rectangle or if the ray direction is too short. Returns ValueSome with the entry and exit parameters on the ray if it intersects. A parameter of 0.0 corresponds to the ray's From point, 1.0 to its To point.

ray : Line2D

The ray (Line2D) to intersect with the bounding rectangle.

r : BRect

The bounding rectangle to intersect with.

Returns: (float * float) voption

ValueNone if no intersection, ValueSome(tEntry, tExit) with the entry and exit parameters on the ray.

BRect.tryIntersection a b

Full Usage: BRect.tryIntersection a b

Parameters:
Returns: BRect voption
Modifiers: inline

Returns the intersection of two bounding rectangles. The returned rectangle is the area that is inside both input rectangles. Returns ValueNone if the two rectangles do not overlap. Just touching rectangles will return ValueSome with zero area collapsed BRect.

a : BRect
b : BRect
Returns: BRect voption

BRect.union a b

Full Usage: BRect.union a b

Parameters:
Returns: BRect
Modifiers: inline

Returns a bounding rectangle that contains both input rectangles.

a : BRect
b : BRect
Returns: BRect

BRect.unionPt p r

Full Usage: BRect.unionPt p r

Parameters:
Returns: BRect
Modifiers: inline

Returns a bounding rectangle that contains the input rectangles and the point.

p : Pt
r : BRect
Returns: BRect

Type something to start searching.