Lucan-1.2.0
Safe HaskellNone
LanguageHaskell2010

Lucan

Synopsis

Functions

Data.Export

exportParts :: Double -> Box -> File -> [Part] -> IO () #

Exports parts for use in external CAD programs.

Parameters:

  • Double: Resolution in millimeters of a point sampling on the parts surfaces
  • Box: Bounding box with dimensions in millimeters that encloses the parts
  • File: Output file. Note that non-existent subdirectories of the path will be created and an existing file with the same name will be overwritten. The following formats are supported:

    • FileDSV: Sampled 3d points on the parts surfaces that are inside the bounding box are saved in a text file as delimiter separated values. The points are given in the global coordinate system. There is no separation between different parts in the exported file. Quantities must be named with "x", "y" and "z" and the quantity unit must be of base unit Meter.
    • FileSTP: Step file where parts are exported in their boundary representation. The part surfaces are stored in analytical form and the edges at surface intersections are stored as precisely calculated spline curves. A resolution around 0.001 times the bounding box diameter usually works fine. It can be decreased for parts with closely adjacent vertices or edges, but there are limitations due to longer computation times. You can also use a tighter bounding box on particular parts and export them separately. Please note that some CAD softwares can have problems with the STEP import. It was observed that sometimes the wrong side of a surface is clipped or revolved surfaces such as paraboloids are missing. There are two testfiles 'TestParts.stp' and 'FirstLens.stp' in the examples folder to test the import capabilities of other programs.
  • [Part]: Parts to export
  • IO (): Returned IO action

Example:

main :: IO ()
main = do
    let parts = undefined
    let box = undefined

    -- export as DSV:
    let resolution = 0.01 * calcBoxDiameter box
    let partsFileDSV = FileDSV
            { fdsvPath = "./partsExport.dsv"
            , fdsvDelimiter = ' '
            , fdsvQuantities =
                [ Quantity {qName = "x", qUnit = Meter 0.001}
                , Quantity {qName = "y", qUnit = Meter 0.001}
                , Quantity {qName = "z", qUnit = Meter 0.001}
                ]
            }
    exportParts resolution box partsFileDSV parts

    -- export as STP:
    let resolution = 0.001 * calcBoxDiameter box
    let partsFileSTP = FileSTP { fstpPath = "./partsExport.stp" }
    exportParts resolution box partsFileSTP parts

Available in: Pro

exportSellmeierCatalog :: File -> SellmeierCatalog -> IO () #

Exports a SellmeierCatalog. Note that non-existent subdirectories of the path will be created and an existing file with the same name will be overwritten.

Parameters:

  • File: Output file with the following formats supported:

    • FileHS: Haskell file. Note that the module name must be entered manually at the beginning of the exported file so that the file can be imported by other scripts. The module name must be of alphanumeric characters, starts with an uppercase letter and corresponds to the directory in which the file is stored.
  • SellmeierCatalog: SellmeierCatalog with SellmeierCoefficients.
  • IO (): Returned IO action

Available in: Base | Pro

Data.Import

importRays :: Material -> File -> IO [Ray] #

Import of rays from a rayfile with sets of raydata, also known as raysets. Each rayset must provide full single ray data, which means it includes origin, direction, wavelength and flux for each ray. The flux can be specified either radiometrically in watts or photometrically in lumens. In the Ray datatype, however, the flux is exclusively defined radiometrically. Therefore, when specifying the flux in lumens, a conversion to watts is performed via the photopic luminous efficiency function defined in CIE1924/CIE1931.

Rayfiles can be provided in various formats by light source manufacturers.

Parameters:

  • Material: The information about the material of the ray origins are usually not provided in rayfiles but is needed to create rays. This parameter is used to assign the same material to all rays.
  • File: Rayfile with one of the following constructors:

    • FileLEF: Constructor for a binary file with full ray data
  • IO [Ray]: Returned rays in an IO action

The example shows how rays could be imported with the appropriate file specification.

Example:

main :: IO ()
main = do
    -- Import Rays for Speos ray file:
    let material = undefined
    let rayFileSpeos = FileLEF
            { flefPath = undefined
            , flefHeaderSize = 28
            , flefQuantities =
                [ Quantity "originX" (Meter 1e-3)
                , Quantity "originY" (Meter 1e-3)
                , Quantity "originZ" (Meter 1e-3)
                , Quantity "directionX" (Meter 1e-3)
                , Quantity "directionY" (Meter 1e-3)
                , Quantity "directionZ" (Meter 1e-3)
                , Quantity "wavelength" (Meter 1e-9)
                , Quantity "flux" (Lumen 1)]
            }
    rays <- importRays material rayFileSpeos

Available in: Base | Pro

importRays2 :: Material -> File -> File -> IO [Ray] #

Import of rays from a rayfile with sets of raydata, also known as raysets. Each rayset must provide standard single ray data, which means it includes origin, direction and flux for each ray. The flux can be specified either radiometrically in watts or photometrically in lumens (see explanation in importRays). Wavelength information is provided by a second file which contains a spectrum. Wavelengths for the rays are sampled according to a probability distribution derived from the spectrum. The spectrum intensities can have an arbitrary unit since they are normalized when the distribution is calculated.

Rayfiles and spectrum files can be provided in various formats by light source manufacturers.

Parameters:

  • Material: The information about the material of the ray origins are usually not provided in rayfiles but is needed to create rays. This parameter is used to assign the same material to all rays.
  • File: Spectrum file specified by one of the following constructors:

    • FileDSV: Constructor for a text file with spectrum data
  • File: Rayfile specified by one of the following constructors:

    • FileDSV: Constructor for a text file with standard ray data.
    • FileLEF: Constructor for a binary file with standard ray data.
  • IO [Ray]: Returned rays in an IO action

The example shows how rays could be imported with the appropriate file specification. Note that for some formats, the rayfile specification is not always unique. This means that the quantities must be defined according to information from the rayfile provider.

Example:

