Skip to main content

Prescription

Struct Prescription 

Source
pub struct Prescription {
Show 38 fields pub surfaces: Vec<Surface>, pub wavelengths: Vec<f64>, pub weights: Vec<f64>, pub primary: usize, pub fields: Vec<Field>, pub field_type: FieldType, pub field_norm: FieldNorm, pub aperture: (ApertureKind, f64), pub telecentric: bool, pub aiming: Aiming, pub glasses: Arc<HashMap<String, Glass>>, pub temperature: f64, pub pressure: f64, pub glrs: usize, pub ropd: i64, pub apodization: Apodization, pub aim_pupil: AimPupil, pub input_pol: InputPolarization, pub glass_template: GlassTemplate, pub afocal: bool, pub afocal_unit: AfocalUnit, pub vig_interp: VigInterp, pub floating_clip: bool, pub mech_clip: bool, pub field_wave: Option<usize>, pub coating_file: Option<PathBuf>, pub coat_tables: HashMap<String, Vec<(f64, Vec<[f64; 9]>)>>, pub name: String, pub adjust_index: bool, pub pickups: Vec<Pickup>, pub solves: Vec<Solve>, pub macros: Vec<Macro>, pub macro_parms: Vec<MacroParm>, pub macro_notes: Vec<String>, pub import_notes: Vec<String>, pub units: Vec<Unit>, pub mechanics: Vec<MechPart>, pub configs: Option<Configs>,
}
Expand description

系の文書: 利用者が書く値(面・波長・視野・開口・ピックアップ・ソルブ・多重構成など)。 System はこれを Arc で持ち、書き換えは System::edit を通す(直した後に座標系・近軸量などを作り直す)

Fields§

§surfaces: Vec<Surface>§wavelengths: Vec<f64>§weights: Vec<f64>§primary: usize§fields: Vec<Field>§field_type: FieldType§field_norm: FieldNorm§aperture: (ApertureKind, f64)§telecentric: bool§aiming: Aiming§glasses: Arc<HashMap<String, Glass>>§temperature: f64§pressure: f64§glrs: usize§ropd: i64§apodization: Apodization

瞳のアポダイゼーション(.zmx の GFAC。PSF・MTF の瞳関数の振幅と、スポット・重心・RMS 波面・幾何 MTF・最適化の RMS の項の光線の重み(強度)。Zernike の当てはめには入れない。crate::pupil::Apodization)

§aim_pupil: AimPupil

光線エイミングの瞳のずれ・圧縮(OpticStudio の Pupil Shift・Pupil Compress、.zmx の PUSH と RAIM の 10 番目)。 OpticStudio ではエイミングの初めの値で、エイミングなしでは使わず、エイミングありでも収まった光線は変わらない (2026 R1.01 で実測)。lensbench の追跡も使わず、読み書き・多重構成の行のために持つ

§input_pol: InputPolarization

系の入射偏光(.zmx の POLS)。膜・偏光を入れる解析(MTF・PSF・相対照度の polarization)の入射の偏光。既定は偏光なし

§glass_template: GlassTemplate

ガラス置換のテンプレート(.zmx の GSTD)。既定は使わない

§afocal: bool

像空間がアフォーカル(.zmx の FTYP の 7 番目)。波面収差・Zernike・OPD を、射出瞳の位置で主光線に 垂直な平面(平面波)を基準に測る。スポット・MTF・PSF は角度([System::image_point]、単位は [System::afocal_unit])で出す

§afocal_unit: AfocalUnit

アフォーカル像空間の角度の単位(.zmx の UNIT の値の 6 番目)

§vig_interp: VigInterp

定義した視野以外の点のケラレ係数の求め方(既定は連続、OpticStudio と照合するときは OpticStudio)

§floating_clip: bool

浮動開口(半直径を固定した面・.zmx の FLAP)の外の光線をけるか(既定はける。OpticStudio は半直径を固定した面を 浮動開口にしてける)。光線エイミングの追跡は開口を見ない

§mech_clip: bool

機構部品([System::mechanics])の穴の外に出た光線をけるか(既定はける。OpticStudio には機構部品が無いので、 .zmx には穴の両端の円形開口の面にして書く)。光線エイミングの追跡は見ない

§field_wave: Option<usize>

実像高・条件で定める視野を解く波長(None で主波長)。単色の RMS の掃引で OpticStudio に合わせるとき だけ使う(lensbench-analysis の sweep::RmsOpts::field_wave)

§coating_file: Option<PathBuf>§coat_tables: HashMap<String, Vec<(f64, Vec<[f64; 9]>)>>

