Expand description
Bounding volumes and projection.
§Bounds must contain what they claim to
A bounding box in a kernel is always a rejection test. Too large costs time; too small silently drops a real intersection, and nothing downstream can tell it happened. So every bound here is derived from a property that guarantees containment, never from sampling:
- a line’s bound is its endpoints, which is exact;
- a spline’s is its control points, which is guaranteed by the convex hull property: the curve never leaves the hull of its control polygon;
- an analytic curve or surface’s is computed from its own definition;
- a trimmed piece falls back to the bound of the whole, which is loose but never wrong.
Sampling a curve at a few parameters and taking the extremes is the obvious alternative and is not sound: the curve bulges between the samples, and the amount it bulges is exactly what a bound is supposed to capture.
Structs§
- Obb
- A box that has been turned to fit what it bounds.
- Projection
- Where a point projects onto a curve, and how far away it is.
- Surface
Projection - Where a point projects onto a surface.
- Surface
Seeds - A surface’s seeding grid, built once and asked many times.
Functions§
- curve_
bounds - A guaranteed bound for a space curve.
- curve_
bounds_ over - A guaranteed bound for the part of a curve an edge actually uses.
- face_
normal - The direction a face presents, in space.
- oriented_
bounds - An oriented bound for a shape, from the spread of its geometry.
- project_
on_ curve - The nearest point on a curve to
target. - project_
on_ planar_ curve - The nearest point on a planar curve to a point in the same parameter space.
- project_
on_ surface - The nearest point on a surface to
target. - project_
on_ surface_ from - The nearest point on a surface to
target, starting from a guess. - relative_
deflection - A deflection expressed as a fraction of a shape’s own size.
- shape_
bounds - A guaranteed bound for a shape, including everything below it.
- surface_
bounds - A guaranteed bound for a surface.
- vertex_
bounds - A bound for a shape built only from its vertices.
- widened_
to_ hold - A surface’s parameterization window widened until it holds every one of
points.