main :: IO ()
main = do
    -- Import Rays for ASCII spectrum file and ASAP ray file:
    let material = undefined
    let spectrumFile = FileDSV
            { fdsvPath = undefined
            , fdsvDelimiter = '\t'
            , fdsvQuantities =
                [ Quantity "wavelength" (Meter 1e-9)
                , Quantity "intensity" (One 1) ]
            }
    let rayFile = FileLEF
            { flefPath = undefined
            , flefHeaderSize = 140
            , flefQuantities =
                [ Quantity "originX" (Meter 1e-3)
                , Quantity "originY" (Meter 1e-3)
                , Quantity "originZ" (Meter 1e-3)
                , Quantity "directionX" (Meter 1e-3)
                , Quantity "directionY" (Meter 1e-3)
                , Quantity "directionZ" (Meter 1e-3)
                , Quantity "flux" (Lumen 1)]
            }
    raysASAP <- importRays2 material spectrumFile rayFile

    -------------------------------------------------------

    -- Import Rays for ASCII spectrum file and ASCII ray file:
    let material = undefined
    let spectrumFile = FileDSV
            { fdsvPath = undefined
            , fdsvDelimiter = '\t'
            , fdsvQuantities =
                [ Quantity "wavelength" (Meter 1e-9)
                , Quantity "intensity" (One 1) ]
            }
    let rayFile = FileDSV
            { fdsvPath = undefined
            , fdsvDelimiter = ' '
            , fdsvQuantities =
                [ Quantity "originX" (Meter 1e-3)
                , Quantity "originY" (Meter 1e-3)
                , Quantity "originZ" (Meter 1e-3)
                , Quantity "directionX" (Meter 1e-3)
                , Quantity "directionY" (Meter 1e-3)
                , Quantity "directionZ" (Meter 1e-3)
                , Quantity "flux" (Lumen 1)]
            }
    raysASCII <- importRays2 material spectrumFile rayFile

    -------------------------------------------------------

    -- Import Rays for ASCII spectrum file and LucidShape ray file:
    let material = undefined
    let spectrumFile = FileDSV
            { fdsvPath = undefined
            , fdsvDelimiter = '\t'
            , fdsvQuantities =
                [ Quantity "wavelength" (Meter 1e-9)
                , Quantity "intensity" (One 1) ]
            }
    let rayFile = FileLEF
            { flefPath = undefined
            , flefHeaderSize = 28
            , flefQuantities =
                [ Quantity "originX" (Meter 1e-3)
                , Quantity "originY" (Meter 1e-3)
                , Quantity "originZ" (Meter 1e-3)
                , Quantity "directionX" (Meter 1e-3)
                , Quantity "directionY" (Meter 1e-3)
                , Quantity "directionZ" (Meter 1e-3)
                , Quantity "flux" (Lumen 1)]
            }
    raysLucidShape <- importRays2 material spectrumFile rayFile

    -------------------------------------------------------

    -- Import Rays for ASCII spectrum file and Photopia ray file:
    let material = undefined
    let spectrumFile = FileDSV
            { fdsvPath = undefined
            , fdsvDelimiter = '\t'
            , fdsvQuantities =
                [ Quantity "wavelength" (Meter 1e-9)
                , Quantity "intensity" (One 1) ]
            }
    let rayFile = FileLEF
            { flefPath = undefined
            , flefHeaderSize = 208
            , flefQuantities =
                [ Quantity "originX" (Meter 1e-3)
                , Quantity "originY" (Meter 1e-3)
                , Quantity "originZ" (Meter 1e-3)
                , Quantity "directionX" (Meter 1e-3)
                , Quantity "directionY" (Meter 1e-3)
                , Quantity "directionZ" (Meter 1e-3)
                , Quantity "flux" (Lumen 1)]
            }
    raysPhotopia <- importRays2 material spectrumFile rayFile

    -------------------------------------------------------

    -- Import Rays for ASCII spectrum file and TraceProBinary ray file:
    let material = undefined
    let spectrumFile = FileDSV
            { fdsvPath = undefined
            , fdsvDelimiter = '\t'
            , fdsvQuantities =
                [ Quantity "wavelength" (Meter 1e-9)
                , Quantity "intensity" (One 1) ]
            }
    let rayFile = FileLEF
            { flefPath = undefined
            , flefHeaderSize = 208
            , flefQuantities =
                [ Quantity "originX" (Meter 1e-3)
                , Quantity "originY" (Meter 1e-3)
                , Quantity "originZ" (Meter 1e-3)
                , Quantity "directionX" (Meter 1e-3)
                , Quantity "directionY" (Meter 1e-3)
                , Quantity "directionZ" (Meter 1e-3)
                , Quantity "flux" (Lumen 1)]
            }
    raysTraceProBinary <- importRays2 material spectrumFile rayFile

    -------------------------------------------------------

    -- Import Rays for ASCII spectrum file and TraceProText ray file:
    let material = undefined
    let spectrumFile = FileDSV
            { fdsvPath = undefined
            , fdsvDelimiter = '\t'
            , fdsvQuantities =
                [ Quantity "wavelength" (Meter 1e-9)
                , Quantity "intensity" (One 1) ]
            }
    let rayFile = FileDSV
            { fdsvPath = undefined
            , fdsvDelimiter = ' '
            , fdsvQuantities =
                [ Quantity "originX" (Meter 1e-3)
                , Quantity "originY" (Meter 1e-3)
                , Quantity "originZ" (Meter 1e-3)
                , Quantity "directionX" (Meter 1e-3)
                , Quantity "directionY" (Meter 1e-3)
                , Quantity "directionZ" (Meter 1e-3)
                , Quantity "flux" (Lumen 1)]
            }
    raysTraceProText <- importRays2 material spectrumFile rayFile

    -------------------------------------------------------

    -- Import Rays for ASCII spectrum file and Zemax ray file:
    let material = undefined
    let spectrumFile = FileDSV
            { fdsvPath = undefined
            , fdsvDelimiter = '\t'
            , fdsvQuantities =
                [ Quantity "wavelength" (Meter 1e-6)
                , Quantity "intensity" (One 1) ]
            }
    let rayFile = FileLEF
            { flefPath = undefined
            , flefHeaderSize = 208
            , flefQuantities =
                [ Quantity "originX" (Meter 1e-3)
                , Quantity "originY" (Meter 1e-3)
                , Quantity "originZ" (Meter 1e-3)
                , Quantity "directionX" (Meter 1e-3)
                , Quantity "directionY" (Meter 1e-3)
                , Quantity "directionZ" (Meter 1e-3)
                , Quantity "flux" (Lumen 1)]
            }
    raysZemax <- importRays2 material spectrumFile rayFile

Available in: Base | Pro

importSpectrum :: File -> IO Spectrum #

Import a spectrum from a spectrum file, which contains intensities in an arbitrary unit for a range of wavelengths. Spectrum files can be provided by light source manufactures.

Parameters:

  • File: Spectrum file specified by one of the following constructors:

    • FileDSV: Constructor for a text file with spectrum data
  • IO Spectrum: Returned spectrum in an IO action

The example shows how a spectrum could be imported.

Example:

main :: IO ()
main = do
    let spectrumFile = FileDSV
            { fdsvPath = undefined
            , fdsvDelimiter = '\t'
            , fdsvQuantities =
                [ Quantity "wavelength" (Meter 1e-9)
                , Quantity "intensity" (One 1) ]
            }
   spectrum <- importSpectrum spectrumFile

Available in: Base | Pro

importSellmeierCatalog :: File -> IO SellmeierCatalog #

Import a SellmeierCatalog from a file with material data. Note that after importing a SellmeierCatalog it should be exported again as FileHS. This way it can be imported as a module by other scripts.

Parameters:

  • File: File specified by one of the following constructors:

    • FileAGF: Constructor for a AGF file with material data
  • IO SellmeierCatalog: Returned SellmeierCatalog in an IO action

Example:

main :: IO ()
main = do
    let materialFileIn = FileAGF {fagfPath = undefined}
    sellmeierCatalog <- importSellmeierCatalog materialFileIn
    let materialFileOut = FileHS {fhsPath = undefined}
    exportSellmeierCatalog materialFileOut sellmeierCatalog

Available in: Base | Pro

Graphics.View

initView :: Orientation -> Box -> V2 Int -> V2 Int -> IO View #

This function initializes a new view in which graphic content can be visualized.

Parameters:

  • Orientation: This pair of axes define the orientation of the world coordinate system in the view. The first axis will point to the screen right and the second axis to the screen top. The direction of the third axis is perpendicular to the screen, so that the right-handedness of the coordinate system is preserved.
  • Box: Bounding box of the volume to be displayed with context-dependent unit of length
  • V2 Int: View position on screen in pixel
  • V2 Int: View size in pixel
  • IO View: Returned view in an IO action

Example:

view <- initView XY ((20,20),(20,20),(20,20)) (100,100) (800,600)

Available in: Free | Base | Pro

setViewRulers :: View -> IO () #

Sets the rulers of a view to active state. The rulers update based on the zoom, pan and rotation of the view.

Available in: Free | Base | Pro

setViewMatrix :: View -> M44 Double -> IO () #

Changes the view on the scene by setting the view matrix. The matrix is of the form 4x4 with a 3x3 rotation submatrix on the top left, a 3x1 translation vector on the top right and the 1x4 unit vector with 1 in the fourth component.

Available in: Free | Base | Pro

addViewText :: View -> V2 Int -> Double -> Double -> String -> IO () #

Adds text to a view for display.

Parameters:

  • View: View on which is displayed.
  • V2 Int: Position in pixels of the top left corner of the text in readable orientation
  • Double: Angle in degrees by which to rotate the text
  • Double: Font size in pixels
  • String: Text to display

Available in: Free | Base | Pro

addViewBox :: View -> Box -> IO () #

Add a box as a wireframe model to a view for display.

Parameters:

  • View: View on which is displayed.
  • Box: Box to display with context-dependent unit of length

Available in: Free | Base | Pro

addViewAxes :: View -> Axes -> IO () #

Add axes to a view for display.

Parameters:

  • View: View on which is displayed
  • Axes: Axes to display
  • IO (): Returned IO action

Available in: Free | Base | Pro

addViewPoint :: View -> Double -> V3 Double -> IO () #

Add a point to a view for display.

Parameters:

  • View: View on which is displayed
  • Double: Point size in pixels
  • V3 Double: Coordinates of the point to display in unit of measurement depending on the context
  • IO (): Returned IO action

Available in: Free | Base | Pro

addViewPoints :: View -> Double -> [V3 Double] -> IO () #

