pub struct Project {Show 34 fields
pub format: Option<String>,
pub format_version: Option<u32>,
pub name: String,
pub glass_catalogs: Vec<String>,
pub coatings: BTreeMap<String, CoatSpec>,
pub coating_file: Option<String>,
pub macros: Vec<Macro>,
pub wavelengths: Vec<Wave>,
pub primary: usize,
pub aperture: ApertureSpec,
pub fields: FieldsSpec,
pub object_distance: Option<f64>,
pub aiming: Aiming,
pub telecentric: bool,
pub afocal: Option<String>,
pub floating_clip: bool,
pub mech_clip: bool,
pub apodization: Apodization,
pub ropd: i64,
pub aim_pupil: AimPupil,
pub input_pol: InputPolarization,
pub glass_template: GlassTemplate,
pub vig_interp: Option<VigInterp>,
pub blocks: Vec<Block>,
pub states: Vec<State>,
pub path: Option<String>,
pub beams: Vec<Beam>,
pub turn: Option<BlockFace>,
pub mechanics: Vec<MechPlacement>,
pub glrs: Option<BlockRef>,
pub environment: Environment,
pub image: Option<Box<Row>>,
pub object: Option<Box<Row>>,
pub gui: Option<Value>,
}Fields§
§format: Option<String>形式の印 “lensbench-project”。書くときはいつも付ける(省略したファイルは今の版として読む)
format_version: Option<u32>形式の版(今は 1)。読める版より新しければ誤り
name: String§glass_catalogs: Vec<String>§coatings: BTreeMap<String, CoatSpec>膜(名前 → フィルタの透過特性・表)。面の coat に名前を書いて使う。ユーザーカタログの同じ名前より優先
coating_file: Option<String>膜ファイル(OpticStudio の COATING.DAT の形)。面の coat の名前を、coatings に無ければこのファイルで引く。
相対パスはプロジェクトのフォルダから、そこに無ければ材料の検索フォルダから。取り込んだ .zmx の膜ファイルより優先
macros: Vec<Macro>ZPL のマクロ(名前 name と文 source、.ZPL の中身)。ブロックの surface_ops の add_solve で種類
macro_curv・macro_thick の param にこの並びの番号(0 始まり)を書いて使う。マクロのファイルは読まない
wavelengths: Vec<Wave>§primary: usize主波長の番号(1 始まり)
aperture: ApertureSpec§fields: FieldsSpec§object_distance: Option<f64>物体面から最初のブロックまで [mm](省略で無限遠)
aiming: Aiming§telecentric: bool物体側テレセントリック(物体距離が有限のときだけ)
afocal: Option<String>像空間をアフォーカルにする。値は角度の単位(ur・mr・rr・as・am・dg)
floating_clip: bool浮動開口(半直径を固定した面)の外の光線をけるか(既定はける。OpticStudio と同じ)
mech_clip: bool機構部品(mechanics)の穴の外に出た光線を、解析の光線追跡でもけるか(既定はける。false ならけられは
機構のケラレの解析だけで見て、レイアウト図では切られる点から後ろを薄く描く)
apodization: Apodization瞳の振幅の分布("uniform"・{"gaussian": G}・"cosine_cubed"。省略は一様)
ropd: i64OPD の基準(.zmx の ROPD。省略は 2: 出射瞳の参照球)
aim_pupil: AimPupil光線エイミングの瞳のずれ・圧縮(.zmx の PUSH と RAIM の 10 番目。追跡には効かない)。省略は全部 0
input_pol: InputPolarization系の入射偏光(.zmx の POLS。膜・偏光を入れる解析の入射の偏光)。省略は偏光なし
glass_template: GlassTemplateガラス置換のテンプレート(OpticStudio の Glass Substitution Template、.zmx の GSTD)。最適化のガラスの置き換えの候補を絞る
vig_interp: Option<VigInterp>定義した視野以外の点のケラレ係数の求め方("continuous"・"opticstudio"。省略は連続)
blocks: Vec<Block>§states: Vec<State>§path: Option<String>ビームスプリッターの経路(BS を通る順の T・R)。省略で各 BS の arm。状態の project でも変えられる
beams: Vec<Beam>光束の組(名前つきの経路)。光束の名前は状態の名前の代わりに使え、光束の状態を当てて経路を選んだ系になる
turn: Option<BlockFace>当てた光束の turn(Beam::turn)。Project::with_state で光束から写す(ファイルには書かない)
mechanics: Vec<MechPlacement>機構部品(チューブ・ケージ板・マウント)。光線の追跡は変えず、ケラレの確認(mech-check)と描画に使う
glrs: Option<BlockRef>大域座標の基準の面(.zmx の GLRS。書き出し・3D の座標の原点)。ブロックの面 {"block": id, "surface": i} か、
展開した系の面の番号か名前。省略で面 1
environment: Environment温度・気圧(ガラスの屈折率の計算)。省略で 20 °C・1 atm・補正なし
image: Option<Box<Row>>像面(省略は平面で傾きなし)。システムファイル(版 2)の面の行で、形・面の前の傾き偏心・開口などを書く。 厚さ・媒質・絞りの印は書けない
object: Option<Box<Row>>物体面の形・開口・物体空間の媒質(省略は平面で開口なし・空気)。image と同じ面の行で、厚さは
object_distance。medium は物体空間の媒質(液浸など)。厚さ・絞りの印・傾き偏心は書けない
gui: Option<Value>GUI が自分の編集の状態(組合せの表など)を残す欄。展開には使わない
Implementations§
Source§impl Project
impl Project
Sourcepub fn check_beams(&self) -> Result<()>
pub fn check_beams(&self) -> Result<()>
光束の組の誤り: 名前の空・重なり(光束どうし・状態と)、無い状態、経路の文字
Sourcepub fn beam_names(&self) -> Vec<&str>
pub fn beam_names(&self) -> Vec<&str>
光束の名前(Project::beams の順)
Sourcepub fn beam_takes_path(&self, name: &str, path_given: bool) -> Result<()>
pub fn beam_takes_path(&self, name: &str, path_given: bool) -> Result<()>
状態・光束の名前 name と一緒に別の経路を渡してよいか(経路を持つ光束には渡せない)
Sourcepub fn with_state_and_path(
&self,
name: &str,
path_given: bool,
) -> Result<Project>
pub fn with_state_and_path( &self, name: &str, path_given: bool, ) -> Result<Project>
Project::with_state。別の経路を渡すなら(path_given)、経路を持つ光束は誤り
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Project
impl<'de> Deserialize<'de> for Project
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 Project
impl JsonSchema for Project
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 moreAuto Trait Implementations§
impl Freeze for Project
impl RefUnwindSafe for Project
impl Send for Project
impl Sync for Project
impl Unpin for Project
impl UnsafeUnpin for Project
impl UnwindSafe for Project
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