Navigation: Scripting Reference Manual > Functions & Subroutines > GetSourceDirSampledPolar

 

GetSourceDirSampledPolar

 

Contact Us: fredsupport@photonengr.com

 

Description

Retrieves the settings for a source with ray direction specification "Randomly according to intensity distribution".  The return value is a boolean indicating whether the supplied source node's ray direction specification is "Randomly according to intensity distribution".  The arguments and return value of the function  Depending on the number of rays traced, it may be necessary to dimension ray index and ray counter variables as data type Huge_ instead of Long.  Please see Multi-threaded Raytracing for more information.

 

Syntax

isSmpPolar = GetSourceDirSampledPolar( srcNode, numDirs, data(), azX, azY, azZ, polX, polY, polZ )

 

Parameters

isSmpPolar ( Boolean )

True if the source ray direction specification is "Randomly according to intensity distribution".  False otherwise.

 

srcNode As Long

Node number of the source being queried.

 

numDirs As Long (or Huge_)

Number of random ray directions per ray position.

 

data() As Double

Array containing the azimuthal and polar angles with the corresponding weighting values.

 

azX As Double

Azimuthal axis X component.

 

azY As Double

Azimuthal axis Y component.

 

azZ as Double

Azimuthal axis Z component.

 

polX As Double

Polar axis X component.

 

polY As Double

Polar axis Y component.

 

polZ As Double

Polar axis Z component.

 

Remarks

The boolean return value indicates whether the ray direction specification is "Randomly according to intensity distribution".  If this is returned false, operation continues without warning.  It is advisable to include a check against the boolean return value.

 

Example

Sub Main

 

Dim srcNode As Long, numDirs As Long

Dim az(2) As Double, pol(2) As Double, data() As Double

Dim success As Boolean

 

ClearOutputWindow

 

'find source node number and query for ray direction settings

srcNode = FindFullName( "Optical Sources.My Source" )

success = GetSourceDirSampledPolar( srcNode, numDirs, data(), az(0), az(1), az(2), pol(0), pol(1), pol(2) )

 

'check against boolean return and print information appropriately

If success Then

          Print "Source node: " & srcNode

          Print "Number of directions: " & numDirs

          Print "Azimuthal axis vector: " & az(0) & ", " & az(1) & ", " & az(2)

          Print "Polar axis vector: " & pol(0) & ", " & pol(1) & ", " & pol(2)

          Print "Data array: "

          For ii = 0 To UBound(data, 1)

                    For jj = 0 To UBound(data,2)

                              If jj = UBound(data,2) Then

                                        Print data(ii,jj)

                              Else

                                        Print data(ii,jj);

                              End If

                    Next

          Next

Else

          Print "Source ray direction specification is not of type " & Chr(34) & "Randomly according to intensity distribution" & Chr(34) & "."

End If

 

End Sub

 

See Also

Source scripting commands

IsSourceDirSampledPolar

SetSourceDirSampledPolar

 

 

 

 

 

 

Copyright © Photon Engineering, LLC