Add points to a view for display.

Parameters:

  • View: View on which is displayed
  • Double: Point size in pixels
  • [V3 Double]: Coordinates of the points to display in unit of measurement depending on the context
  • IO (): Returned IO action

Available in: Free | Base | Pro

addViewLineSegment :: View -> M23 Double -> IO () #

Add a line segment to a view for display.

Parameters:

  • View: View on which is displayed
  • M23 Double: Point pair coordinates in unit of measurement depending on the context
  • IO (): Returned IO action

Available in: Free | Base | Pro

addViewLineSegments :: View -> [M23 Double] -> IO () #

Add line segments to a view for display.

Parameters:

  • View: View on which is displayed
  • [M23 Double]: Point pairs coordinates in unit of measurement depending on the context
  • IO (): Returned IO action

Available in: Free | Base | Pro

addViewPart :: View -> Part -> IO () #

Add a part to a view for display.

Parameters:

  • View: View on which is displayed
  • Part: Part to display
  • IO (): Returned IO action

Available in: Free | Base | Pro

addViewParts :: View -> [Part] -> IO () #

Add parts to a view for display.

Parameters:

  • View: View on which is displayed
  • [Part]: Parts to display
  • IO (): Returned IO action

Available in: Free | Base | Pro

addViewRay :: View -> Ray -> IO () #

Add a single ray to a view for display.

Parameters:

  • View: View on which is displayed
  • Ray: Ray to display
  • IO (): Returned IO action

Available in: Free | Base | Pro

addViewRays :: View -> [Ray] -> IO () #

Add multiple rays to a view for display.

Parameters:

  • View: View on which is displayed
  • [Ray]: Rays to display
  • IO (): Returned IO action

Available in: Free | Base | Pro

addViewRaytrace :: View -> Raytrace -> IO () #

Add a single raytrace to a view for display.

Parameters:

  • View: View on which is displayed
  • Raytrace: Raytrace to display
  • IO (): Returned IO action

Available in: Free | Base | Pro

addViewRaytraces :: View -> [Raytrace] -> IO () #

Add multiple raytraces to a view for display.

Parameters:

  • View: View on which is displayed
  • [Raytrace]: Raytraces to display
  • IO (): Returned IO action

Available in: Free | Base | Pro

createViewSpotDiagram :: V2 Int -> V2 Int -> Double -> Double -> String -> Spot -> IO View #

Creates a view with a spot diagram.

Parameters:

  • V2 Int: View position on screen in pixel
  • V2 Int: View size in pixel
  • Double: Font size of text annotations
  • Double: Point size of spot points
  • String: Title
  • Spot: Spot to display
  • IO View: Returned view in an IO action

Available in: Base | Pro

runView :: View -> IO () #

Shows a view and runs its renderloop. During the renderloop the following user interactions could be triggerd with mouse and keyboard events:

  • pan: Press the right mouse button and move the cursor
  • zoom: Press the right mouse button and scroll mouse-wheel
  • xy-Rotation: Press left mouse button and move the cursor
  • z-Rotation: Move the mouse cursor to the center of rotation, press the left and right mouse button, move the cursor away from the center and then sideways
  • redraw: The parts are rendered as a pointcloud. This pointcloud can be recalculated and redrawed for different sights after a navigation. You can trigger a redraw with the Space key
  • close: Close the view window with the ESC key or ALT+F4 keys

Available in: Free | Base | Pro

runViews :: [View] -> IO () #

Shows multiple views and runs their mainloops. The same user interactions as described in runView are accepted for each of them.

Available in: Free | Base | Pro

Math.Line

calcConicalLines2d :: Double -> Int -> [Line] #

Calculates a list of equally distributed lines in a 2d conical area in the xy plane. All lines have the same origin (0,0,0) and the central direction of the conical area is (1,0,0).

Parameters:

  • Double: Aperture angle of the lines in degrees
  • Int: Number of lines
  • [Line]: Resulting lines

Example:

lines = calcConicalLines2d 15 10

Available in: Free | Base | Pro

calcConicalLines3d :: Double -> Int -> [Line] #

Calculates a list of equally distributed lines in a 3d conical area. All lines have the same origin (0,0,0) and the central direction of the conical area is (1,0,0).

Parameters:

  • Double: Aperture angle of the lines in degrees
  • Int: Number of lines
  • [Line]: Resulting lines

Example:

lines = calcConicalLines3d 15 200

Available in: Free | Base | Pro

calcParallelLines2d :: Double -> Int -> [Line] #

Calculates a list of equally distributed parallel lines in xy plane. The origin of the beam center is at (0,0,0) and all lines point in the direction (1,0,0).

Parameters:

  • Double: Lines width
  • Int: Number of lines
  • [Line]: Resulting lines

Available in: Free | Base | Pro

calcParallelLines3d :: Double -> Int -> [Line] #

Calculates a list of equally distributed parallel lines with circular profile. The origin of the beam center is at (0,0,0) and all lines point in the direction (1,0,0).

Parameters:

  • Double: Lines width (circle diameter)
  • Int: Number of lines
  • [Line]: Resulting lines

Available in: Free | Base | Pro

Math.Transform

calcRotation :: AngleUnit -> V3 Double -> M33 Double #

Calculates a 3d rotation matrix from Euler-Cardan angles.

Parameters:

  • AngleUnit: Unit of angles
  • V3 Double: Euler-Cardan angles \( (\alpha, \beta, \gamma) \). The rotation matrix is defined as: \( R = R_z(\gamma) \cdot R_y(\beta) \cdot R_x(\alpha) \), where:

\[ R_x(\alpha) = \begin{pmatrix} 1 & 0 & 0 \\ 0 & \cos \alpha & -\sin \alpha \\ 0 & \sin \alpha & \cos \alpha \end{pmatrix} \] \[ R_y(\beta) = \begin{pmatrix} \cos \beta & 0 & \sin \beta \\ 0 & 1 & 0 \\ -\sin \beta & 0 & \cos \beta \end{pmatrix} \] \[ R_z(\gamma) = \begin{pmatrix} \cos \gamma & -\sin \gamma & 0 \\ \sin \gamma & \cos \gamma & 0 \\ 0 & 0 & 1 \end{pmatrix} \]

  • M33 Double: Resulting rotation matrix

Available in: Free | Base | Pro

calcRotation2 :: M23 Double -> M33 Double #

Calculates a 3d rotation matrix from two vectors.

Parameters:

  • M23 Double: Two 3d vectors (v1,v2) to define the rotation matrix. Usually the rotated first two unit vectors in x- and y-direction are specified here, which correspond to the first two rows of the transposed rotation matrix. However, the vectors can be kept more general: The first vector points in positive direction of the rotated x-axis. The second vector is any vector in the rotated xy-plane, where its dot product with the vector along the rotated y-axis must be positive.
  • M33 Double: Resulting rotation matrix

Available in: Free | Base | Pro

calcTransformation :: V3 Double -> V3 Double -> Transformation #

Calculates an transformation object with rotation from Euler-Cardan angles.

Parameters:

  • V3 Double: Euler-Cardan angles, see explanation in calcRotation
  • V3 Double: Location
  • Transformation: Resulting transformation

Available in: Free | Base | Pro

calcTransformation2 :: M23 Double -> V3 Double -> Transformation #

Calculates an transformation object with rotation from two vectors.

Parameters:

  • M23 Double: Two 3d vectors, see explanation in calcRotation2
  • V3 Double: Location
  • Transformation: Resulting transformation

Available in: Free | Base | Pro

Math.Util

infinity :: Double #

Infinity is larger than any real number. Here it is defined as 1/0.

Available in: Free | Base | Pro

epsilon :: Double #

Epsilon is the approximation to machine epsilon, which is at 2.220446049250313e-16 for double precision (64-bit). This value can be used in direct or derived form (depending on the context) for algorithms that require a small positive tolerance.

Available in: Free | Base | Pro

calcBoxDiameter :: Box -> Double #

Calculates the diameter of a box.

Available in: Free | Base | Pro

Model.Analyze

calcSpot :: Double -> Transformation -> System -> [Ray] -> Spot #

Computes the spot of rays traced through an optical system at a given analysis plane. The spot can be viewed in a spot diagram with createViewSpotDiagram.

