Expand description
Minimum bounding rectangle and computational geometry utilities
This module provides algorithms for computing:
- Axis-aligned bounding boxes (AABB)
- Minimum area bounding rectangles (using rotating calipers on convex hull)
- Oriented bounding boxes
- Polygon perimeter computation
- Convex hull area and perimeter convenience functions
§Examples
use scirs2_spatial::computational_geometry::bounding::{
axis_aligned_bounding_box, minimum_bounding_rectangle, polygon_perimeter,
};
use scirs2_core::ndarray::array;
let points = array![[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]];
let aabb = axis_aligned_bounding_box(&points.view()).expect("Operation failed");
let mbr = minimum_bounding_rectangle(&points.view()).expect("Operation failed");
let perim = polygon_perimeter(&points.view());Structs§
- AABB
- An axis-aligned bounding box defined by its minimum and maximum coordinates
- Oriented
Bounding Rect - An oriented bounding rectangle defined by center, axes, and half-extents
Functions§
- axis_
aligned_ bounding_ box - Compute the axis-aligned bounding box of a set of 2D points
- convex_
hull_ area - Compute just the convex hull area for a point set
- convex_
hull_ area_ perimeter - Compute the area and perimeter of a convex hull given as a set of points
- convex_
hull_ perimeter - Compute just the convex hull perimeter for a point set
- is_
convex - Determine if a polygon (given as ordered vertices) is convex
- minimum_
bounding_ rectangle - Compute the minimum area bounding rectangle of a set of 2D points using the rotating calipers algorithm on the convex hull.
- point_
set_ diameter - Compute the diameter of a point set (maximum distance between any two points)
- point_
set_ width - Compute the width of a point set (minimum distance across)
- polygon_
perimeter - Compute the perimeter (circumference) of a polygon defined by ordered vertices
- signed_
polygon_ area - Compute the signed area of a polygon (positive for CCW, negative for CW)