pub enum Material {
Air,
Glass(String),
Model {
nd: f64,
vd: f64,
dpgf: f64,
},
Index(f64),
Mirror,
Inherit,
}Expand description
面の後ろの媒質
Variants§
Air
空気(屈折率 1)
Glass(String)
名前で引く媒質(カタログのガラス・GRIN の分布の名前・複屈折材の常光の材料)
Model
モデルガラス(Abbe 数 vd ≠ 0。ΔPgF は無ければ 0)
Index(f64)
どの波長でも同じ屈折率の媒質(分散のないモデルガラス、屈折率だけ決めた媒質)
Mirror
鏡(後ろの媒質は前の媒質のまま)
Inherit
媒質を持たない面(座標ブレーク。後ろの媒質は前の媒質のまま)
Implementations§
Source§impl Material
impl Material
Sourcepub fn parse(s: &str) -> Material
pub fn parse(s: &str) -> Material
名前から。空・“AIR” は空気、“MIRROR” は鏡、“-” は媒質なし、nd,vd[,ΔPgF] はモデルガラス(vd = 0 は屈折率だけ)、
ほかはガラスの名前(前後の空白は除く。大文字小文字はガラスの名前では区別する)
Sourcepub fn name(&self) -> String
pub fn name(&self) -> String
名前(Material::parse で同じ値に戻る。空気は空、屈折率だけの媒質は “nd,0”)
pub fn is_air(&self) -> bool
pub fn is_mirror(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Material
impl<'de> Deserialize<'de> for Material
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Material, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Material, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for Material
impl JsonSchema for Material
Source§fn json_schema(g: &mut SchemaGenerator) -> Schema
fn json_schema(g: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
§fn inline_schema() -> bool
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 moreimpl StructuralPartialEq for Material
Auto Trait Implementations§
impl Freeze for Material
impl RefUnwindSafe for Material
impl Send for Material
impl Sync for Material
impl Unpin for Material
impl UnsafeUnpin for Material
impl UnwindSafe for Material
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
Mutably borrows from an owned value. Read more
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> ⓘ
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 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> ⓘ
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