膜ファイルの外で定めた TABLE 膜(名前 → 表。プロジェクト・カタログのフィルタの透過特性)。 膜ファイルの同じ名前より優先する

§name: String§adjust_index: bool§pickups: Vec<Pickup>

ピックアップ(.zmx の PZUP・PPAR・PKUP・曲率のピックアップ)。パラメータを変えると解決し直す(crate::param)

§solves: Vec<Solve>

厚さのソルブ(.zmx の MAZH)。パラメータを変えると解き直す(crate::param)

§macros: Vec<Macro>

ソルブが呼ぶ ZPL のマクロ(crate::solves::SolveKind::MacroCurv・MacroThick の番号で引く)

§macro_parms: Vec<MacroParm>

面タイプのパラメータの ZPL マクロのソルブ

§macro_notes: Vec<String>

マクロのソルブを外して保存された値で固定した理由(マクロがない・対応していない命令など)と、 解き直しでマクロがエラーになって値を変えなかったこと(System::macro_warnings)

§import_notes: Vec<String>

ファイルから読んだときの注意(.zmx の読まずに飛ばした行・既定と違う設定など)

§units: Vec<Unit>

玉・群(crate::units)。剛体の動きは座標系にかける

§mechanics: Vec<MechPart>

機構部品(crate::mech)。[System::mech_clip] なら光線の追跡で穴の外の光線をける。切ならケラレの確認と 描画だけに使う

§configs: Option<Configs>

多重構成の表(crate::edit)。None なら構成は 1 つ

Implementations§

Source§

impl Prescription

Source

pub fn material_index(&self, mat: &Material) -> Result<Vec<f64>, Error>

媒質の屈折率(系の波長ごと、dn・disp をかける前)。ガラスは系のガラス(System::add_glasses で足せる)

Source

pub fn glass_nd_vd(&self, mat: &Material) -> Result<(f64, f64, f64), Error>

ガラス(系の温度・気圧・Adjust Index での値)かモデルガラスの d 線の屈折率・アッベ数・ΔPgF。 面の nd・vd のずれ(crate::surface::Surface::dnd・dvd、OpticStudio の TIND・TABB)の元の値

Source

pub fn surface_medium_index_at( &self, j: usize, lams: &[f64], ) -> Result<Option<Vec<f64>>, Error>

面 j の後の媒質の、波長 lams [µm] での屈折率(硝材の nd・vd のずれ dnd・dvd 込み、dn・disp をかける前)。 鏡・座標ブレークは None(前の媒質)

Source

pub fn material_index_at( &self, mat: &Material, lams: &[f64], ) -> Result<Vec<f64>, Error>

Prescription::material_index を波長 lams [µm] で

Source§

impl Prescription

Source

pub fn find_surface(&self, target: &str) -> Result<usize, Error>

面を番号か名前(コメント、前後の空白と大文字小文字は区別しない)で探す。名前が複数の面にあれば不正

Source

pub fn dispersion_warnings(&self) -> Vec<String>

分散式の有効範囲(AGF の LD 行)の外の波長で屈折率を求めている材料の警告(面の番号・材料・波長・範囲)。 lensbench は式をそのまま延ばして計算する(OpticStudio は範囲外ではエラーにして屈折率を 1.0 にする)

Source

pub fn stop(&self) -> usize

Source

pub fn surf_label(&self, j: usize) -> String

エラーに添える面の名札: 「面 j(種類, 材料, 膜 名前, 「コメント」)」。空の項は省く

Source

pub fn image(&self) -> usize

Source

pub fn infinite(&self) -> bool

Source

pub fn image_point(&self, xyz: [f64; 3], lmn: [f64; 3]) -> (f64, f64)

像面での光線の点。ふつうは像面の局所座標 (x, y) mm。アフォーカル像空間では向きの角度 (atan(l/n), atan(m/n)) を [System::afocal_unit] の単位で(OpticStudio のスポットと同じ定義)

Source

pub fn image_unit(&self) -> &'static str

像面の点・周波数の単位の名前: ふつうは mm、アフォーカル像空間では角度の単位

Source

pub fn build(self) -> Result<System, Error>

系を作る: 面の値の確かめ、材料からの屈折率、ピックアップの解決、厚さのソルブ、系の確かめ、自動の半直径 (System::edit と同じ後始末)

Source

pub fn build_raw(self) -> Result<System, Error>

値をそのまま置いて系を作る(ピックアップ・ソルブ・屈折率・自動の半直径は求め直さない)。系は確かめる

Trait Implementations§

Source§

impl Clone for Prescription

Source§

fn clone(&self) -> Prescription

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Prescription

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Prescription

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Prescription, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for Prescription

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl Serialize for Prescription

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,