该文档讨论设置表面光学特性(如coatings, importance samples, materials, raytrace controls, scatter等)的最简易的方式,它利用基于脚本语言的结构化(或分层次)模块,等价于在图形化的交互式用户接口中的拖拉方式。 ;BsyN[bF
首先参考一个树状结构目标,如下所示: e~oI0%xl^
-Geometry XI@;;>D1=U
-Subassembly 1 (Optical components) p xjb^GZ0
-Custom Element 2 _O{3bIay3!
-Surface 3 |4UW.dGHPo
-Surface 4 sSU p7V
+Custom Element 3 e2~&I`ct
+Subassembly 2 (Mechanical components) "{Lp'+wNw
+Subassembly 3 (Auxiliary components) #fd;]
-Custom Element 1 (Detector components) [5yLg
-Surface 1 WZ>
}
编程思想是,用户已把目标树整理成包含相似功能特征的小组,然后想通过脚本编程语言容易地修改任一组的所有表面的光学特性,即Subassembly 1中的Optical components。形如SetAll___的一组命令能实现这一功能,它运行用户指定根节点ID#及期望的特性值。现在考虑下面的例子,我们想为分层次结构中Subassembly 1下面的所有表面设置Transmit coating,相应的命令为: v,^2'C$o
Dim idNode As Long, coatNode As Long, count As Long 1?\G6T
idNode = FindFullName(“Geometry.Subassembly 1 (Optical components)”) 7Rwn{]r
coatNode = FindCoating(“Transmit”) f5'Cq)Vw_
count = SetAllCoatingProp( idNode, coatNode ) +/E`u|%|\]
在这个脚本中,Custom Element 2和Custom Element 3中的所有表面将被指定为Transmit coating。 0CX2dk"UB^