Struct rstar::AABB

source ·
pub struct AABB<P>where
    P: Point,
{ /* private fields */ }
Expand description

An n-dimensional axis aligned bounding box (AABB).

An object’s AABB is the smallest box totally encompassing an object that is aligned to the current coordinate system. Although these structures are commonly called bounding boxes, they are exists in any dimension.

Note that this object is not fit for insertion into an r-tree. Use the Rectangle struct for this purpose. The main purpose of this struct is to define an envelope type for r-trees.

Type arguments

P: The struct is generic over which point type is used. Using an n-dimensional point type will result in an n-dimensional bounding box.

Implementations

Returns the AABB encompassing a single point.

Returns the AABB’s lower corner.

This is the point contained within the AABB with the smallest coordinate value in each dimension.

Returns the AABB’s upper corner.

This is the point contained within the AABB with the largest coordinate value in each dimension.

Creates a new AABB encompassing two points.

Creates a new AABB encompassing a collection of points.

Returns the point within this AABB closest to a given point.

If point is contained within the AABB, point will be returned.

Returns the squared distance to the AABB’s min_point.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
The envelope’s point type.
Creates a new, empty envelope that does not encompass any child.
Returns true if a point is contained within this envelope.
Returns true if another envelope is fully contained within self.
Extends self to contain another envelope.
Returns the minimal envelope containing self and another envelope.
Sets self to the intersection of self and another envelope.
Returns this envelope’s area. Must be at least 0.
Returns the euclidean distance to the envelope’s border.
Returns the squared min-max distance, a concept that helps to find nearest neighbors efficiently. Read more
Returns the envelope’s center point.
Returns the area of the intersection of self and another envelope.
Returns a value proportional to the envelope’s margin.
Sorts a given set of objects with envelopes along one of their axis.
Converts to this type from the input type.
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.