Navigation: Scripting Reference Manual > Functions & Subroutines > GetRayOrdinaryExtraType

 

GetRayOrdinaryExtraType

 

Contact Us: fredsupport@photonengr.com

 

Description

This function queries a ray and returns a string indicating whether the ray is an "ordinary" ray or "extraordinary" ray in the context of the ray's current immersion material.  If the ray is not currently immersed in a birefringent material, then this function will return "Ordinary".  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

rayType = GetRayOrdinaryExtraType( rayId )

 

 

Parameters

rayType (String)

Returned string indicating whether the ray being queried is an ordinary ray or extraordinary ray in the context of the ray's current immersion material. If the ray is not currently immersed in a birefringent material, the return value will be "Ordinary".  Returned strings are either "Ordinary" or "Extraordinary".

 

rayId As Long (or Huge_)

ID number of the ray being queried.  If rayId is invalid (i.e. no ray exists at the specified ID), the function will halt with an error.

 

 

Example

The example below demonstrates a simple script that queries two rays in the buffer for their wave vectors, ray type (ordinary/extraordinary), and refractive index and reports the information to the output window.

 

Sub Main

 

    ClearOutputWindow()

 

    Dim bWv As Boolean

    Dim wvx As Double, wvy As Double, wvz As Double

    Dim tRay As T_RAY

    Dim rType As String

 

    'Header

    Print "Ray ID" & Chr(9) & "Success?" & Chr(9) & "X-Dir" & Chr(9) & "Y-Dir" & Chr(9) & "Z-Dir" & Chr(9) & "n" & Chr(9) & "Type"

 

    'Query ray #0

    bWv   = GetRayWaveVector( 0, wvx, wvy, wvz )

    rType = GetRayOrdinaryExtraType( 0 )

    GetRay(0, tRay)

 

    'Summary output for ray #0

    Print 0 & Chr(9) & bWv & Chr(9) & wvx & Chr(9) & wvy & Chr(9) & wvz & Chr(9) & tRay.indexref & Chr(9) & rType

 

    'Query ray #1

    bWv   = GetRayWaveVector( 1, wvx, wvy, wvz )

    rType = GetRayOrdinaryExtraType( 1 )

    GetRay(1, tRay)

 

    'Summary output for ray #1

    Print 1 & Chr(9) & bWv & Chr(9) & wvx & Chr(9) & wvy & Chr(9) & wvz & Chr(9) & tRay.indexref & Chr(9) & rType

 

End Sub

 

See Also

Basic Ray Data Script Commands

 

 

 

 

 

Copyright © Photon Engineering, LLC