Parameters:

  • Double: Radius in millimeters of a circle around the plane local coordinate system origin in which all raypoints must lie, see also Spot.
  • Transformation: Transformation defining the local coordinate system of the analysis plane, see also Spot
  • System: System to be analyzed
  • [Ray]: Rays traced through the system. They usually originate from a single point at a finite or infinite distance.
  • Spot: Computed spot

Available in: Base | Pro

Model.Material

getSellmeierCoefficients :: SellmeierCatalog -> String -> SellmeierCoefficients #

Retrieves the SellmeierCoefficients from SellmeierCatalog by the materials name.

Parameters:

  • SellmeierCatalog: Catalog with SellmeierCoefficients for materials
  • String: Material name
  • SellmeierCoefficients: Retrieved SellmeierCoefficients

Available in: Free | Base | Pro

Model.Part

isPointInsidePart :: Part -> V3 Double -> Bool #

Tests whether a point is inside a part.

Parameters:

  • Part: Part
  • V3 Double: Point
  • Bool: Boolean return value

Available in: Base | Pro

Model.Ray

calcRays :: Double -> Double -> Material -> Transformation -> [Line] -> [Ray] #

Calculates rays from a list of lines. The transformation parameter is used to first rotate the lines as you like and then translate them to an arbitrary location. The rays are all assigned the same wavelength and material. Be careful with this function as all ray origins should lie within a part of the same material that is assigned. Note that lines can be calculated using the functions from Math.Line.

Parameters:

  • Double: Wavelength of the rays light in vacuum in micrometers.
  • Double: Total radiant flux for all rays.
  • Material: Assigned material where the orgins lie in.
  • Transformation: Transformation that defines the rays placement.
  • [Line]: List of lines.
  • [Ray]: List of resulting rays.

Available in: Free | Base | Pro

Model.Raytrace

traceRay :: System -> Ray -> Raytrace #

This function traces a single ray through a system. The raytrace ends when the source ray or any deflected ray of the raytrace is absorbed or has no more next intersection. Note that for unbounded parts of the system (e.g. unbounded cylinders), an infinite raytrace can occur, resulting in infinite runtime. To prevent this, it is recommended to define an absorbing part that is hollow inside and encloses all other parts and the ray origin. At its simplest, this could be a part with with a reversed sphere as its only surface.

Parameters:

  • System: System through which the ray is traced
  • Ray: Ray to be traced
  • Raytrace: Resulting raytrace

Available in: Free | Base | Pro

traceRays :: System -> [Ray] -> [Raytrace] #

Raytracing of multiple rays through a system. The same rules as are described in traceRay apply to each single ray.

Parameters:

  • System: System through which rays are traced
  • [Ray]: Rays to be traced
  • [Raytrace]: Resulting raytraces, one for each ray

Available in: Free | Base | Pro

Types

Data.Types

data File #

Datatype for different file formats.

Constructors

FileHS

Haskell File

Fields

FileSTP

STEP File for CAD data exchange

Fields

FileDSV

Text file with delimiter separated values. Comment lines begin with the character '#'.

Fields

FileLEF

Binary file with little endian float values saved as rows defiend by Quantities.

Fields

FileAGF

Text file with material data (ASCII glass format)

Fields

Instances

Instances details
Eq File # 
Instance details

Defined in Lucan.Data.Types

Methods

(==) :: File -> File -> Bool #

(/=) :: File -> File -> Bool #

Show File # 
Instance details

Defined in Lucan.Data.Types

Methods

showsPrec :: Int -> File -> ShowS #

show :: File -> String #

showList :: [File] -> ShowS #

data Frame a #

Data frame for homogenous data of the same arbitrary type.

Constructors

Frame 

Fields

  • fQuantities :: [Quantity]

    Quantities that describe the frame data

  • fRows :: [[a]]

    Nested list with the frame data. Each inner list contains the values corresponding to the quantities.

Instances

Instances details
Eq a => Eq (Frame a) # 
Instance details

Defined in Lucan.Data.Types

Methods

(==) :: Frame a -> Frame a -> Bool #

(/=) :: Frame a -> Frame a -> Bool #

Show a => Show (Frame a) # 
Instance details

Defined in Lucan.Data.Types

Methods

showsPrec :: Int -> Frame a -> ShowS #

show :: Frame a -> String #

showList :: [Frame a] -> ShowS #

data Quantity #

A Quantity can be either a dimensionless or a physical quantity, depending on the unit.

Constructors

Quantity 

Fields

Instances

Instances details
Eq Quantity # 
Instance details

Defined in Lucan.Data.Types

Ord Quantity # 
Instance details

Defined in Lucan.Data.Types

Show Quantity # 
Instance details

Defined in Lucan.Data.Types

data Unit #

Units of measurement with a multiplier, e.g. millimeter = Meter 0.001

Constructors

One Double

Unit of measurement of one (dimensionless unit)

Meter Double

SI base unit of length

Watt Double

SI derived unit of radiant flux (power)

Lumen Double

SI derived unit of luminous flux

SquareMeter Double 

Instances

Instances details
Eq Unit # 
Instance details

Defined in Lucan.Data.Types

Methods

(==) :: Unit -> Unit -> Bool #

(/=) :: Unit -> Unit -> Bool #

Ord Unit # 
Instance details

Defined in Lucan.Data.Types

Methods

compare :: Unit -> Unit -> Ordering #

(<) :: Unit -> Unit -> Bool #

(<=) :: Unit -> Unit -> Bool #

(>) :: Unit -> Unit -> Bool #

(>=) :: Unit -> Unit -> Bool #

max :: Unit -> Unit -> Unit #

min :: Unit -> Unit -> Unit #

Show Unit # 
Instance details

Defined in Lucan.Data.Types

Methods

showsPrec :: Int -> Unit -> ShowS #

show :: Unit -> String #

showList :: [Unit] -> ShowS #

Graphics.Types

data Axes #

The Axes datatype is used to visualize a right handed cartesian coordinate system relative to the global coordinate system.

Constructors

Axes 

Fields

  • aLength :: Double

    Length in unit of measurement depending on the context

  • aTransformation :: Transformation

    Transformation of the coordinate system, where the columns of the rotation matrix correspond to the directions of the system axes and the translation vector given in context-dependent units of measurement defines the location of the coordinate system.

Instances

Instances details
Eq Axes # 
Instance details

Defined in Lucan.Graphics.Types

Methods

(==) :: Axes -> Axes -> Bool #

(/=) :: Axes -> Axes -> Bool #

Show Axes # 
Instance details

Defined in Lucan.Graphics.Types

Methods

showsPrec :: Int -> Axes -> ShowS #

show :: Axes -> String #

showList :: [Axes] -> ShowS #

Math.Types

data Transformation #

Datatype for a proper rigid transformation, which is the combination of a rotation matrix that preserves handedness and a translation vector.

Constructors

Transformation 

Fields

Instances

Instances details
Eq Transformation # 
Instance details

Defined in Lucan.Math.Types

Show Transformation # 
Instance details

Defined in Lucan.Math.Types

data Shape #

Sum type of all geometric surface shapes.

Instances

Instances details
Eq Shape # 
Instance details

Defined in Lucan.Math.Types

Methods

(==) :: Shape -> Shape -> Bool #

(/=) :: Shape -> Shape -> Bool #

Show Shape # 
Instance details

Defined in Lucan.Math.Types

Methods

showsPrec :: Int -> Shape -> ShowS #

show :: Shape -> String #

showList :: [Shape] -> ShowS #

data Sphere #

Arbitrary sphere: \[ F(x,y,z) = (x-P_x)^2 + (y-P_y)^2 + (z-P_z)^2 - R^2 = 0 \]

Constructors

Sphere 

Fields

Instances

Instances details
Eq Sphere # 
Instance details

Defined in Lucan.Math.Types

Methods

(==) :: Sphere -> Sphere -> Bool #

(/=) :: Sphere -> Sphere -> Bool #

Show Sphere # 
Instance details

Defined in Lucan.Math.Types

data SpherePx #

Sphere with center on x-axis: \[ F(x,y,z) = (x-P_x)^2 + y^2 + z^2 - R^2 = 0\]

Constructors

SpherePx 

Fields

Instances

Instances details
Eq SpherePx # 
Instance details

