axis_z = CDbl(dlg.TextBoxZ)
'Print warning if material of the same name already exists
Print " "
If FindMaterial(newName) > 0 Then
Print "Warning: A material named " & newName & " already exists."
End If
'Create material
wavDelta = (wavEnd-wavStart)/(wavSteps-1)
For wav = wavStart To wavEnd+0.00001 Step wavDelta
biref.wavelen = wav
biref.NOrd = RefractiveIndex( matOrdId, wav )
biref.NExt = RefractiveIndex( matExtraId, wav )
biref.GOrd=0
biref.GExt=0
If wav = wavStart Then 'Create material
id = AddBirefringentMaterial (newName, "Birefringent using " & GetMaterialName(matOrdId) & " (no) & " & GetMaterialName(matExtraId) & " (ne)", biref )
Else 'Add data to the list
AppendBirefringentMaterialSample id, biref
End If
Next wav
'Set crystal axis
SetLength3D axis_x,axis_y,axis_z,1
SetBirefringentMaterialCrystalAxis id, axis_x, axis_y, axis_z
Print "New birefringent material created: " & newName
Update
End Sub
4. 运行后会出现如下对话框
在o光一栏选择CaCO3,在e光一栏选择CaCO3_extraoridinary,
波长范围是0.2-2.2微米,步长101,光轴选择x轴(1 0 0)
命名:CaCO3(x-轴)可,可根据实际情况命名。
点击最下面的“行”也就是确认按钮。
5. 现在查看树形文件Materia 下的CaCO3(x-轴)材料:
我们看到其材料类型为"Sampled Birefringent and/or Optically Active Material"。
现在双折射材料方解石在X轴方向的材料创建完成了,步骤3的脚本适用于任何的双折射材料。
练习:
创建YVO4双折射材料,波长范围0.48-1.34,步骤101。
|