Navigation: Scripting Reference Manual > Functions & Subroutines > AddSampledMaterial

 

AddSampledMaterial

 

Contact Us: fredsupport@photonengr.com

 

Description

Adds a new Sampled glass Material to the associated FRED document.

 

Syntax

id = AddSampledMaterial ( sampledMat, wavlens, reals, imags )

 

Parameters

id (Long)

Identifier of the new material.

 

sampledMat As T_SAMPLEDMATERIAL

Structure containing generic material data for the new material.

 

wavlens() As Double

Array containing wavelengths for the material's sample points.

 

reals() As Double

Array containing refractive indices corresponding to each wavelength contained in the wavlens array.

 

imags() As Double

Array containing imaginary component of the refractive indices corresponding to each wavelength contained in the wavlens array.

 

Remarks

This function adds a new Sampled Material to the associated FRED document and returns the identifier for the new material.  If it fails, it posts an error and returns a value of -1.

 

The arrays wavlens, reals, and imags must all have the same number of elements.

 

The message: "Error: Array argument not correct (or not an array)" will be displayed in the event that either a wavelength value in the wavelens() array or an index value in the reals() array is zero.

 

The imaginary component of the refractive index k is directly proportional to the absorption (or gain) coefficient at the associated wavelength via the formula  a = ( 4p k / l ) where a is the absorption coefficient, l is the wavelength and k is the imaginary part of the refractive index at that wavelength.  Absorption is specified with a positive value, no absorption is specified with a value of zero, and gain may be specified with a negative value.

 

See Also

T_SAMPLEDMATERIAL

GetSampledMaterial

SetSampledMaterial

Examples

Materials

 

 

 

 

 

Copyright © Photon Engineering, LLC