pub fn with_axis(
r: &ResolvedSolveRequestV1,
axis: InputAxis,
v: AxisValue,
) -> Result<SolveRequestV1, KernelError>Expand description
Rebuild r as a solvable SolveRequestV1 with exactly one axis overwritten to v.
Every other input is carried across unchanged via the reverse conversion
(request_roundtrip.rs). Writing a requires_rezero axis (see
crate::perturbation::axis_meta) while a zero_distance_m is present on the REBUILT
request clears the carried effective muzzle_angle_rad, so the next solve re-zeroes at
the (possibly just-changed) distance instead of reusing a stale angle – see the module
doc for why this is checked after the axis is written, not before.
§Errors
KernelError::AxisUnsupportedForRequestifaxisis well-formed and present, but this request’s OTHER inputs make perturbing it physically wrong (the two guards in the module doc:Altitudeunder QNH pressure,ShotAzimuthunder compass wind).KernelError::AxisAbsentifaxisis structurally unavailable on this request (the three wind axes under segmented wind), mirroringread_axisreturningNonefor the same condition.KernelError::TypeMismatchifv’s kind does not matchaxis(e.g. aScalarforDragModel).KernelError::NonFiniteifvis a non-finiteScalar.