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).
  • Intrinsic curves (#317): at unit speed |c''| = |k|, so the curvature law’s closed-form supremum, times the start frame’s stretch, bounds the chords (intrinsic_chord_bound2); their points are read with a certified error by IntrinsicPositions.
  • Constant offsets B + d u (#317): |P''| from the basis’s suprema through the unit-vector rule of the certified station lengths (offset_chord_bound2).

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.
IntrinsicPositions
Certified positions of an intrinsic curve: the unit tangent of its closed-form heading integrated by the composite midpoint rule, each point with a certified bound on its error (the remainder w^3 / 24 (|k'| + k^2) per panel, panels split at seams, and the heading’s, the sums’ and the placement’s rounding).
SurfaceBoundOracle
Derivative bounds of one surface, prepared once for many boxes.
SurfaceBounds
Suprema of a surface’s partial derivatives over a parameter box.

Constants§

MAX_POSITION_PANELS
Most midpoint panels one curve’s positions may use.
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.
intrinsic_chord_bound2
Certified chord bound of a 2D intrinsic curve over [a, b]: h^2 / 8 sigma sup |k|, across seams of its law too. None outside [0, length] or for a law with no closed-form bound.
intrinsic_chord_bound3
Certified chord bound of a 3D intrinsic curve over [a, b]: h^2 / 8 sigma sup |k|, whatever its torsion (|c''| = |k|). None outside [0, length] or for a curvature law with no closed-form bound.
intrinsic_derivative_bounds2
Certified derivative suprema of a 2D intrinsic curve over [a, b] of its arc length; None outside [0, length] or for a law with no closed-form bound. third is infinite over a span with a seam of the law strictly inside.
offset_chord_bound2
Certified chord bound of the offset of a 2D curve by distance (see offset_point2) over [a, b] of the basis’s parameter. None for a basis with no derivative bound, a span with a break of the basis’s C^2 continuity strictly inside, or one whose tangent may vanish.
offset_chord_bound3
Certified chord bound of the offset of a 3D curve by distance along V x B' (see offset_point3) over [a, b] of the basis’s parameter; None as for offset_chord_bound2, or where the tangent may lie along V.
offset_point2
The point of the offset by distance to the left of a 2D curve at its parameter t: B(t) + d normalise(Z x B'(t)).
offset_point3
The point of the offset by distance along normalise(V x B'(t)) of a 3D curve at its parameter t, V the reference direction.