Skip to main content

Module bound

Module bound 

Source
Expand description

Certified derivative and chord bounds (#232), re-exported on the same footing as curve and surface. Certified derivative and chord bounds (#232).

A chord of a curve, or a triangle of a surface, is only as close to the exact geometry as the geometry’s second derivative allows, and a sample at the midpoint does not show that: a midpoint can sit on the chord while the curve bulges either side of it. This module bounds the derivatives from the data itself, so the numbers it returns are upper bounds, never estimates.

§The chord bound

For a curve c that is C^1 with a bounded second derivative on [a, b], the linear interpolant l of its ends satisfies |c(t) - l(t)| <= (b - a)^2 / 8 * sup |c''|: componentwise, c - l = -int G(t, s) c''(s) ds with the non-negative Green’s function of -d^2/dt^2 on [a, b], whose integral is (t - a)(b - t) / 2 <= (b - a)^2 / 8. l(t) lies on the chord, so every point of the arc is within that of the chord. A circular arc of at most half a turn uses its exact sagitta instead.

§Where the derivative bounds come from

  • Conics: c'' = -(r_x cos t X + r_y sin t Y), bounded in closed form over the interval (the frame is used as given, so a skewed frame is accounted for, not assumed away).
  • B-splines: the derivative of a B-spline is a B-spline on the derivative control polygon, and a B-spline lies in the convex hull of the control points that act on its span, so each derivative is bounded by the largest of those control points. A rational spline c = A / w is bounded through the quotient rule, with w bounded below by its smallest active weight (weights are positive) and c bounded by the control points’ spread about their centre; the centre is subtracted first, which leaves every derivative unchanged.
  • Elementary surfaces: closed forms over the parameter box. B-spline surfaces: the derivative control nets of the tensor product.
  • Implicit curves (ADR 0077): cell by cell, the solved parameter’s slope and bend through the implicit function theorem, with interval bounds of the field’s partials over the stretch’s box; a bridge cell by its cubic’s control points (implicit, #249).

A B-spline is only as smooth as its knots allow. A knot of multiplicity m leaves a degree d spline C^(d - m) there, so a bound that needs a continuous k-th derivative refuses an interval with such a knot strictly inside: the derivative bound would hold on each side but the Taylor argument does not cross the jump. continuity_breaks2 and continuity_breaks3 name those knots so a caller can split there.

Everything is computed in floating point from the data; the bounds are inflated by ROUNDING relative so rounding in their own arithmetic cannot make them undershoot.

Structs§

CurveDerivativeBounds
Suprema of the first three derivatives of a curve over an interval.
SurfaceBoundOracle
Derivative bounds of one surface, prepared once for many boxes.
SurfaceBounds
Suprema of a surface’s partial derivatives over a parameter box.

Constants§

ROUNDING
Relative inflation applied to every returned bound, so the rounding of the bound’s own arithmetic cannot make it undershoot.

Functions§

certifies_flattening2
Whether crate::curve::flatten2 certifies its chords for this family: every point of the curve then lies within the chord tolerance of the returned polyline (#232). Lines, polylines, circles, ellipses, sinusoids, B-splines with positive weights and arc-length chains whose pieces are all bounded (crate::chain::chain_certifies); other families are flattened on their midpoint sagitta alone, which is a measurement, not a bound.
certifies_flattening3
certifies_flattening2 for crate::curve::flatten3.
chord_bound2
Certified chord bound of a 2D curve over [a, b].
chord_bound3
Certified chord bound of a 3D curve over [a, b]; see chord_bound2.
continuity_breaks2
Parameters strictly inside the curve’s domain where a 2D curve may fail to be C^k (k >= 1): a polyline’s vertices, a B-spline’s knots of multiplicity above degree - k, an arc-length chain’s joins (where its curvature may jump; the chain is C^1 there, but each piece is bounded on its own). Empty for the smooth families.
continuity_breaks3
continuity_breaks2 for a 3D curve.
curve_derivative_bounds2
Certified derivative suprema of a 2D curve over [a, b]; see curve_derivative_bounds3. Also covers sinusoids.
curve_derivative_bounds3
Certified derivative suprema of a 3D curve over [a, b], or None for a family this module cannot bound.
frame_stretch2
The largest factor by which a 2D frame stretches a local vector.
frame_stretch3
The largest factor by which a 3D frame stretches a local vector.