pub enum Shape<'a> {
Plane,
Conic {
c: f64,
k: f64,
},
EvenAsphere(Base<'a>),
OddAsphere {
c: f64,
k: f64,
b: &'a [f64],
},
Toroid {
c: f64,
k: f64,
a: &'a [f64],
cx: f64,
},
Zernike {
base: Base<'a>,
terms: Option<&'a ZernSag>,
},
GridSag {
base: Base<'a>,
terms: Option<&'a ZernSag>,
grid: Option<&'a GridSag>,
},
Tilted {
tan: [f64; 2],
c: f64,
k: f64,
},
ConicTilted {
c: f64,
k: f64,
tan: [f64; 2],
},
Cylinder(Base<'a>),
Irregular(Irregular),
User {
c: f64,
k: f64,
shape: &'a UserShape,
h: f64,
},
}Expand description
面の形(Surface::shape)
Variants§
Plane
頂点の平面(Fresnel・Jones・理想レンズ・利用者定義の面、座標ブレーク)
Conic
二次曲面(c = 0 は平面)。標準面・Gradium
EvenAsphere(Base<'a>)
偶数次非球面。Even Asphere・Binary 2
OddAsphere
Odd Asphere: 二次曲面(c・k)+ Σ b[i] r^{i+1}
Toroid
トロイダル面: YZ 面の曲線(c・k・y², y⁴, … の係数 a)を、頂点から 1/cx 離れた Y 軸に平行な軸の周りに回した面 (cx = 0 は円柱面)
Zernike
Zernike Sag: 偶数次非球面 + Zernike の項(Standard か Fringe かは ZernSag::fringe)
GridSag
Grid Sag: 偶数次非球面 + Zernike(Standard)の項 + 格子の補間
Tilted
Tilted: 平面 z = x tan α + y tan β。c・k は形に効かない残りの値で、従来どおり交点のニュートン法の
初期値(二次曲面との交点)にだけ使う
ConicTilted
標準面 + x tan α + y tan β(Gradient 9 の形。傾きは面の後ろの屈折率分布の値)
Cylinder(Base<'a>)
y だけの偶数次非球面(Cylinder Fresnel の基板)
Irregular(Irregular)
User
利用者定義の形: 二次曲面(c・k)+ 登録のモデルの矢高(裏返しを含む、crate::usershape)
Implementations§
Source§impl Shape<'_>
impl Shape<'_>
Sourcepub fn sag(&self, x: f64, y: f64) -> (f64, f64, f64)
pub fn sag(&self, x: f64, y: f64) -> (f64, f64, f64)
面の局所座標 (x, y) での矢高と (∂z/∂x, ∂z/∂y)。面の外(平方根が負、値のない格子点)は NaN
Sourcepub fn is_freeform(&self) -> bool
pub fn is_freeform(&self) -> bool
回転対称でない矢高の面か(Zernike・Grid Sag・Odd Asphere・Tilted・Irregular。瞳を実光線で求める、 交点・法線を一般の矢高で求めるなど)
Sourcepub fn paraxial_curv(&self) -> f64
pub fn paraxial_curv(&self) -> f64
近軸の曲率(YZ 面。トロイダル面も YZ 面で、OpticStudio と同じ)。OpticStudio 26.1 の EFFL に合わせたもの:
- 偶数次非球面・トロイダル面: c + 2 a₁(r²・y² の項は近軸の曲率に入る)
- Odd Asphere: c + 2 β₂、Tilted: 0、Irregular: c
- Zernike Sag: 基準の c + 2 a₁ に、Zernike の項のうち Z4(デフォーカス)の分だけを足す (Standard Z4 = √3 (2ρ² − 1) → 4√3 A4 / R²、Fringe Z4 = 2ρ² − 1 → 4 A4 / R²。偏心は見ない)
- Grid Sag: 双三次なら頂点での ∂²z/∂y²(格子の補間の分を含む。勾配 ∂z/∂y の中心差分)、双一次は基準の面だけ。 OpticStudio は頂点の ∂²z/∂y² を矢高の差分(刻み 1e-2 mm 程度)で求めるらしく、円錐係数・r^4 以上の項・ 双一次の折れ目の分だけ違う(EFFL で相対 1e-9〜1e-8、頂点が格子点に乗る双一次では大きく違う。 OpticStudio との照合)。ここでは差分を使わない厳密な値にしている
Sourcepub fn paraxial_extra(&self) -> Option<f64>
pub fn paraxial_extra(&self) -> Option<f64>
近軸の曲率のうち c に依らない分 e(Shape::paraxial_curv が c + e のとき): 二次曲面・Irregular 0、
偶数次非球面・トロイダル面・Cylinder Fresnel の基板 2 a₁、Odd Asphere 2 β₂。曲率のソルブ(c = 目標の近軸の
曲率 − e)を近軸の追跡と同じ規則にするためのもの。c だけで近軸の曲率が決まらない面(平面・Tilted・
Zernike Sag・Grid Sag)は None
Source§impl Shape<'_>
impl Shape<'_>
Sourcepub fn takes(&self, kind: Kind) -> bool
pub fn takes(&self, kind: Kind) -> bool
形のパラメータ kind(c・R・k・asph の i 番目・Zernike の項)がこの形を変え、Shape::dsag で微分できるか。
- 二次曲面: c・k。偶数次非球面・Zernike Sag・Grid Sag: c・k・a(Zernike の項は面に項があるとき)
- Odd Asphere: c・k・β(
asphの i 番目が r^(i+1) の係数) - Tilted: tan α・tan β(
asphの 0・1 番目)だけ。c・k は形に効かない - Irregular: c・k と
asphの 0〜7 番目(偏心 x・y、傾き x・y、Zs・Za・Zc、角度) - そのほか(トロイダル面・Cylinder Fresnel の基板・Gradient 9 の形・平面): なし(変数にできない面)
Sourcepub fn dsag(&self, kind: Kind, x: f64, y: f64) -> Option<[f64; 3]>
pub fn dsag(&self, kind: Kind, x: f64, y: f64) -> Option<[f64; 3]>
矢高と勾配 (z, ∂z/∂x, ∂z/∂y)(Shape::sag)の、形のパラメータ kind による微分(面の局所座標の x・y を
固定)。角度のパラメータ(Irregular の傾き・角度)は度あたり。形を変えないパラメータ(Shape::takes が
false)は None
Trait Implementations§
impl<'a> Copy for Shape<'a>
impl<'a> StructuralPartialEq for Shape<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Shape<'a>
impl<'a> !UnwindSafe for Shape<'a>
impl<'a> Freeze for Shape<'a>
impl<'a> Send for Shape<'a>
impl<'a> Sync for Shape<'a>
impl<'a> Unpin for Shape<'a>
impl<'a> UnsafeUnpin for Shape<'a>
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,
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