pub struct Surface {Show 25 fields
pub form: Form,
pub ignore: bool,
pub t: f64,
pub comment: String,
pub mat: Material,
pub coat: String,
pub stop: bool,
pub semi: f64,
pub semi_auto: bool,
pub c: f64,
pub k: f64,
pub before: Option<Tilt>,
pub after: After,
pub ap: Aperture,
pub dn: f64,
pub disp: f64,
pub dnd: f64,
pub dvd: f64,
pub reflect: Option<Reflect>,
pub retarder: Option<Retarder>,
pub bire: Option<Bire>,
pub tce: f64,
pub mech_semi: Option<f64>,
pub coord_return: Option<CoordReturn>,
pub chip_zone: f64,
}Expand description
面の値(処方)。== は値の比較(NaN は等しくない、−0 と 0 は等しい)
Fields§
§form: Form面の種類と、種類ごとの値(Form)。serde では面の表の中に平たく(typ・cb など)
ignore: bool§t: f64次の面までの厚さ [mm](物体面は無限遠なら inf)
comment: String§mat: Material面の後ろの媒質(鏡・座標ブレークの媒質なしも)
coat: String§stop: bool§semi: f64半直径 [mm]。semi_auto なら光線から求めた値(crate::System::update_semi)
semi_auto: bool半直径を光線から求める(OpticStudio の Automatic、.zmx の DIAM … 0、系ファイルの “semi”: “auto”)
c: f64§k: f64§before: Option<Tilt>§after: After§ap: Aperture§dn: f64媒質の屈折率のずれ(全波長に足す)。crate::param で変える
disp: f64媒質の分散の相対変化: n = n0(λ) + dn + disp·(n0(λ) − n0(主波長))
dnd: f64ガラスの d 線の屈折率のずれ(OpticStudio の TIND)。ガラスの nd・vd・ΔPgF のモデルガラスの式で、nd を このぶん変えた差を波長ごとに n0(λ) に足す(ガラスかモデルガラスの面だけ。dn・disp はその後にかける)
dvd: f64ガラスのアッベ数のずれ(OpticStudio の TABB)。Surface::dnd と同じくモデルガラスの式の差を足す
reflect: Option<Reflect>屈折面での反射(ゴーストの経路、lensbench-analysis の ghost)。材料を鏡にして立て、光線は鏡として曲げ、
偏光の係数は入射側の媒質と反対側の媒質 Reflect::mat の境界(膜込み)の反射にする
retarder: Option<Retarder>Jones 面(SurfType::Jones)を波長ごとに作る偏光子・波長板。あれば偏光の追跡は jones でなく
これを各波長で使う(jones は設計波長 wl0 の値で、.zmx の JONESMAT に書く)
bire: Option<Bire>複屈折材の板の入口・出口(OpticStudio の Birefringent In / Out)。形は標準面のまま
tce: f64面の熱膨張係数 [1e-6/°C](OpticStudio のレンズデータの TCE の列、.zmx の TCED。空気の面の機構の膨張に使う値で、 光線追跡には効かない。硝材の面の TCE はカタログの値)
mech_semi: Option<f64>固定した機械半径(OpticStudio の Mech Semi-Dia、.zmx の MEMA の固定)。None は自動。玉の半径
(System::lens_radius)はガラスでつながる面の、これとクリア半径 + チップゾーンの最大
(自動より小さい値は使わない。OpticStudio 26.1 と同じ)。光線追跡には効かない
coord_return: Option<CoordReturn>座標の戻り(OpticStudio の Coordinate Return、座標ブレークだけ): 座標ブレークの傾き・偏心(と厚さ)を、前の面 surf の
座標系に戻るように求める(crate::coord_return)
chip_zone: f64チップゾーン(OpticStudio の Chip Zone、.zmx の OEMA): 面の形をクリア半径からこの幅だけ外へ延ばし、その外を平らにする。 光線追跡には効かない
Implementations§
Source§impl Surface
impl Surface
Sourcepub fn action(&self) -> Action<'_>
pub fn action(&self) -> Action<'_>
面の働き(今の値から作る見方)。座標ブレークは面でないので Surface::is_coord_break で先に分ける
(ここでは Action::Refract を返すが、屈折率は前の値を引き継ぐ)
Source§impl Surface
impl Surface
Sourcepub fn set_type(&mut self, t: SurfType)
pub fn set_type(&mut self, t: SurfType)
種類を t に変える。同じ種類なら何もしない。持ち越せる値(Zernike の項・屈折率分布・非球面の係数の並び)は 持ち越し(係数を持たない種類では捨てる)、ほかの種類ごとの値は既定に戻す
Sourcepub fn zern_mut(&mut self) -> Option<&mut Option<Arc<ZernSag>>>
pub fn zern_mut(&mut self) -> Option<&mut Option<Arc<ZernSag>>>
Zernike の項の置き場(Zernike Sag・Grid Sag の面だけ)
Sourcepub fn cylf(&self) -> Option<&CylFresnel>
pub fn cylf(&self) -> Option<&CylFresnel>
Cylinder Fresnel の屈折の面
Sourcepub fn user_shape(&self) -> Option<&UserShape>
pub fn user_shape(&self) -> Option<&UserShape>
利用者定義の形のモデルと設定
Sourcepub fn paraxial_mut(&mut self) -> Option<(&mut f64, &mut i32)>
pub fn paraxial_mut(&mut self) -> Option<(&mut f64, &mut i32)>
理想レンズの焦点距離と OPD の扱いの置き場(理想レンズだけ)
Sourcepub fn grid_file_mut(&mut self) -> Option<&mut String>
pub fn grid_file_mut(&mut self) -> Option<&mut String>
Grid Sag の .DAT のファイル名の置き場(Grid Sag だけ)
Sourcepub fn cylf_mut(&mut self) -> Option<&mut Option<Arc<CylFresnel>>>
pub fn cylf_mut(&mut self) -> Option<&mut Option<Arc<CylFresnel>>>
Cylinder Fresnel の屈折の面の置き場(Cylinder Fresnel だけ)
Sourcepub fn user_shape_mut(&mut self) -> Option<&mut Option<UserShape>>
pub fn user_shape_mut(&mut self) -> Option<&mut Option<UserShape>>
利用者定義の形のモデルの置き場(利用者定義の形の面だけ)
Sourcepub fn asph(&self) -> &[f64]
pub fn asph(&self) -> &[f64]
非球面の係数の並び(偶数次非球面・トロイダル・Zernike・Grid Sag・Fresnel・Cylinder Fresnel・Binary 2 は 偶数次の係数、Odd Asphere は β、Tilted は [tan α, tan β]、Irregular はその 8 つの値。ほかの種類は空)
Sourcepub fn asph_mut(&mut self) -> Option<&mut Vec<f64>>
pub fn asph_mut(&mut self) -> Option<&mut Vec<f64>>
非球面の係数の並びの置き場(長さを変えられる種類だけ。Tilted・Irregular は Surface::asph_fixed_mut)
Sourcepub fn flip_z(&mut self) -> Result<()>
pub fn flip_z(&mut self) -> Result<()>
面を z について裏返す(矢高 z(x, y) → −z(x, y)): 曲率・トロイダル面の回転の曲率・非球面の係数・Zernike の項・
格子・Tilted の傾き・Cylinder Fresnel の屈折の面の符号を変える。Irregular は傾きと Zs・Za・Zc の符号を変え、
偏心と項の角度はそのまま(P = d + Rx(tx) Ry(ty) Q を z について映すと Rx・Ry の角度の符号が変わる)。
鏡の後の座標で面を書くときと、面の並びの復路に使う。面の後の媒質も裏返す(GRIN の分布、複屈折材の結晶軸の
z 成分)。Binary 2 の位相・理想レンズ・Jones の行列は面内の量なので変えない。利用者定義の面はモデルの
crate::usersurf::SurfaceModel::flip で裏返し、対応しないモデルなら誤り(面は変えない)
Sourcepub fn mirror_x(&mut self) -> Result<()>
pub fn mirror_x(&mut self) -> Result<()>
面を x について裏返す(矢高 z(x, y) → z(−x, y)): Zernike の項・格子・Tilted の x の傾きを映し、Irregular は
偏心 x・傾き y・項の角度の符号を変える(Rx はそのまま、Ry・Rz は角度の符号が変わる)。開口はそのまま。
Surface::flip_z と合わせて y 軸のまわりに 180° 回した向き(玉の反転)になる。回転対称な形と、x について
対称な形(トロイダル面・Cylinder Fresnel)は何も変わらない。GRIN の分布の軸・形の傾き、複屈折材の結晶軸の
x 成分も映す。利用者定義の面はモデルの crate::usersurf::SurfaceModel::flip で映し、対応しなければ誤り
Sourcepub fn set_parm(&mut self, i: u8, v: f64) -> bool
pub fn set_parm(&mut self, i: u8, v: f64) -> bool
面タイプのパラメータ i(.zmx の PARM の番号)を書く。値を持たない番号なら false(.zmx の読込・ピックアップ・
パラメータが使う、番号と値の対応はここと Surface::parm の 1 か所)
Sourcepub fn asph_fixed_mut(&mut self) -> Option<&mut [f64]>
pub fn asph_fixed_mut(&mut self) -> Option<&mut [f64]>
Tilted・Irregular の決まった数の値の置き場
Sourcepub fn set_asph(&mut self, v: Vec<f64>) -> bool
pub fn set_asph(&mut self, v: Vec<f64>) -> bool
非球面の係数の並びを v にする。Tilted・Irregular は先頭から決まった数だけ取り(足りなければ 0)、 係数を持たない種類は何もしない。v のうち置けなかった値に 0 でないものがあれば false
Sourcepub fn set_asph_at(&mut self, i: usize, x: f64) -> bool
pub fn set_asph_at(&mut self, i: usize, x: f64) -> bool
非球面の係数 i を x にする(長さを変えられる種類は足りなければ 0 で伸ばす)。置けなければ false
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Surface
impl<'de> Deserialize<'de> for Surface
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 JsonSchema for Surface
impl JsonSchema for Surface
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 moreimpl StructuralPartialEq for Surface
Auto Trait Implementations§
impl !RefUnwindSafe for Surface
impl !UnwindSafe for Surface
impl Freeze for Surface
impl Send for Surface
impl Sync for Surface
impl Unpin for Surface
impl UnsafeUnpin for Surface
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>,
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