Skip to main content

Module measure

Module measure 

Source
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.
SurfaceProjection
Where a point projects onto a surface.
SurfaceSeeds
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.