Defined in Lucan.Math.Types

Show SpherePx # 
Instance details

Defined in Lucan.Math.Types

data SpherePy #

Sphere with center on y-axis: \[ F(x,y,z) = x^2 + (y-P_y)^2 + z^2 - R^2 = 0\]

Constructors

SpherePy 

Fields

Instances

Instances details
Eq SpherePy # 
Instance details

Defined in Lucan.Math.Types

Show SpherePy # 
Instance details

Defined in Lucan.Math.Types

data SpherePz #

Sphere with center on z-axis: \[ F(x,y,z) = x^2 + y^2 + (z-P_z)^2 - R^2 = 0\]

Constructors

SpherePz 

Fields

Instances

Instances details
Eq SpherePz # 
Instance details

Defined in Lucan.Math.Types

Show SpherePz # 
Instance details

Defined in Lucan.Math.Types

data Plane #

Arbitrary plane: \[ F(x,y,z) = A x + B y + C z - D = 0 \] \( (A,B,C)^T \) is the normal vector of the plane. If the normal vector has unit length, then the absolute value of \( D \) is the distance to the coordinate origin \( (0,0,0)^T \).

Constructors

Plane 

Fields

Instances

Instances details
Eq Plane # 
Instance details

Defined in Lucan.Math.Types

Methods

(==) :: Plane -> Plane -> Bool #

(/=) :: Plane -> Plane -> Bool #

Show Plane # 
Instance details

Defined in Lucan.Math.Types

Methods

showsPrec :: Int -> Plane -> ShowS #

show :: Plane -> String #

showList :: [Plane] -> ShowS #

data PlaneDx #

Plane with normal vector in direction of x-axis: \[ F(x,y,z) = x - D = 0 \]

Constructors

PlaneDx 

Fields

Instances

Instances details
Eq PlaneDx # 
Instance details

Defined in Lucan.Math.Types

Methods

(==) :: PlaneDx -> PlaneDx -> Bool #

(/=) :: PlaneDx -> PlaneDx -> Bool #

Show PlaneDx # 
Instance details

Defined in Lucan.Math.Types

data PlaneDy #

Plane with normal vector in direction of y-axis: \[ F(x,y,z) = y - D = 0\]

Constructors

PlaneDy 

Fields

Instances

Instances details
Eq PlaneDy # 
Instance details

Defined in Lucan.Math.Types

Methods

(==) :: PlaneDy -> PlaneDy -> Bool #

(/=) :: PlaneDy -> PlaneDy -> Bool #

Show PlaneDy # 
Instance details

Defined in Lucan.Math.Types

data PlaneDz #

Plane with normal vector in direction of z-axis: \[ F(x,y,z) = z - D = 0 \]

Constructors

PlaneDz 

Fields

Instances

Instances details
Eq PlaneDz # 
Instance details

Defined in Lucan.Math.Types

Methods

(==) :: PlaneDz -> PlaneDz -> Bool #

(/=) :: PlaneDz -> PlaneDz -> Bool #

Show PlaneDz # 
Instance details

Defined in Lucan.Math.Types

data Cylinder #

Arbitrary cylinder with radius \( R \) and central line defined by a position vector \( P = (P_x,P_y,P_z)^T \) and a direction vector \( D = (D_x,D_y,D_z)^T \): \[ F(x,y,z) = ||X-P||_2^2 - \langle X-P,D_n\rangle^2 - R^2 = 0 \] where: \[X = \begin{pmatrix}x\\y\\z\end{pmatrix}\] \[ D_n = \frac{D}{||D||_2} \]

Constructors

Cylinder 

Fields

Instances

Instances details
Eq Cylinder # 
Instance details

Defined in Lucan.Math.Types

Show Cylinder # 
Instance details

Defined in Lucan.Math.Types

data CylinderDx #

Cylinder with radius \( R \) and x-axis as central line: \[ F(x,y,z) = y^2 + z^2 - R^2 = 0\]

Constructors

CylinderDx 

Fields

Instances

Instances details
Eq CylinderDx # 
Instance details

Defined in Lucan.Math.Types

Show CylinderDx # 
Instance details

Defined in Lucan.Math.Types

data CylinderDy #

Cylinder with radius \( R \) and y-axis as central line: \[ F(x,y,z) = x^2 + z^2 - R^2 = 0\]

Constructors

CylinderDy 

Fields

Instances

Instances details
Eq CylinderDy # 
Instance details

Defined in Lucan.Math.Types

Show CylinderDy # 
Instance details

Defined in Lucan.Math.Types

data CylinderDz #

Cylinder with radius \( R \) and z-axis as central line: \[ F(x,y,z) = x^2 + y^2 - R^2 = 0\]

Constructors

CylinderDz 

Fields

Instances

Instances details
Eq CylinderDz # 
Instance details

Defined in Lucan.Math.Types

Show CylinderDz # 
Instance details

Defined in Lucan.Math.Types

data CylinderPyzDx #

Cylinder with radius \( R \) parallel to x-axis and central going through \( (0,P_y,P_z)^T \): \[ F(x,y,z) = (y-P_y)^2 + (z-P_z)^2 - R^2 = 0\]

Constructors

CylinderPyzDx 

Instances

Instances details
Eq CylinderPyzDx # 
Instance details

Defined in Lucan.Math.Types

Show CylinderPyzDx # 
Instance details

Defined in Lucan.Math.Types

data CylinderPzxDy #

Cylinder with radius \( R \) parallel to y-axis and central going through \( (P_x,0,P_z)^T \): \[ F(x,y,z) = (x-P_x)^2 + (z-P_z)^2 - R^2 = 0\]

Constructors

CylinderPzxDy 

Instances

Instances details
Eq CylinderPzxDy # 
Instance details

Defined in Lucan.Math.Types

Show CylinderPzxDy # 
Instance details

Defined in Lucan.Math.Types

data CylinderPxyDz #

Cylinder with radius \( R \) parallel to z-axis and central going through \( (P_x,P_y,0)^T \): \[ F(x,y,z) = (x-P_x)^2 + (y-P_y)^2 - R^2 = 0\]

Constructors

CylinderPxyDz 

Instances

Instances details
Eq CylinderPxyDz # 
Instance details

Defined in Lucan.Math.Types

Show CylinderPxyDz # 
Instance details

Defined in Lucan.Math.Types

data ParabolPosPxDx #

Paraboloid of revolution with x-axis as central line opened in positive direction and its vertex at \( (P_x,0,0)^T \): \[ F(x,y,z) = -(x-P_x) + \frac{y^2}{A^2} + \frac{z^2}{A^2} = 0\]

Constructors

ParabolPosPxDx 

Fields

Instances

Instances details
Eq ParabolPosPxDx # 
Instance details

Defined in Lucan.Math.Types

Show ParabolPosPxDx # 
Instance details

Defined in Lucan.Math.Types

data ParabolPosPyDy #

Paraboloid of revolution with y-axis as central line opened in positive direction and its vertex at \( (0,P_y,0)^T \): \[ F(x,y,z) = \frac{x^2}{A^2} - (y-P_y) + \frac{z^2}{A^2} = 0\]

Constructors

ParabolPosPyDy 

Fields

Instances

Instances details
Eq ParabolPosPyDy # 
Instance details

Defined in Lucan.Math.Types

Show ParabolPosPyDy # 
Instance details

Defined in Lucan.Math.Types

data ParabolPosPzDz #

Paraboloid of revolution with z-axis as central line opened in positive direction and its vertex at \( (0,0,P_z)^T \): \[ F(x,y,z) = \frac{x^2}{A^2} + \frac{y^2}{A^2} - (z-P_z) = 0\]

Constructors

ParabolPosPzDz 

Fields

Instances

Instances details
Eq ParabolPosPzDz # 
Instance details

Defined in Lucan.Math.Types

Show ParabolPosPzDz # 
Instance details

Defined in Lucan.Math.Types

data ParabolPosPxyzDx #

Paraboloid of revolution opened in positive x-direction with its vertex at \( (P_x,P_y,P_z)^T \): \[ F(x,y,z) = -(x-P_x) + \frac{(y-P_y)^2}{A^2} + \frac{(z-P_z)^2}{A^2} = 0\]

Instances

Instances details
Eq ParabolPosPxyzDx # 
Instance details

