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
impl Prescription
Sourcepub fn material_index(&self, mat: &Material) -> Result<Vec<f64>, Error>
pub fn material_index(&self, mat: &Material) -> Result<Vec<f64>, Error>
媒質の屈折率(系の波長ごと、dn・disp をかける前)。ガラスは系のガラス(System::add_glasses で足せる)
Sourcepub fn glass_nd_vd(&self, mat: &Material) -> Result<(f64, f64, f64), Error>
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)の元の値
Sourcepub fn surface_medium_index_at(
&self,
j: usize,
lams: &[f64],
) -> Result<Option<Vec<f64>>, Error>
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(前の媒質)
Sourcepub fn material_index_at(
&self,
mat: &Material,
lams: &[f64],
) -> Result<Vec<f64>, Error>
pub fn material_index_at( &self, mat: &Material, lams: &[f64], ) -> Result<Vec<f64>, Error>
Prescription::material_index を波長 lams [µm] で
Source§impl Prescription
impl Prescription
Sourcepub fn find_surface(&self, target: &str) -> Result<usize, Error>
pub fn find_surface(&self, target: &str) -> Result<usize, Error>
面を番号か名前(コメント、前後の空白と大文字小文字は区別しない)で探す。名前が複数の面にあれば不正
Sourcepub fn dispersion_warnings(&self) -> Vec<String>
pub fn dispersion_warnings(&self) -> Vec<String>
分散式の有効範囲(AGF の LD 行)の外の波長で屈折率を求めている材料の警告(面の番号・材料・波長・範囲)。 lensbench は式をそのまま延ばして計算する(OpticStudio は範囲外ではエラーにして屈折率を 1.0 にする)
pub fn stop(&self) -> usize
Sourcepub fn surf_label(&self, j: usize) -> String
pub fn surf_label(&self, j: usize) -> String
エラーに添える面の名札: 「面 j(種類, 材料, 膜 名前, 「コメント」)」。空の項は省く
pub fn image(&self) -> usize
pub fn infinite(&self) -> bool
Sourcepub fn image_point(&self, xyz: [f64; 3], lmn: [f64; 3]) -> (f64, f64)
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 のスポットと同じ定義)
Sourcepub fn image_unit(&self) -> &'static str
pub fn image_unit(&self) -> &'static str
像面の点・周波数の単位の名前: ふつうは mm、アフォーカル像空間では角度の単位
Trait Implementations§
Source§impl Clone for Prescription
impl Clone for Prescription
Source§fn clone(&self) -> Prescription
fn clone(&self) -> Prescription
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 Prescription
impl Debug for Prescription
Source§impl<'de> Deserialize<'de> for Prescription
impl<'de> Deserialize<'de> for Prescription
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Prescription, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Prescription, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Prescription
impl JsonSchema for Prescription
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Serialize for Prescription
impl Serialize for Prescription
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl !RefUnwindSafe for Prescription
impl !UnwindSafe for Prescription
impl Freeze for Prescription
impl Send for Prescription
impl Sync for Prescription
impl Unpin for Prescription
impl UnsafeUnpin for Prescription
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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