Description This function queries a ray to see if it is flagged as an Absorbed Ray. 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 isAbsorbed = IsRayAbsorbed( rayIdx )
Parameters isAbsorbed (Boolean) This value is returned by the function. A value of True indicates that the ray type is an absorbed ray.
rayIdx As Long (or Huge_) Index into the ray buffer of the ray whose status is being queried.
Example The example below loops over the ray buffer and accumulates the total power of the absorbed rays found on a surface of interest. The accumulated power is reported to the output window. Sub Main
Dim success As Boolean Dim tRay As T_RAY Dim curRay As Long Dim pAbs As Double
Dim soi As Long soi = FindFullName( "Geometry.Plane.Surface" )
success = GetFirstRay( curRay, tRay ) While success If (tRay.entity = soi) And IsRayAbsorbed( curRay ) Then pAbs += tRay.power End If success = GetNextRay( curRay, tRay ) Wend Print "Surface of interest: " & GetFullName( soi ) Print "Absorbed power: " & pAbs
End Sub
See Also
|