Description This subroutine changes the ray direction specification of a source to the type, "Randomly according to intensity distribution", and uses an FGD file to specify the polar and azimuth reference vectors and populate the table with intensity data. This function uses the FGD file format specification. If an Intensity on Polar Grid analysis has been performed using a Directional Analysis Entity and an ARN has been created in the process, the ARN can be written to an FGD file (from both GUI and scripting language). The resulting FGD file can be used with SetSourceDirSampledPolarImportFGDFile.
Syntax SetSourceDirSampledPolarImportFGDFile( srcNode, nRaysPerCell, fileName )
Parameters srcNode As Long Node number of the source whose ray direction specification is being modified.
nRaysPerCell As Long For every ray position defined by the ray positions specification of the source, nRaysPerCell rays will be created whose directions are randomly chosen according to the intensity data.
fileName As String Full path to the FGD file being used to set the polar and azimuth reference vectors as well as the intensity table.
Example The example below demonstrates how to create a source node, use file data to specify the source's randomly according to intensity distribution ray direction settings.
Sub Main
'Create the source node Dim srcNode As Long Dim tEnt As T_ENTITY InitEntity( tEnt ) tEnt.name = "According to Intensity" srcNode = AddSource( tEnt )
'Set the positions grid to be 1x1 rays Dim xSemi As Double, ySemi As Double, xNum As Long, yNum As Long, isEllipse As Boolean GetSourcePosGrid( srcNode, xSemi, ySemi, xNum, yNum, isEllipse ) xNum = 1 yNum = 1 SetSourcePosGrid( srcNode, xSemi, ySemi, xNum, yNum, isEllipse )
'Specify that the source use the ray direction type, "Random according to intensity distribution" 'by loading the distribution from a properly formatted text file Dim fName As String fName = "C:\temp\sourceIntensityDistribution.fgd" SetSourceDirSampledPolarImportFGDFile( srcNode, 100000, fName )
'Udpate the FRED document Update
End Sub
See Also
|