Contains Point
Tests whether a point is inside a box.
Node id bounds/contains-point
The Contains Point node outputs true if point is inside box, and false
otherwise.
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| box | BoundingBox | { topLeft: { x: 0, y: 0 }, bottomRight: { x: 0, y: 0 } } | |
| point | Point | { x: 0, y: 0 } |
Outputs
| Name | Type | Notes |
|---|---|---|
| contains | boolean |
Behaviour
- Edges count. A point exactly on the box's edge is inside.
- Defaults. Both inputs default to the origin: an empty box at (0, 0) and the point (0, 0).
- Boxes, not shapes. The test is against the box, not the shape it came from: a point near the corner of a circle's AABB is inside the box but outside the circle.
Example
A point (the small orange circle) inside a rectangle's box: contains is
true. A boolean has nothing to draw, so the picture shows the inputs.
Related nodes
- Intersects: tests two boxes.
- Filter: with Contains Point, keeps the points inside a box.