Struct lowdim::BBox [−][src]
Expand description
A bounding box.
An axis-aligned non-empty volume of the same dimension as the space.
Implementations
Constructs a bounding box from origin and size.
All coordinates of size must be positive to make the box non-empty.
Constructs a bounding box which contains a single point.
Example
let p = p2d(2, 3);
assert_eq!(bb2d(2..3, 3..4), BBox2d::from_point(p));Constructs the smallest bounding box containing two points.
Example
let p0 = p2d(2, 3);
let p1 = p2d(-1, 4);
assert_eq!(bb2d(-1..3, 3..5), BBox2d::from_points(p0, p1));The center point in the bounding box.
This is only the true center of the bounding box if the bounding box has odd dimensions. Otherwise the coordinates of the center are rounded according to the rules for integer division, i.e. towards zero.
The least upper bound of two bounding boxes w.r.t. inclusion.
That is, the smallest bounding box encompassing the points in the two boxes.
Example
let bb0 = bb2d(-2..3, -1..2);
let bb1 = bb2d(-5..4, 2..5);
assert_eq!(bb2d(-5..4, -1..5), bb0.lub(&bb1));Constructs a bounding box from bounds.
As always, lower bounds are inclusive, upper bounds exclusive.
👎 Deprecated: Use x_start or x_min instead.
Use x_start or x_min instead.
Returns the lower bound in the x-coordinate (inclusive).
👎 Deprecated: Use x_end instead, or consider using x_max.
Use x_end instead, or consider using x_max.
Returns the upper bound in the x-coordinate (exclusive).
👎 Deprecated: Use y_start or y_min instead.
Use y_start or y_min instead.
Returns the lower bound in the y-coordinate (inclusive).
👎 Deprecated: Use y_end instead, or consider using y_max.
Use y_end instead, or consider using y_max.
Returns the upper bound in the y-coordinate (exclusive).
Returns true if the point is inside the bounding box.
Returns an iterator over the points in the bounding box.
Points are returned by row.
Trait Implementations
Auto Trait Implementations
impl<S, V> RefUnwindSafe for BBox<S, V> where
S: RefUnwindSafe,
V: RefUnwindSafe,
impl<S, V> UnwindSafe for BBox<S, V> where
S: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more