Defined in Lucan.Math.Types

Show ParabolPosPxyzDx # 
Instance details

Defined in Lucan.Math.Types

data ParabolPosPxyzDy #

Paraboloid of revolution opened in positive y-direction with its vertex at \( (P_x,P_y,P_z)^T \): \[ F(x,y,z) = \frac{(x-P_x)^2}{A^2} -(y-P_y) + \frac{(z-P_z)^2}{A^2} = 0\]

Instances

Instances details
Eq ParabolPosPxyzDy # 
Instance details

Defined in Lucan.Math.Types

Show ParabolPosPxyzDy # 
Instance details

Defined in Lucan.Math.Types

data ParabolPosPxyzDz #

Paraboloid of revolution opened in positive z-direction with its vertex at \( (P_x,P_y,P_z)^T \): \[ F(x,y,z) = \frac{(x-P_x)^2}{A^2} + \frac{(y-P_y)^2}{A^2} - (z-P_z) = 0\]

Instances

Instances details
Eq ParabolPosPxyzDz # 
Instance details

Defined in Lucan.Math.Types

Show ParabolPosPxyzDz # 
Instance details

Defined in Lucan.Math.Types

data ParabolNegPxDx #

Paraboloid of revolution with x-axis as central line opened in negative direction and its vertex at \( (P_x,0,0)^T \): \[ F(x,y,z) = (x-P_x) + \frac{y^2}{A^2} + \frac{z^2}{A^2} = 0\]

Constructors

ParabolNegPxDx 

Fields

Instances

Instances details
Eq ParabolNegPxDx # 
Instance details

Defined in Lucan.Math.Types

Show ParabolNegPxDx # 
Instance details

Defined in Lucan.Math.Types

data ParabolNegPyDy #

Paraboloid of revolution with y-axis as central line opened in negative direction and its vertex at \( (0,P_y,0)^T \): \[ F(x,y,z) = \frac{x^2}{A^2} + (y-P_y) + \frac{z^2}{A^2} = 0\]

Constructors

ParabolNegPyDy 

Fields

Instances

Instances details
Eq ParabolNegPyDy # 
Instance details

Defined in Lucan.Math.Types

Show ParabolNegPyDy # 
Instance details

Defined in Lucan.Math.Types

data ParabolNegPzDz #

Paraboloid of revolution with z-axis as central line opened in negative direction and its vertex at \( (0,0,P_z)^T \): \[ F(x,y,z) = \frac{x^2}{A^2} + \frac{y^2}{A^2} + (z-P_z) = 0\]

Constructors

ParabolNegPzDz 

Fields

Instances

Instances details
Eq ParabolNegPzDz # 
Instance details

Defined in Lucan.Math.Types

Show ParabolNegPzDz # 
Instance details

Defined in Lucan.Math.Types

data ParabolNegPxyzDx #

Paraboloid of revolution opened in negative x-direction with its vertex at \( (P_x,P_y,P_z)^T \): \[ F(x,y,z) = (x-P_x) + \frac{(y-P_y)^2}{A^2} + \frac{(z-P_z)^2}{A^2} = 0\]

Instances

Instances details
Eq ParabolNegPxyzDx # 
Instance details

Defined in Lucan.Math.Types

Show ParabolNegPxyzDx # 
Instance details

Defined in Lucan.Math.Types

data ParabolNegPxyzDy #

Paraboloid of revolution opened in negative y-direction with its vertex at \( (P_x,P_y,P_z)^T \): \[ F(x,y,z) = \frac{(x-P_x)^2}{A^2} + (y-P_y) + \frac{(z-P_z)^2}{A^2} = 0\]

Instances

Instances details
Eq ParabolNegPxyzDy # 
Instance details

Defined in Lucan.Math.Types

Show ParabolNegPxyzDy # 
Instance details

Defined in Lucan.Math.Types

data ParabolNegPxyzDz #

Paraboloid of revolution opened in negative z-direction with its vertex at \( (P_x,P_y,P_z)^T \): \[ F(x,y,z) = \frac{(x-P_x)^2}{A^2} + \frac{(y-P_y)^2}{A^2} + (z-P_z) = 0\]

Instances

Instances details
Eq ParabolNegPxyzDz # 
Instance details

Defined in Lucan.Math.Types

Show ParabolNegPxyzDz # 
Instance details

Defined in Lucan.Math.Types

data ConePosPxDx #

Cone of revolution with x-axis as central line opened in positive direction and its vertex at \( (P_x,0,0)^T \): \[ F(x,y,z) = - sign(x-P_x)\cdot(x-P_x)^2 + \frac{y^2}{A^2} + \frac{z^2}{A^2} = 0\]

Constructors

ConePosPxDx 

Fields

Instances

Instances details
Eq ConePosPxDx # 
Instance details

Defined in Lucan.Math.Types

Show ConePosPxDx # 
Instance details

Defined in Lucan.Math.Types

data ConePosPyDy #

Cone of revolution with y-axis as central line opened in positive direction and its vertex at \( (0,P_y,0)^T \): \[ F(x,y,z) = \frac{x^2}{A^2} - sign(y-P_y)\cdot(y-P_y)^2 + \frac{z^2}{A^2} = 0\]

Constructors

ConePosPyDy 

Fields

Instances

Instances details
Eq ConePosPyDy # 
Instance details

Defined in Lucan.Math.Types

Show ConePosPyDy # 
Instance details

Defined in Lucan.Math.Types

data ConePosPzDz #

Cone of revolution with z-axis as central line opened in positive direction and its vertex at \( (0,0,P_z)^T \): \[ F(x,y,z) = \frac{x^2}{A^2} + \frac{y^2}{A^2} - sign(z-P_z)\cdot(z-P_z)^2 = 0\]

Constructors

ConePosPzDz 

Fields

Instances

Instances details
Eq ConePosPzDz # 
Instance details

Defined in Lucan.Math.Types

Show ConePosPzDz # 
Instance details

Defined in Lucan.Math.Types

data ConePosPxyzDx #

Cone of revolution opened in positive x-direction with its vertex at \( (P_x,P_y,P_z)^T \): \[ F(x,y,z) = -sign(x-P_x)\cdot(x-P_x)^2 + \frac{(y-P_y)^2}{A^2} + \frac{(z-P_z)^2}{A^2} = 0\]

Instances

Instances details
Eq ConePosPxyzDx # 
Instance details

Defined in Lucan.Math.Types

Show ConePosPxyzDx # 
Instance details

Defined in Lucan.Math.Types

data ConePosPxyzDy #

Cone of revolution opened in positive y-direction with its vertex at \( (P_x,P_y,P_z)^T \): \[ F(x,y,z) = \frac{(x-P_x)^2}{A^2} -sign(y-P_y)\cdot(y-P_y)^2 + \frac{(z-P_z)^2}{A^2} = 0\]

Instances

Instances details
Eq ConePosPxyzDy # 
Instance details

Defined in Lucan.Math.Types

Show ConePosPxyzDy # 
Instance details

Defined in Lucan.Math.Types

data ConePosPxyzDz #

Cone of revolution opened in positive z-direction with its vertex at \( (P_x,P_y,P_z)^T \): \[ F(x,y,z) = \frac{(x-P_x)^2}{A^2} + \frac{(y-P_y)^2}{A^2} - sign(z-P_z)\cdot(z-P_z)^2 = 0\]

Instances

Instances details
Eq ConePosPxyzDz # 
Instance details

Defined in Lucan.Math.Types

Show ConePosPxyzDz # 
Instance details

Defined in Lucan.Math.Types

data ConeNegPxDx #

Cone of revolution with x-axis as central line opened in negative direction and its vertex at \( (P_x,0,0)^T \): \[ F(x,y,z) = sign(x-P_x)\cdot(x-P_x)^2 + \frac{y^2}{A^2} + \frac{z^2}{A^2} = 0\]

Constructors

ConeNegPxDx 

Fields

Instances

Instances details
Eq ConeNegPxDx # 
Instance details

Defined in Lucan.Math.Types

Show ConeNegPxDx # 
Instance details

Defined in Lucan.Math.Types

data ConeNegPyDy #

Cone of revolution with y-axis as central line opened in negative direction and its vertex at \( (0,P_y,0)^T \): \[ F(x,y,z) = \frac{x^2}{A^2} + sign(y-P_y)\cdot(y-P_y)^2 + \frac{z^2}{A^2} = 0\]

