Skip to main content

Surface

Struct Surface 

Source
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

Source

pub fn action(&self) -> Action<'_>

面の働き(今の値から作る見方)。座標ブレークは面でないので Surface::is_coord_break で先に分ける (ここでは Action::Refract を返すが、屈折率は前の値を引き継ぐ)

Source§

impl Surface

Source

pub fn typ(&self) -> SurfType

面の種類

Source

pub fn set_type(&mut self, t: SurfType)

種類を t に変える。同じ種類なら何もしない。持ち越せる値(Zernike の項・屈折率分布・非球面の係数の並び)は 持ち越し(係数を持たない種類では捨てる)、ほかの種類ごとの値は既定に戻す

Source

pub fn cx(&self) -> f64

トロイダル面の回転の曲率(ほかの種類は 0)

Source

pub fn zern(&self) -> Option<&ZernSag>

Zernike の項(Zernike Sag・Grid Sag)

Source

pub fn zern_mut(&mut self) -> Option<&mut Option<Arc<ZernSag>>>

Zernike の項の置き場(Zernike Sag・Grid Sag の面だけ)

Source

pub fn grid(&self) -> Option<&GridSag>

Grid Sag の格子

Source

pub fn grid_file(&self) -> &str

Grid Sag の .DAT のファイル名(ほかの種類は空)

Source

pub fn bin2(&self) -> Option<&Binary2>

Binary 2 の位相

Source

pub fn cylf(&self) -> Option<&CylFresnel>

Cylinder Fresnel の屈折の面

Source

pub fn grin(&self) -> Option<&Grin>

面の後ろの屈折率分布(Gradium・Gradient 9)

Source

pub fn cb(&self) -> [f64; 5]

座標ブレークのずらし(ほかの種類は 0)

Source

pub fn cb_order(&self) -> u8

座標ブレークの順序(ほかの種類は 0)

Source

pub fn focal(&self) -> f64

理想レンズの焦点距離(ほかの種類は 0)

Source

pub fn opd_mode(&self) -> i32

理想レンズの OPD の扱い(ほかの種類は 0)

Source

pub fn jones(&self) -> [f64; 8]

Jones 面の行列(ほかの種類は単位行列)

Source

pub fn user(&self) -> Option<&UserSurf>

利用者定義の面のモデルと設定

Source

pub fn user_shape(&self) -> Option<&UserShape>

利用者定義の形のモデルと設定

Source

pub fn cb_mut(&mut self) -> Option<(&mut [f64; 5], &mut u8)>

座標ブレークのずらしと順序の置き場(座標ブレークだけ)

Source

pub fn paraxial_mut(&mut self) -> Option<(&mut f64, &mut i32)>

理想レンズの焦点距離と OPD の扱いの置き場(理想レンズだけ)

Source

pub fn jones_mut(&mut self) -> Option<&mut [f64; 8]>

Jones 行列の置き場(Jones 面だけ)

Source

pub fn cx_mut(&mut self) -> Option<&mut f64>

トロイダル面の回転の曲率の置き場(トロイダル面だけ)

Source

pub fn grid_file_mut(&mut self) -> Option<&mut String>

Grid Sag の .DAT のファイル名の置き場(Grid Sag だけ)

Source

pub fn grid_mut(&mut self) -> Option<&mut Option<Arc<GridSag>>>

Grid Sag の格子の置き場(Grid Sag だけ)

Source

pub fn bin2_mut(&mut self) -> Option<&mut Option<Arc<Binary2>>>

Binary 2 の位相の置き場(Binary 2 だけ)

Source

pub fn cylf_mut(&mut self) -> Option<&mut Option<Arc<CylFresnel>>>

Cylinder Fresnel の屈折の面の置き場(Cylinder Fresnel だけ)

Source

pub fn user_mut(&mut self) -> Option<&mut Option<UserSurf>>

利用者定義の面のモデルの置き場(利用者定義の面だけ)

Source

pub fn user_shape_mut(&mut self) -> Option<&mut Option<UserShape>>

利用者定義の形のモデルの置き場(利用者定義の形の面だけ)

Source

pub fn grin_mut(&mut self) -> Option<&mut Option<Arc<Grin>>>

屈折率分布の置き場(Gradium・Gradient 9 だけ)

Source

pub fn asph(&self) -> &[f64]

非球面の係数の並び(偶数次非球面・トロイダル・Zernike・Grid Sag・Fresnel・Cylinder Fresnel・Binary 2 は 偶数次の係数、Odd Asphere は β、Tilted は [tan α, tan β]、Irregular はその 8 つの値。ほかの種類は空)

Source

pub fn asph_mut(&mut self) -> Option<&mut Vec<f64>>

非球面の係数の並びの置き場(長さを変えられる種類だけ。Tilted・Irregular は Surface::asph_fixed_mut)

Source

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 で裏返し、対応しないモデルなら誤り(面は変えない)

Source

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 で映し、対応しなければ誤り

Source

pub fn parm(&self, i: u8) -> Option<f64>

面タイプのパラメータ i(.zmx の PARM の番号)の値。この面タイプで値を持たない番号は None

Source

pub fn set_parm(&mut self, i: u8, v: f64) -> bool

面タイプのパラメータ i(.zmx の PARM の番号)を書く。値を持たない番号なら false(.zmx の読込・ピックアップ・ パラメータが使う、番号と値の対応はここと Surface::parm の 1 か所)

Source

pub fn asph_fixed_mut(&mut self) -> Option<&mut [f64]>

Tilted・Irregular の決まった数の値の置き場

Source

pub fn set_asph(&mut self, v: Vec<f64>) -> bool

非球面の係数の並びを v にする。Tilted・Irregular は先頭から決まった数だけ取り(足りなければ 0)、 係数を持たない種類は何もしない。v のうち置けなかった値に 0 でないものがあれば false

Source

pub fn set_asph_at(&mut self, i: usize, x: f64) -> bool

非球面の係数 i を x にする(長さを変えられる種類は足りなければ 0 で伸ばす)。置けなければ false

Source§

impl Surface

Source

pub fn shape(&self) -> Shape<'_>

面の形(今の値から作る見方)

Source

pub fn is_coord_break(&self) -> bool

座標ブレーク(面ではなく、座標系だけを変える要素)

Source§

impl Surface

Source

pub fn is_mirror(&self) -> bool

鏡(材料が Material::Mirror)

Source

pub fn has_asph(&self) -> bool

Trait Implementations§

Source§

impl Clone for Surface

Source§

fn clone(&self) -> Self

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 Surface

Source§

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

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

impl Default for Surface

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Surface

Source§

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

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

impl JsonSchema for Surface

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 PartialEq for Surface

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Surface

Source§

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

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Surface

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
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
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.