Navigation: Scripting Reference Manual > Functions & Subroutines > SetSourceDirSampledPolar

 

SetSourceDirSampledPolar

 

Contact Us: fredsupport@photonengr.com

 

Description

This subroutine sets a source node's ray direction specification to be "Randomly according to intensity distribution" and assigns the number of ray directions per position, azimuthal and polar axes direction vectors and the array containing azimuthal and polar angles and weighting factors.  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

SetSourceDirSampledPolar srcNode, numDirs, data(), azX, azY, azZ, polX, polY, polZ

 

Parameters

srcNode As Long

Node number of the source being altered.

 

numDirs As Long (or Huge_)

Number of random ray directions per ray position.

 

data() As Double

Array containing azimuthal angles, polar angles and corresponding weighting values.  The format of the array is the following:

data(0,0) = 0

data(0,1)=az1

data(0,2)=az2

...

data(0,N)=azN

data(1,0) = pol1

data(1,1)=weight(1,1)

data(1,2)=weight(1,2)

...

data(1,N)=weight(1,N)

.

.

.

.

.

.

.

.

.

...

...

...

.

.

.

data(M,0) = polM

data(N,1) = weight(M,1)

data(N,2)=weight(M,2)

...

data(M,N)=weight(M,N)

                                                                                                                        

 

azX As Double

X component of the azimuthal axis direction.

 

azY As Double

Y component of the azimuthal axis direction.

 

azZ As Double

Z component of the azimuthal axis direction.

 

polX As Double

X component of the polar axis direction.

 

polY As Double

Y component of the polar axis direction.

 

polZ As Double

Z component of the polar axis direction.

 

 

Example

Sub Main

 

          Dim srcNode As Long, numDirs As Long

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

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

 

          'specify number of ray directions, azimuthal axis direction vector and polar axis direction vector

          numDirs = 3

          az(0)=0 : az(1)=0 : az(2)=1

          pol(0)=0 : pol(1)=1 : pol(2)=0

 

          'specify azimuthal angles, polar angles, and weighting values

          data(0,0) = 0  : data(0,1)=-90 : data(0,2)=0 : data(0,3)=90

          data(1,0)=0 : data(1,1)=10 : data(1,2)=20 : data(1,3)=10

          data(2,0)=5  : data(2,1)=15 : data(2,2)=25 : data(2,3)=15

          data(3,0)=10 : data(3,1)=20 : data(3,2)=20          : data(3,3)=20

 

          SetSourceDirSampledPolar srcNode, numDirs , data(), az(0), az(1), az(2), pol(0), pol(1), pol(2)

 

End Sub

 

See Also

Source scripting commands

IsSourceDirSampledPolar

GetSourceDirSampledPolar

 

 

 

 

 

Copyright © Photon Engineering, LLC