pub struct ReticleDescription {
pub name: String,
pub focal_plane: FocalPlane,
pub reference_magnification: f64,
pub marks: Vec<ReticleMark>,
}Expand description
A complete reticle: its focal plane, its calibration magnification, and its marks.
This is THE shared schema. It is deliberately permissive on unknown JSON keys (no
deny_unknown_fields) so a richer front-end description round-trips through the engine
without being rejected, and every field a solve needs is required.
Fields§
§name: StringDisplay name, e.g. "mil-grid 0.5/10" or a vendor model designation.
focal_plane: FocalPlane§reference_magnification: f64The magnification at which ReticleMark subtensions are true. Meaningful only
for FocalPlane::Second; ignored (and unvalidated) for FFP, where subtensions
are magnification-independent by construction.
marks: Vec<ReticleMark>Implementations§
Source§impl ReticleDescription
impl ReticleDescription
Sourcepub fn validate(&self) -> Result<(), ReticleError>
pub fn validate(&self) -> Result<(), ReticleError>
Validate the description on its own terms: mark count, finiteness, and (SFP only) the reference magnification.
Sourcepub fn mark_scale(&self, magnification: f64) -> f64
pub fn mark_scale(&self, magnification: f64) -> f64
The factor that converts NOMINAL mark subtensions to TRUE subtensions at
magnification: reference_magnification / magnification for SFP, exactly 1.0
for FFP.
Assumes Self::validate has passed and magnification is finite and positive.
Sourcepub fn scaled_marks(
&self,
magnification: f64,
) -> Result<Vec<ScaledMark>, ReticleError>
pub fn scaled_marks( &self, magnification: f64, ) -> Result<Vec<ScaledMark>, ReticleError>
Every mark’s TRUE angular position at magnification.
Sourcepub fn mil_grid(spacing_mil: f64, extent_mil: f64) -> Result<Self, ReticleError>
pub fn mil_grid(spacing_mil: f64, extent_mil: f64) -> Result<Self, ReticleError>
A plain mil-hash CROSS: marks every spacing_mil along the vertical and horizontal
stadia out to extent_mil, plus a MarkKind::Center at the origin.
This is NOT a filled two-dimensional grid — see the module header’s IP exclusions.
The result is FFP with a reference_magnification of 1.0 (unused for FFP);
callers wanting an SFP grid set those two fields afterwards.
Sourcepub fn tree(
rows: usize,
row_spacing_mil: f64,
spread_step_mil: f64,
) -> Result<Self, ReticleError>
pub fn tree( rows: usize, row_spacing_mil: f64, spread_step_mil: f64, ) -> Result<Self, ReticleError>
A generic parametric holdover tree: rows rows below center at row_spacing_mil
intervals, each row n carrying windage dots at ±k * spread_step_mil for
k in 1..=n, so the tree widens with depth. Plus a MarkKind::Center.
Generic geometry only — no vendor tree layout is reproduced here (module header).
Sourcepub fn bdc_from_drops(drops: &[(f64, f64)]) -> Result<Self, ReticleError>
pub fn bdc_from_drops(drops: &[(f64, f64)]) -> Result<Self, ReticleError>
A BDC ladder built from ALREADY-SOLVED drops: one labeled hash per
(range_m, drop_mil) pair on the vertical stadium, plus a MarkKind::Center.
This generator deliberately does NOT run a solve. It is pure data assembly, so the caller stays in control of which load, atmosphere and zero the ladder describes, and this module keeps its “no physics” property.
Trait Implementations§
Source§impl Clone for ReticleDescription
impl Clone for ReticleDescription
Source§fn clone(&self) -> ReticleDescription
fn clone(&self) -> ReticleDescription
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReticleDescription
impl Debug for ReticleDescription
Source§impl<'de> Deserialize<'de> for ReticleDescription
impl<'de> Deserialize<'de> for ReticleDescription
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ReticleDescription
impl PartialEq for ReticleDescription
Source§impl Serialize for ReticleDescription
impl Serialize for ReticleDescription
impl StructuralPartialEq for ReticleDescription
Auto Trait Implementations§
impl Freeze for ReticleDescription
impl RefUnwindSafe for ReticleDescription
impl Send for ReticleDescription
impl Sync for ReticleDescription
impl Unpin for ReticleDescription
impl UnsafeUnpin for ReticleDescription
impl UnwindSafe for ReticleDescription
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.