Navigation: Scripting Reference Manual > Functions & Subroutines > ElemAddIdealLens

 

ElemAddIdealLens

 

Contact Us: fredsupport@photonengr.com

 

Description

This function adds a new Ideal Lens type Element Primitive node and returns the node number of the added object.  There are five different ideal lens forms available that are specified by parameter 5 of this element primitive: Simplified Infinite Object (non-Eikonal), Perfect Infinite Object (Eikonal), Perfect Finite Conjugate (Eikonal), Perfect Afocal (Eikonal), Sphere Surface (Eikonal). 

 

Syntax

epNode = ElemAddIdealLens( tEnt )

 

Parameters

epNode (Long)

Node number of the element primitive that was added.

 

tEnt As T_ENTITY

Data structure containing the generic entity information (name, parent, description, etc.) required to add a node to the object tree.

 

Example

The example below shows how to initialize a T_ENTITY structure, add an Ideal Lens type element primitive and then modify the element primitive parameters.  In this example, the Ideal Lens type is the Perfect Infinite Object (Eikonal) and only requires the use of parameter 6 to specify its imaging property (the focal length).  Other Ideal Lens types may require the use of parameters 6 and 7 in order to fully specify the imaging properties of the element primitive.  See the Help topic for ElemSetParmValue for more information.

Sub Main

 

    'Initialize the generic element data

    Dim tEnt As T_ENTITY

    InitEntity( tEnt )

    tEnt.name   = "EP Ideal Lens"

    tEnt.parent = 2 'Geometry folder

 

    'Create the element primitive node

    Dim epNode As Long

    epNode = ElemAddIdealLens( tEnt )

 

    'Modify the element primitive parameters

    ElemSetParmValue( epNode, 0, 12.7 ) 'X semi-aperture

    ElemSetParmValue( epNode, 1, 12.7 ) 'Y semi-aperture

    ElemSetParmValue( epNode, 2, 0 )    'Hole X semi-aperture

    ElemSetParmValue( epNode, 3, 0 )    'Hole Y semi-aperture

    ElemSetParmValue( epNode, 4, 1 )    'Aperture shape: 0 - rectangular/square, 1 - elliptical/circular

    ElemSetParmValue( epNode, 5, 1 )    'Lens module type: 1 = Perfect Infinite Object (Eikonal)

    ElemSetParmValue( epNode, 6, 100 )  'Focal length

 

    'Lens module type parameter options:

    '0 - Simplified Infinite Object (non-Eikonal)

    '1 - Perfect Infinite Object (Eikonal)

    '2 - Perfect Finite Conjugate (Eikonal)

    '3 - Perfect Afocal (Eikonal)

    '4 - Sphere Surface (Eikonal)

 

    'Update the model

    Update

 

End Sub

 

See Also

 

T_ENTITY

Element Primitive Script Commands

Element Composite (boolean) Script Commands

Surface Module

Lens Module

 

 

 

 

 

 

Copyright © Photon Engineering, LLC