Solution (source code)

= Solution

The core <parametric surface interrogation> is evaluation of the position and its <derivatives> through second order:
$$
\boxed{S(u,v),\quad S_u,S_v,\quad S_{uu},S_{uv},S_{vv}.}
$$
Position answers point queries; first <derivatives> give the <differential>, tangent directions and <normal vector>; <second derivatives> supply <curvature>. An evaluator should also report the parameter domain, patch adjacency, boundary curves and knot or crease locations, and whether these <derivatives> exist at the queried point. At a discontinuity boundary it should provide the relevant <one-sided limits> rather than silently average them.

For spatial searches, provide restriction or subdivision into equivalent smaller patches and certified <bounding volumes>, with error estimates when an approximate mesh is used. These allow intersection and closest-point algorithms to reject remote patches and refine the remaining candidates. A useful interface therefore combines <differential> evaluation with domain/topology and enclosure information. Inverse parameter lookup, ray intersection and nearest-point search can be built from these primitives using subdivision and local root or minimization solves; they need not be presumed exact basic evaluations of every representation.