Navigation: Scripting Reference Manual > Functions & Subroutines > SetSourcePosVolumeRandom

 

SetSourcePosVolumeRandom

 

Contact Us: fredsupport@photonengr.com

 

Description

This subroutine sets the ray position specification for a detailed source with the ray positions type, "Random Volume".  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

SetSourcePosVolumeRandom( n, semiWidthX, semiWidthY, semiWidthZ, numRays, shape )

 

Parameters

n As Long

Node number of the source being modified.

 

semiWidthX As Double

X semi-width of the source volume.

 

semiWidthY As Double

Y semi-width of the source volume.

 

semiWidthZ As Double

Z semi-width of the source volume.

 

numRays As Long (or Huge_)

The total number of random ray positions within the volume.

 

shape As String

Shape of the volume specified using one of the following options:

"B" = box

"S" = spheroid

"X" = X-cylinder

"Y" = Y-cylinder

"C" = Z-cylinder

"Z" = Z-cylinder

All other values will set the shape to a spheroid.

 

Example

The following example retrieves the current "Random Volume" position specification from a source node, modifies the shape of the volume parameter, then applies the modified specification back to the source node and Updates the model.

 

Sub Main

          

    Dim src As Long

    src = FindFullName( "Optical Sources.Test" )

 

    Dim sX As Double, sY As Double, sZ As Double, nRays As Long, shp As String

    GetSourcePosVolumeRandom( src, sX, sY, sZ, nRays, shp )

    shp = "C"

    SetSourcePosVolumeRandom( src, sX, sY, sZ, nRays, shp )

    Update

 

End Sub

 

See Also

GetSourcePosVolumeRandom

IsSourcePosVolumeRandom

 

 

 

 

 

 

Copyright © Photon Engineering, LLC