Constructors

ConeNegPyDy 

Fields

Instances

Instances details
Eq ConeNegPyDy # 
Instance details

Defined in Lucan.Math.Types

Show ConeNegPyDy # 
Instance details

Defined in Lucan.Math.Types

data ConeNegPzDz #

Cone of revolution with z-axis as central line opened in negative direction and its vertex at \( (0,0,P_z)^T \): \[ F(x,y,z) = \frac{x^2}{A^2} + \frac{y^2}{A^2} + sign(z-P_z)\cdot(z-P_z)^2 = 0\]

Constructors

ConeNegPzDz 

Fields

Instances

Instances details
Eq ConeNegPzDz # 
Instance details

Defined in Lucan.Math.Types

Show ConeNegPzDz # 
Instance details

Defined in Lucan.Math.Types

data ConeNegPxyzDx #

Cone of revolution opened in negative x-direction with its vertex at \( (P_x,P_y,P_z)^T \): \[ F(x,y,z) = sign(x-P_x)\cdot(x-P_x)^2 + \frac{(y-P_y)^2}{A^2} + \frac{(z-P_z)^2}{A^2} = 0\]

Instances

Instances details
Eq ConeNegPxyzDx # 
Instance details

Defined in Lucan.Math.Types

Show ConeNegPxyzDx # 
Instance details

Defined in Lucan.Math.Types

data ConeNegPxyzDy #

Cone of revolution opened in negative y-direction with its vertex at \( (P_x,P_y,P_z)^T \): \[ F(x,y,z) = \frac{(x-P_x)^2}{A^2} + sign(y-P_y)\cdot(y-P_y)^2 + \frac{(z-P_z)^2}{A^2} = 0\]

Instances

Instances details
Eq ConeNegPxyzDy # 
Instance details

Defined in Lucan.Math.Types

Show ConeNegPxyzDy # 
Instance details

Defined in Lucan.Math.Types

data ConeNegPxyzDz #

Cone of revolution opened in negative z-direction with its vertex at \( (P_x,P_y,P_z)^T \): \[ F(x,y,z) = \frac{(x-P_x)^2}{A^2} + \frac{(y-P_y)^2}{A^2} + sign(z-P_z)\cdot(z-P_z)^2 = 0\]

Instances

Instances details
Eq ConeNegPxyzDz # 
Instance details

Defined in Lucan.Math.Types

Show ConeNegPxyzDz # 
Instance details

Defined in Lucan.Math.Types

data TorusPxyzDx #

Torus of revolution in x-direction with its center at \( (P_x,P_y,P_z)^T \): \[ F(x,y,z) = \left( \sqrt{(y-P_y)^2 + (z-P_z)^2} - R_2 \right)^2 + (x-P_x)^2 - R_1^2 = 0\]

Constructors

TorusPxyzDx 

Fields

Instances

Instances details
Eq TorusPxyzDx # 
Instance details

Defined in Lucan.Math.Types

Show TorusPxyzDx # 
Instance details

Defined in Lucan.Math.Types

data TorusPxyzDy #

Torus of revolution in z-direction with its center at \( (P_x,P_y,P_z)^T \): \[ F(x,y,z) = \left( \sqrt{(x-P_x)^2 + (z-P_z)^2} - R_2 \right)^2 + (y-P_y)^2 - R_1^2 = 0\]

Constructors

TorusPxyzDy 

Fields

Instances

Instances details
Eq TorusPxyzDy # 
Instance details

Defined in Lucan.Math.Types

Show TorusPxyzDy # 
Instance details

Defined in Lucan.Math.Types

data TorusPxyzDz #

Torus of revolution in z-direction with its center at \( (P_x,P_y,P_z)^T \): \[ F(x,y,z) = \left( \sqrt{(x-P_x)^2 + (y-P_y)^2} - R_2 \right)^2 + (z-P_z)^2 - R_1^2 = 0\]

Constructors

TorusPxyzDz 

Fields

Instances

Instances details
Eq TorusPxyzDz # 
Instance details

Defined in Lucan.Math.Types

Show TorusPxyzDz # 
Instance details

Defined in Lucan.Math.Types

type Box = M32 Double #

Datatype for a box represented as a 3x2 matrix with minimum and maximum coordinates in each dimension.

data Line #

Type for a geometric ray wich has an origin and a direction. To distinguish this type from an optical ray, it is referred to as a halfline or simply a line.

Constructors

Line 

Fields

Instances

Instances details
Eq Line # 
Instance details

Defined in Lucan.Math.Types

Methods

(==) :: Line -> Line -> Bool #

(/=) :: Line -> Line -> Bool #

Show Line # 
Instance details

Defined in Lucan.Math.Types

Methods

showsPrec :: Int -> Line -> ShowS #

show :: Line -> String #

showList :: [Line] -> ShowS #

data Axis #

Datatype for different axis directions.

Constructors

X 
Y 
Z 

Instances

Instances details
Eq Axis # 
Instance details

Defined in Lucan.Math.Types

Methods

(==) :: Axis -> Axis -> Bool #

(/=) :: Axis -> Axis -> Bool #

Show Axis # 
Instance details

Defined in Lucan.Math.Types

Methods

showsPrec :: Int -> Axis -> ShowS #

show :: Axis -> String #

showList :: [Axis] -> ShowS #

data Order #

Datatype for ascending or descending order.

Constructors

Asc 
Desc 

Instances

Instances details
Eq Order # 
Instance details

Defined in Lucan.Math.Types

Methods

(==) :: Order -> Order -> Bool #

(/=) :: Order -> Order -> Bool #

Show Order # 
Instance details

Defined in Lucan.Math.Types

Methods

showsPrec :: Int -> Order -> ShowS #

show :: Order -> String #

showList :: [Order] -> ShowS #

data AngleUnit #

Datatype for the unit of an angle which could either be radiant or degrees.

Constructors

Rad 
Deg 

Instances

Instances details
Eq AngleUnit # 
Instance details

Defined in Lucan.Math.Types

Show AngleUnit # 
Instance details

Defined in Lucan.Math.Types

Model.Types

data System #

The datatype System represents the whole optical system.

Constructors

System 

Fields

  • sParts :: [Part]

    All parts of the system. There should be no overlap of parts, otherwise it would abort a raytrace.

  • sSurrounding :: Material

    Medium between parts defined as a material. Usually this will be air but there are other materials possible as well.

  • sDeflect :: DeflectMethod

    Specifies the method how deflection is calculated. This is used by the raytracer.

Instances

Instances details
Eq System # 
Instance details

Defined in Lucan.Model.Types

Methods

(==) :: System -> System -> Bool #

(/=) :: System -> System -> Bool #

Show System # 
Instance details

Defined in Lucan.Model.Types

data Part #

A Part is a physical object that light can interact with.

Constructors

Part 

Fields

  • pSurfaces :: [Surface]

    List of optical surfaces that define the shape of the part in the local coordinate system of the part. The interior of the part is the volume obtained by intersecting all of the halfspaces derived from the surfaces. Surface coordinates are given in millimeters.

  • pPlacement :: Placement

    Placement of the part surfaces in the global coordinate system in millimeters.

  • pMaterial :: Material

    Material of the part.

Instances

Instances details
Eq Part # 
Instance details

Defined in Lucan.Model.Types

Methods

(==) :: Part -> Part -> Bool #

(/=) :: Part -> Part -> Bool #

Show Part # 
Instance details

Defined in Lucan.Model.Types

Methods

showsPrec :: Int -> Part -> ShowS #

show :: Part -> String #

showList :: [Part] -> ShowS #

data Placement #

Parameters that define the placement of the part surfaces in the global coordinate system. The first three parameters are the Euler-Cardan angles for calculating a rotation matrix R that defines the orientation, see calcRotation. The last three parameters define a translation vector t that defines the location. The transformation rule for a point p to the global coordinate system is: \( p \mapsto R \cdot p + t \). This means that the rotation is performed first and then the translation.

Constructors

Placement 

Fields

Instances

Instances details
Eq Placement # 
Instance details

Defined in Lucan.Model.Types

Show Placement # 
Instance details

Defined in Lucan.Model.Types

