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. 運(yùn)行后會出現(xiàn)如下對話框
在o光一欄選擇CaCO3,在e光一欄選擇CaCO3_extraoridinary,
波長范圍是0.2-2.2微米,步長101,光軸選擇x軸(1 0 0)
命名:CaCO3(x-軸)可,可根據(jù)實(shí)際情況命名。
點(diǎn)擊最下面的“行”也就是確認(rèn)按鈕。
5. 現(xiàn)在查看樹形文件Materia 下的CaCO3(x-軸)材料:
我們看到其材料類型為"Sampled Birefringent and/or Optically Active Material"。
現(xiàn)在雙折射材料方解石在X軸方向的材料創(chuàng)建完成了,步驟3的腳本適用于任何的雙折射材料。
練習(xí):
創(chuàng)建YVO4雙折射材料,波長范圍0.48-1.34,步驟101。
|