AABB
The smallest upright box around an object, as drawn.
Node id bounds/aabb
The AABB node (axis-aligned bounding box) outputs the smallest box with
horizontal and vertical sides that contains object as it is drawn on the
page.
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| object | Renderable | — |
Outputs
| Name | Type | Notes |
|---|---|---|
| box | BoundingBox |
Behaviour
- As drawn. The box includes the object's position, rotation and scale: a rotated rectangle gets a larger box than the same rectangle upright.
- Tight. The box touches the outline: curves (circles, ellipses, arcs, sectors, Bezier curves, splines) are measured exactly, not through their control points. The stroke's width is not included.
- Using the box. A BoundingBox has
topLeftandbottomRightcorners, pluswidthandheight(Break BoundingBox). It can be theareaof a lattice node, or be tested with Contains Point and Intersects.
Errors
objectmust be a shape or a line. A group has no bounding box: use its children, and Union to combine their boxes.
Example
The AABB of a rotated rectangle, drawn as an outline. To draw a box, Break
BoundingBox gives its corners and size, Lerp Point (t = 0.5) its centre,
and Make Rectangle a rectangle from them.
Related nodes
- OOBB: a box that turns with the object.
- Union: a box around several boxes.
- Orthogonal Grid: a grid inside a box.