data Surface #

Datatype for an optical surface. It is composed as the geometric shape of the surface together with an flag that defines if the shape is inverted. A surface can also have optical properties.

Constructors

Surface 

Fields

  • sShape :: Shape

    Geometric shape of the surface that splits the space into two halfspaces. Strictly speaking spheres and tori do not create true halfspaces, but the notation is used anyway.

  • sReverse :: Bool

    Flag for reversing the direction of surface normals, allowing inner and outer halfspaces can be swapped.

  • sScatter :: Double

    Value between 0 and 1 that describes the scattering properties. NOTICE: The current version of Lucan does not use this value yet.

Instances

Instances details
Eq Surface # 
Instance details

Defined in Lucan.Model.Types

Methods

(==) :: Surface -> Surface -> Bool #

(/=) :: Surface -> Surface -> Bool #

Show Surface # 
Instance details

Defined in Lucan.Model.Types

data Material #

A Material is defined by it's physical properties that are relevant for optics.

Various ideal materials can be modelled with the following values for refractive index and internal transmittance. Please note that this is a simplification since there is also a complex refractive index, but it works for refraction based on Snell's model:

  • ideal mirrors : mRefract = Refract 0.
  • ideal absorbers : mTransmit = Transmit 0
  • ideal transmitters : mTransmit = Transmit 1

Constructors

Material 

Fields

Instances

Instances details
Eq Material # 
Instance details

Defined in Lucan.Model.Types

Show Material # 
Instance details

Defined in Lucan.Model.Types

data Refract #

Datatype for different methods of how to determine the refractive index

Constructors

Refract Double

Constant refractive index independent of wavelength

RefractSellmeier SellmeierCoefficients

Refractive index calculated by the Sellmeier equation

Instances

Instances details
Eq Refract # 
Instance details

Defined in Lucan.Model.Types

Methods

(==) :: Refract -> Refract -> Bool #

(/=) :: Refract -> Refract -> Bool #

Show Refract # 
Instance details

Defined in Lucan.Model.Types

data SellmeierCoefficients #

The Sellmeier Coefficients are used to implement dispersion, that is the refractive index is dependent of the wavelength. \[n^2(\lambda) = 1 + \frac{B_1\lambda^2}{\lambda^2-C_1} + \frac{B_2\lambda^2}{\lambda^2-C_2} + \frac{B_3\lambda^2}{\lambda^2-C_3}\]

Constructors

SellmeierCoefficients 

Fields

type SellmeierCatalog = [(String, SellmeierCoefficients)] #

Catalog with named Sellmeier coefficients for different materials which is defined as a list of pairs. Each pair consists of a material name as a String and the corresponding Sellmeier coefficients.

data Transmit #

The internal transmittance \( T_i \) of a material is a value between 0 and 1 that describes the preservation of irradiance in a unit depth \(d\) of 10 mm. If the internal transmittance is only known in relation to another depth, say \( \bar{T_i} \) for depth \(\bar{d}\), then the internal transmittance can be calculated by: \[ T_i = \bar{T_i}^{\frac{d}{\bar{d}}} \] There is a relashionship to the materials absorption coefficient \( k \): \[ T_i = \exp^{-k\cdot d} \]

Constructors

Transmit Double

Fixed double value for internal transmittance

Instances

Instances details
Eq Transmit # 
Instance details

Defined in Lucan.Model.Types

Show Transmit # 
Instance details

Defined in Lucan.Model.Types

data DeflectMethod #

Method that determines the behaviour of raytracing

Constructors

DeflectSnell

Simplest method for deflection, where the cases for reflection and reflection were only determined by the use of Snell's law. No probabalistic method.

DeflectFresnel

In this case the fresnel equotations for unporalized light are applied to determine the deflection of a ray on a surface intersection point. A ray will be not splitted into rays with different intensities, instead the kind of deflection (refraction or reflection) is probabilistically determined based on the fresnel rules. NOTICE: This method is not implemented yet.

Instances

Instances details
Eq DeflectMethod # 
Instance details

Defined in Lucan.Model.Types

Show DeflectMethod # 
Instance details

Defined in Lucan.Model.Types

data Ray #

An ray is defined by its geometric properties orgin and direction together with physical properties.

Constructors

Ray 

Fields

Instances

Instances details
Eq Ray # 
Instance details

Defined in Lucan.Model.Types

Methods

(==) :: Ray -> Ray -> Bool #

(/=) :: Ray -> Ray -> Bool #

Show Ray # 
Instance details

Defined in Lucan.Model.Types

Methods

showsPrec :: Int -> Ray -> ShowS #

show :: Ray -> String #

showList :: [Ray] -> ShowS #

data Raytrace #

Datatype for the result after raytracing.

Constructors

Raytrace 

Fields

  • rImpacts :: [Impact]

    List of impacts where the ray intersects surfaces during the raytrace. The impacts are stored in reversed order, i.e. the last impact of the raytrace is at the head of the list.

  • rLength :: Double

    Geometric length in millimeters

  • rPath :: Double

    Optical path length in millimeters

Instances

Instances details
Eq Raytrace # 
Instance details

Defined in Lucan.Model.Types

Show Raytrace # 
Instance details

Defined in Lucan.Model.Types

data Intersection #

Where a ray hits a part there is an intersection. This datatype describes all the geometric and optical properties of an intersection.

Constructors

Intersection 

Fields

Instances

Instances details
Eq Intersection # 
Instance details

Defined in Lucan.Model.Types

Show Intersection # 
Instance details

Defined in Lucan.Model.Types

data Impact #

An Impact is the pair of an incident ray and an intersection.

Constructors

Impact 

Instances

Instances details
Eq Impact # 
Instance details

Defined in Lucan.Model.Types

Methods

(==) :: Impact -> Impact -> Bool #

(/=) :: Impact -> Impact -> Bool #

Show Impact # 
Instance details

Defined in Lucan.Model.Types

data Spot #

The Spot datatype describes where rays intersect with an analysis plane. Note that the analysis plane does not have to be on a part surface.

Constructors

Spot 

Fields

  • sRadius :: Double

    Radius in millimeters of a circle around the origin of the local coordinate system of the analysis plane in which all ray points lie.

  • sTransformation :: Transformation

    Transformation defining the local coordinate system of the analysis plane. The translation vector defines the origin of the local coordinate system and the first two rows of the transposed rotation matrix are the directions of the local x and y axes. The rotation matrix can be calculated with calcRotation2.

  • sRaypoints :: [Raypoint]

    Raypoints on the analysis plane.

Instances

Instances details
Eq Spot # 
Instance details

Defined in Lucan.Model.Types

Methods

(==) :: Spot -> Spot -> Bool #

(/=) :: Spot -> Spot -> Bool #

Show Spot # 
Instance details

Defined in Lucan.Model.Types

Methods

showsPrec :: Int -> Spot -> ShowS #

show :: Spot -> String #

showList :: [Spot] -> ShowS #

data Raypoint #

A Raypoint can be any point on a ray. It is not related to a part or surface.

Constructors

Raypoint 

Fields

Instances

Instances details
Eq Raypoint # 
Instance details

Defined in Lucan.Model.Types

Show Raypoint # 
Instance details

Defined in Lucan.Model.Types

type Spectrum = [(Double, Double)] #

List of Tuples with wavelength in micrometers in the first component and intensity in the second component. The intensity can have an arbitrary unit.

Other Types

Graphics.Havis.Types

These types are used for graphics. Note that the View type should not be accessed directly.

data Orientation #

Constructors

XY 
YZ 
ZX 
YX 
ZY 
XZ 

Instances

Instances details
Eq Orientation 
Instance details

Defined in Graphics.Havis.Types

data View #

Constructors

View 

Fields

Math.Lowlin.Types

Types for various matrix- and vector-like representations.

type M22 a = V2 (V2 a) #

type M23 a = V2 (V3 a) #

type M24 a = V2 (V4 a) #

type M32 a = V3 (V2 a) #

type M33 a = V3 (V3 a) #

type M34 a = V3 (V4 a) #

type M42 a = V4 (V2 a) #

type M43 a = V4 (V3 a) #

type M44 a = V4 (V4 a) #

type V2 a = (a, a) #

type V3 a = (a, a, a) #

type V4 a = (a, a, a, a) #