Description This function sets the configuration parameters for a Laser Diode Beam or M-Squared Laser Beam type Source Primitive. A boolean is returned indicating whether the parameters were successfully applied.
Syntax success = SourcePrimSetParmLaser( spNode, tLaser, wl )
Parameters success (Boolean) Returned boolean indicating whether the parameters were successfully applied to the source node.
spNode As Long Node number of the Laser Diode Beam or M-Squared Laser Beam type Source Primitive being modified.
tLaser as T_SOURCEPRIMLASER Data structure containing the configuration parameters of the beam.
wl As Double Wavelength of the source in microns.
Example
The example below demonstrates how to add and configure a Laser Diode Beam type Source Primitive. The source wavelength is 0.532 microns.
Sub Main
'Source primitive type Dim sType As String sType = "Laser Diode Beam (coherent)"
'Add the source primitive Dim spNode As Long Dim tEnt As T_ENTITY InitEntity( tEnt ) tEnt.name = "Laser Diode" spNode = AddSourcePrim( sType, tEnt )
'Configure the primitive parameters Dim success As Boolean Dim tLaser As T_SOURCEPRIMLASER tLaser.angType = "Half width at 1/e^2 power point" tLaser.ParamX = -0.001 'Focus offset in the X axis tLaser.ParamY = 0.001 'Focus offset in the Y axis tLaser.PowerWatts = 1.0 tLaser.semiAngX = 5 'Semi-angle in degrees tLaser.semiAngY = 5 'Semi-angle in degrees tLaser.Xnum = 32 'Samples in X tLaser.Ynum = 32 'Samples in Y success = SourcePrimSetParmLaser( spNode, tLaser, 0.532 )
'Draw color, red SourcePrimSetDrawColor( spNode, 255, 0, 0 )
'Update the model Update
End Sub
The example below demonstrates how to add and configure an M-Squared Laser Beam type Source Primitive. The source wavelength is 0.532 microns.
Sub Main
'Source primitive type Dim sType As String sType = "M-Squared Laser Beam"
'Add the source primitive Dim spNode As Long Dim tEnt As T_ENTITY InitEntity( tEnt ) tEnt.name = "M2 Beam" spNode = AddSourcePrim( sType, tEnt )
'Configure the primitive parameters Dim success As Boolean Dim tLaser As T_SOURCEPRIMLASER tLaser.angType = "Half width at 1/e^2 power point" tLaser.ParamX = 1.3 'M2 in X axis tLaser.ParamY = 1.3 'M2 in Y axis tLaser.PowerWatts = 1.0 tLaser.semiAngX = 5 'Semi-angle in degrees tLaser.semiAngY = 5 'Semi-angle in degrees tLaser.Xnum = 32 'Samples in X tLaser.Ynum = 32 'Samples in Y success = SourcePrimSetParmLaser( spNode, tLaser, 0.532 )
'Draw color, red SourcePrimSetDrawColor( spNode, 255, 0, 0 )
'Update the model Update
End Sub
See Also Source Primitive Script Commands
|