Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- exportParts :: Double -> Box -> File -> [Part] -> IO ()
- exportSellmeierCatalog :: File -> SellmeierCatalog -> IO ()
- importRays :: Material -> File -> IO [Ray]
- importRays2 :: Material -> File -> File -> IO [Ray]
- importSpectrum :: File -> IO Spectrum
- importSellmeierCatalog :: File -> IO SellmeierCatalog
- initView :: Orientation -> Box -> V2 Int -> V2 Int -> IO View
- setViewRulers :: View -> IO ()
- setViewMatrix :: View -> M44 Double -> IO ()
- addViewText :: View -> V2 Int -> Double -> Double -> String -> IO ()
- addViewBox :: View -> Box -> IO ()
- addViewAxes :: View -> Axes -> IO ()
- addViewPoint :: View -> Double -> V3 Double -> IO ()
- addViewPoints :: View -> Double -> [V3 Double] -> IO ()
- addViewLineSegment :: View -> M23 Double -> IO ()
- addViewLineSegments :: View -> [M23 Double] -> IO ()
- addViewPart :: View -> Part -> IO ()
- addViewParts :: View -> [Part] -> IO ()
- addViewRay :: View -> Ray -> IO ()
- addViewRays :: View -> [Ray] -> IO ()
- addViewRaytrace :: View -> Raytrace -> IO ()
- addViewRaytraces :: View -> [Raytrace] -> IO ()
- createViewSpotDiagram :: V2 Int -> V2 Int -> Double -> Double -> String -> Spot -> IO View
- runView :: View -> IO ()
- runViews :: [View] -> IO ()
- calcConicalLines2d :: Double -> Int -> [Line]
- calcConicalLines3d :: Double -> Int -> [Line]
- calcParallelLines2d :: Double -> Int -> [Line]
- calcParallelLines3d :: Double -> Int -> [Line]
- calcRotation :: AngleUnit -> V3 Double -> M33 Double
- calcRotation2 :: M23 Double -> M33 Double
- calcTransformation :: V3 Double -> V3 Double -> Transformation
- calcTransformation2 :: M23 Double -> V3 Double -> Transformation
- infinity :: Double
- epsilon :: Double
- calcBoxDiameter :: Box -> Double
- calcSpot :: Double -> Transformation -> System -> [Ray] -> Spot
- getSellmeierCoefficients :: SellmeierCatalog -> String -> SellmeierCoefficients
- isPointInsidePart :: Part -> V3 Double -> Bool
- calcRays :: Double -> Double -> Material -> Transformation -> [Line] -> [Ray]
- traceRay :: System -> Ray -> Raytrace
- traceRays :: System -> [Ray] -> [Raytrace]
- data File
- data Frame a = Frame {
- fQuantities :: [Quantity]
- fRows :: [[a]]
- data Quantity = Quantity {}
- data Unit
- data Axes = Axes {}
- data Transformation = Transformation {}
- data Shape
- = ShapeSphere Sphere
- | ShapeSpherePx SpherePx
- | ShapeSpherePy SpherePy
- | ShapeSpherePz SpherePz
- | ShapePlane Plane
- | ShapePlaneDx PlaneDx
- | ShapePlaneDy PlaneDy
- | ShapePlaneDz PlaneDz
- | ShapeCylinder Cylinder
- | ShapeCylinderDx CylinderDx
- | ShapeCylinderDy CylinderDy
- | ShapeCylinderDz CylinderDz
- | ShapeCylinderPyzDx CylinderPyzDx
- | ShapeCylinderPzxDy CylinderPzxDy
- | ShapeCylinderPxyDz CylinderPxyDz
- | ShapeParabolPosPxDx ParabolPosPxDx
- | ShapeParabolPosPyDy ParabolPosPyDy
- | ShapeParabolPosPzDz ParabolPosPzDz
- | ShapeParabolPosPxyzDx ParabolPosPxyzDx
- | ShapeParabolPosPxyzDy ParabolPosPxyzDy
- | ShapeParabolPosPxyzDz ParabolPosPxyzDz
- | ShapeParabolNegPxDx ParabolNegPxDx
- | ShapeParabolNegPyDy ParabolNegPyDy
- | ShapeParabolNegPzDz ParabolNegPzDz
- | ShapeParabolNegPxyzDx ParabolNegPxyzDx
- | ShapeParabolNegPxyzDy ParabolNegPxyzDy
- | ShapeParabolNegPxyzDz ParabolNegPxyzDz
- | ShapeConePosPxDx ConePosPxDx
- | ShapeConePosPyDy ConePosPyDy
- | ShapeConePosPzDz ConePosPzDz
- | ShapeConePosPxyzDx ConePosPxyzDx
- | ShapeConePosPxyzDy ConePosPxyzDy
- | ShapeConePosPxyzDz ConePosPxyzDz
- | ShapeConeNegPxDx ConeNegPxDx
- | ShapeConeNegPyDy ConeNegPyDy
- | ShapeConeNegPzDz ConeNegPzDz
- | ShapeConeNegPxyzDx ConeNegPxyzDx
- | ShapeConeNegPxyzDy ConeNegPxyzDy
- | ShapeConeNegPxyzDz ConeNegPxyzDz
- | ShapeTorusPxyzDx TorusPxyzDx
- | ShapeTorusPxyzDy TorusPxyzDy
- | ShapeTorusPxyzDz TorusPxyzDz
- data Sphere = Sphere {}
- data SpherePx = SpherePx {}
- data SpherePy = SpherePy {}
- data SpherePz = SpherePz {}
- data Plane = Plane {}
- data PlaneDx = PlaneDx {}
- data PlaneDy = PlaneDy {}
- data PlaneDz = PlaneDz {}
- data Cylinder = Cylinder {}
- data CylinderDx = CylinderDx {}
- data CylinderDy = CylinderDy {}
- data CylinderDz = CylinderDz {}
- data CylinderPyzDx = CylinderPyzDx {}
- data CylinderPzxDy = CylinderPzxDy {}
- data CylinderPxyDz = CylinderPxyDz {}
- data ParabolPosPxDx = ParabolPosPxDx {}
- data ParabolPosPyDy = ParabolPosPyDy {}
- data ParabolPosPzDz = ParabolPosPzDz {}
- data ParabolPosPxyzDx = ParabolPosPxyzDx {
- ppPxyzDxA :: Double
- ppPxyzDxPx :: Double
- ppPxyzDxPy :: Double
- ppPxyzDxPz :: Double
- data ParabolPosPxyzDy = ParabolPosPxyzDy {
- ppPxyzDyA :: Double
- ppPxyzDyPx :: Double
- ppPxyzDyPy :: Double
- ppPxyzDyPz :: Double
- data ParabolPosPxyzDz = ParabolPosPxyzDz {
- ppPxyzDzA :: Double
- ppPxyzDzPx :: Double
- ppPxyzDzPy :: Double
- ppPxyzDzPz :: Double
- data ParabolNegPxDx = ParabolNegPxDx {}
- data ParabolNegPyDy = ParabolNegPyDy {}
- data ParabolNegPzDz = ParabolNegPzDz {}
- data ParabolNegPxyzDx = ParabolNegPxyzDx {
- pnPxyzDxA :: Double
- pnPxyzDxPx :: Double
- pnPxyzDxPy :: Double
- pnPxyzDxPz :: Double
- data ParabolNegPxyzDy = ParabolNegPxyzDy {
- pnPxyzDyA :: Double
- pnPxyzDyPx :: Double
- pnPxyzDyPy :: Double
- pnPxyzDyPz :: Double
- data ParabolNegPxyzDz = ParabolNegPxyzDz {
- pnPxyzDzA :: Double
- pnPxyzDzPx :: Double
- pnPxyzDzPy :: Double
- pnPxyzDzPz :: Double
- data ConePosPxDx = ConePosPxDx {}
- data ConePosPyDy = ConePosPyDy {}
- data ConePosPzDz = ConePosPzDz {}
- data ConePosPxyzDx = ConePosPxyzDx {
- cpPxyzDxA :: Double
- cpPxyzDxPx :: Double
- cpPxyzDxPy :: Double
- cpPxyzDxPz :: Double
- data ConePosPxyzDy = ConePosPxyzDy {
- cpPxyzDyA :: Double
- cpPxyzDyPx :: Double
- cpPxyzDyPy :: Double
- cpPxyzDyPz :: Double
- data ConePosPxyzDz = ConePosPxyzDz {
- cpPxyzDzA :: Double
- cpPxyzDzPx :: Double
- cpPxyzDzPy :: Double
- cpPxyzDzPz :: Double
- data ConeNegPxDx = ConeNegPxDx {}
- data ConeNegPyDy = ConeNegPyDy {}
- data ConeNegPzDz = ConeNegPzDz {}
- data ConeNegPxyzDx = ConeNegPxyzDx {
- cnPxyzDxA :: Double
- cnPxyzDxPx :: Double
- cnPxyzDxPy :: Double
- cnPxyzDxPz :: Double
- data ConeNegPxyzDy = ConeNegPxyzDy {
- cnPxyzDyA :: Double
- cnPxyzDyPx :: Double
- cnPxyzDyPy :: Double
- cnPxyzDyPz :: Double
- data ConeNegPxyzDz = ConeNegPxyzDz {
- cnPxyzDzA :: Double
- cnPxyzDzPx :: Double
- cnPxyzDzPy :: Double
- cnPxyzDzPz :: Double
- data TorusPxyzDx = TorusPxyzDx {}
- data TorusPxyzDy = TorusPxyzDy {}
- data TorusPxyzDz = TorusPxyzDz {}
- type Box = M32 Double
- data Line = Line {}
- data Axis
- data Order
- data AngleUnit
- data System = System {
- sParts :: [Part]
- sSurrounding :: Material
- sDeflect :: DeflectMethod
- data Part = Part {}
- data Placement = Placement {}
- data Surface = Surface {}
- data Material = Material {}
- data Refract
- data SellmeierCoefficients = SellmeierCoefficients {}
- type SellmeierCatalog = [(String, SellmeierCoefficients)]
- data Transmit = Transmit Double
- data DeflectMethod
- data Ray = Ray {}
- data Raytrace = Raytrace {}
- data Intersection = Intersection {}
- data Impact = Impact {
- iRay :: Ray
- iIntersection :: Intersection
- data Spot = Spot {}
- data Raypoint = Raypoint {}
- type Spectrum = [(Double, Double)]
- data Orientation
- data View = View {
- vWindow :: Window
- vPixelFactor :: GLfloat
- vActions :: IORef Actions
- vShader2d :: IORef Shader
- vShaderFont2d :: IORef Shader
- vShader3d :: IORef Shader
- vShaderTexture3d :: IORef Shader
- vShaderFacingRatio3d :: IORef Shader
- vBox :: IORef (M32 GLfloat)
- vScene :: MVar ObjectMap
- vSceneIntern :: MVar ObjectMap
- vRulersActive :: IORef Bool
- vPanActive :: IORef Bool
- vRotActive :: IORef Bool
- vNav :: IORef Navigation
- vZoom :: IORef GLfloat
- vClickPos :: IORef (V2 GLfloat)
- vLastPos :: IORef (V2 GLfloat)
- vModelMat :: IORef (M44 GLfloat)
- vViewMat :: IORef (M44 GLfloat)
- vProjMat :: IORef (M44 GLfloat)
- vDispMat :: IORef (M44 GLfloat)
- 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)
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 surfacesBox:
Bounding box with dimensions in millimeters that encloses the partsFile:
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 exportIO ():
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 lengthV2 Int:
View position on screen in pixelV2 Int:
View size in pixelIO 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 orientationDouble:
Angle in degrees by which to rotate the textDouble:
Font size in pixelsString:
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 displayedAxes:
Axes to displayIO ():
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 displayedDouble:
Point size in pixelsV3 Double:
Coordinates of the point to display in unit of measurement depending on the contextIO ():
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 displayedDouble:
Point size in pixels[V3 Double]:
Coordinates of the points to display in unit of measurement depending on the contextIO ():
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 displayedM23 Double:
Point pair coordinates in unit of measurement depending on the contextIO ():
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 contextIO ():
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 displayedPart:
Part to displayIO ():
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 displayIO ():
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 displayedRay:
Ray to displayIO ():
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 displayIO ():
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 displayedRaytrace:
Raytrace to displayIO ():
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 displayIO ():
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 pixelV2 Int:
View size in pixelDouble:
Font size of text annotationsDouble:
Point size of spot pointsString:
TitleSpot:
Spot to displayIO View:
Returned view in an IO action
Available in: Base | Pro
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
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 degreesInt:
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 degreesInt:
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 widthInt:
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 anglesV3 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 incalcRotation
V3 Double:
LocationTransformation:
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 incalcRotation2
V3 Double:
LocationTransformation:
Resulting transformation
Available in: Free | Base | Pro
Math.Util
Infinity is larger than any real number. Here it is defined as 1/0.
Available in: Free | Base | Pro
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 alsoSpot
.Transformation:
Transformation defining the local coordinate system of the analysis plane, see alsoSpot
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 materialsString:
Material nameSellmeierCoefficients:
Retrieved SellmeierCoefficients
Available in: Free | Base | Pro
Model.Part
isPointInsidePart :: Part -> V3 Double -> Bool #
Tests whether a point is inside a part.
Parameters:
Part:
PartV3 Double:
PointBool:
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 tracedRay:
Ray to be tracedRaytrace:
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
Datatype for different file formats.
FileHS | Haskell File |
FileSTP | STEP File for CAD data exchange |
FileDSV | Text file with delimiter separated values. Comment lines begin with the character '#'. |
| |
FileLEF | Binary file with little endian float values saved as rows defiend by Quantities. |
| |
FileAGF | Text file with material data (ASCII glass format) |
Data frame for homogenous data of the same arbitrary type.
Frame | |
|
A Quantity can be either a dimensionless or a physical quantity, depending on the unit.
Units of measurement with a multiplier, e.g. millimeter = Meter 0.001
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 |
Graphics.Types
The Axes datatype is used to visualize a right handed cartesian coordinate system relative to the global coordinate system.
Axes | |
|
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.
Instances
Eq Transformation # | |
Defined in Lucan.Math.Types (==) :: Transformation -> Transformation -> Bool # (/=) :: Transformation -> Transformation -> Bool # | |
Show Transformation # | |
Defined in Lucan.Math.Types showsPrec :: Int -> Transformation -> ShowS # show :: Transformation -> String # showList :: [Transformation] -> ShowS # |
Sum type of all geometric surface shapes.
Arbitrary sphere: \[ F(x,y,z) = (x-P_x)^2 + (y-P_y)^2 + (z-P_z)^2 - R^2 = 0 \]
Sphere with center on x-axis: \[ F(x,y,z) = (x-P_x)^2 + y^2 + z^2 - R^2 = 0\]
Sphere with center on y-axis: \[ F(x,y,z) = x^2 + (y-P_y)^2 + z^2 - R^2 = 0\]
Sphere with center on z-axis: \[ F(x,y,z) = x^2 + y^2 + (z-P_z)^2 - R^2 = 0\]
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 \).
Plane with normal vector in direction of x-axis: \[ F(x,y,z) = x - D = 0 \]
Plane with normal vector in direction of y-axis: \[ F(x,y,z) = y - D = 0\]
Plane with normal vector in direction of z-axis: \[ F(x,y,z) = z - D = 0 \]
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} \]
data CylinderDx #
Cylinder with radius \( R \) and x-axis as central line: \[ F(x,y,z) = y^2 + z^2 - R^2 = 0\]
Instances
Eq CylinderDx # | |
Defined in Lucan.Math.Types (==) :: CylinderDx -> CylinderDx -> Bool # (/=) :: CylinderDx -> CylinderDx -> Bool # | |
Show CylinderDx # | |
Defined in Lucan.Math.Types showsPrec :: Int -> CylinderDx -> ShowS # show :: CylinderDx -> String # showList :: [CylinderDx] -> ShowS # |
data CylinderDy #
Cylinder with radius \( R \) and y-axis as central line: \[ F(x,y,z) = x^2 + z^2 - R^2 = 0\]
Instances
Eq CylinderDy # | |
Defined in Lucan.Math.Types (==) :: CylinderDy -> CylinderDy -> Bool # (/=) :: CylinderDy -> CylinderDy -> Bool # | |
Show CylinderDy # | |
Defined in Lucan.Math.Types showsPrec :: Int -> CylinderDy -> ShowS # show :: CylinderDy -> String # showList :: [CylinderDy] -> ShowS # |
data CylinderDz #
Cylinder with radius \( R \) and z-axis as central line: \[ F(x,y,z) = x^2 + y^2 - R^2 = 0\]
Instances
Eq CylinderDz # | |
Defined in Lucan.Math.Types (==) :: CylinderDz -> CylinderDz -> Bool # (/=) :: CylinderDz -> CylinderDz -> Bool # | |
Show CylinderDz # | |
Defined in Lucan.Math.Types showsPrec :: Int -> CylinderDz -> ShowS # show :: CylinderDz -> String # showList :: [CylinderDz] -> ShowS # |
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\]
Instances
Eq CylinderPyzDx # | |
Defined in Lucan.Math.Types (==) :: CylinderPyzDx -> CylinderPyzDx -> Bool # (/=) :: CylinderPyzDx -> CylinderPyzDx -> Bool # | |
Show CylinderPyzDx # | |
Defined in Lucan.Math.Types showsPrec :: Int -> CylinderPyzDx -> ShowS # show :: CylinderPyzDx -> String # showList :: [CylinderPyzDx] -> ShowS # |
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\]
Instances
Eq CylinderPzxDy # | |
Defined in Lucan.Math.Types (==) :: CylinderPzxDy -> CylinderPzxDy -> Bool # (/=) :: CylinderPzxDy -> CylinderPzxDy -> Bool # | |
Show CylinderPzxDy # | |
Defined in Lucan.Math.Types showsPrec :: Int -> CylinderPzxDy -> ShowS # show :: CylinderPzxDy -> String # showList :: [CylinderPzxDy] -> ShowS # |
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\]
Instances
Eq CylinderPxyDz # | |
Defined in Lucan.Math.Types (==) :: CylinderPxyDz -> CylinderPxyDz -> Bool # (/=) :: CylinderPxyDz -> CylinderPxyDz -> Bool # | |
Show CylinderPxyDz # | |
Defined in Lucan.Math.Types showsPrec :: Int -> CylinderPxyDz -> ShowS # show :: CylinderPxyDz -> String # showList :: [CylinderPxyDz] -> ShowS # |
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\]
Instances
Eq ParabolPosPxDx # | |
Defined in Lucan.Math.Types (==) :: ParabolPosPxDx -> ParabolPosPxDx -> Bool # (/=) :: ParabolPosPxDx -> ParabolPosPxDx -> Bool # | |
Show ParabolPosPxDx # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ParabolPosPxDx -> ShowS # show :: ParabolPosPxDx -> String # showList :: [ParabolPosPxDx] -> ShowS # |
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\]
Instances
Eq ParabolPosPyDy # | |
Defined in Lucan.Math.Types (==) :: ParabolPosPyDy -> ParabolPosPyDy -> Bool # (/=) :: ParabolPosPyDy -> ParabolPosPyDy -> Bool # | |
Show ParabolPosPyDy # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ParabolPosPyDy -> ShowS # show :: ParabolPosPyDy -> String # showList :: [ParabolPosPyDy] -> ShowS # |
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\]
Instances
Eq ParabolPosPzDz # | |
Defined in Lucan.Math.Types (==) :: ParabolPosPzDz -> ParabolPosPzDz -> Bool # (/=) :: ParabolPosPzDz -> ParabolPosPzDz -> Bool # | |
Show ParabolPosPzDz # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ParabolPosPzDz -> ShowS # show :: ParabolPosPzDz -> String # showList :: [ParabolPosPzDz] -> ShowS # |
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\]
ParabolPosPxyzDx | |
|
Instances
Eq ParabolPosPxyzDx # | |
Defined in Lucan.Math.Types (==) :: ParabolPosPxyzDx -> ParabolPosPxyzDx -> Bool # (/=) :: ParabolPosPxyzDx -> ParabolPosPxyzDx -> Bool # | |
Show ParabolPosPxyzDx # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ParabolPosPxyzDx -> ShowS # show :: ParabolPosPxyzDx -> String # showList :: [ParabolPosPxyzDx] -> ShowS # |
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\]
ParabolPosPxyzDy | |
|
Instances
Eq ParabolPosPxyzDy # | |
Defined in Lucan.Math.Types (==) :: ParabolPosPxyzDy -> ParabolPosPxyzDy -> Bool # (/=) :: ParabolPosPxyzDy -> ParabolPosPxyzDy -> Bool # | |
Show ParabolPosPxyzDy # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ParabolPosPxyzDy -> ShowS # show :: ParabolPosPxyzDy -> String # showList :: [ParabolPosPxyzDy] -> ShowS # |
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\]
ParabolPosPxyzDz | |
|
Instances
Eq ParabolPosPxyzDz # | |
Defined in Lucan.Math.Types (==) :: ParabolPosPxyzDz -> ParabolPosPxyzDz -> Bool # (/=) :: ParabolPosPxyzDz -> ParabolPosPxyzDz -> Bool # | |
Show ParabolPosPxyzDz # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ParabolPosPxyzDz -> ShowS # show :: ParabolPosPxyzDz -> String # showList :: [ParabolPosPxyzDz] -> ShowS # |
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\]
Instances
Eq ParabolNegPxDx # | |
Defined in Lucan.Math.Types (==) :: ParabolNegPxDx -> ParabolNegPxDx -> Bool # (/=) :: ParabolNegPxDx -> ParabolNegPxDx -> Bool # | |
Show ParabolNegPxDx # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ParabolNegPxDx -> ShowS # show :: ParabolNegPxDx -> String # showList :: [ParabolNegPxDx] -> ShowS # |
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\]
Instances
Eq ParabolNegPyDy # | |
Defined in Lucan.Math.Types (==) :: ParabolNegPyDy -> ParabolNegPyDy -> Bool # (/=) :: ParabolNegPyDy -> ParabolNegPyDy -> Bool # | |
Show ParabolNegPyDy # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ParabolNegPyDy -> ShowS # show :: ParabolNegPyDy -> String # showList :: [ParabolNegPyDy] -> ShowS # |
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\]
Instances
Eq ParabolNegPzDz # | |
Defined in Lucan.Math.Types (==) :: ParabolNegPzDz -> ParabolNegPzDz -> Bool # (/=) :: ParabolNegPzDz -> ParabolNegPzDz -> Bool # | |
Show ParabolNegPzDz # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ParabolNegPzDz -> ShowS # show :: ParabolNegPzDz -> String # showList :: [ParabolNegPzDz] -> ShowS # |
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\]
ParabolNegPxyzDx | |
|
Instances
Eq ParabolNegPxyzDx # | |
Defined in Lucan.Math.Types (==) :: ParabolNegPxyzDx -> ParabolNegPxyzDx -> Bool # (/=) :: ParabolNegPxyzDx -> ParabolNegPxyzDx -> Bool # | |
Show ParabolNegPxyzDx # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ParabolNegPxyzDx -> ShowS # show :: ParabolNegPxyzDx -> String # showList :: [ParabolNegPxyzDx] -> ShowS # |
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\]
ParabolNegPxyzDy | |
|
Instances
Eq ParabolNegPxyzDy # | |
Defined in Lucan.Math.Types (==) :: ParabolNegPxyzDy -> ParabolNegPxyzDy -> Bool # (/=) :: ParabolNegPxyzDy -> ParabolNegPxyzDy -> Bool # | |
Show ParabolNegPxyzDy # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ParabolNegPxyzDy -> ShowS # show :: ParabolNegPxyzDy -> String # showList :: [ParabolNegPxyzDy] -> ShowS # |
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\]
ParabolNegPxyzDz | |
|
Instances
Eq ParabolNegPxyzDz # | |
Defined in Lucan.Math.Types (==) :: ParabolNegPxyzDz -> ParabolNegPxyzDz -> Bool # (/=) :: ParabolNegPxyzDz -> ParabolNegPxyzDz -> Bool # | |
Show ParabolNegPxyzDz # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ParabolNegPxyzDz -> ShowS # show :: ParabolNegPxyzDz -> String # showList :: [ParabolNegPxyzDz] -> ShowS # |
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\]
Instances
Eq ConePosPxDx # | |
Defined in Lucan.Math.Types (==) :: ConePosPxDx -> ConePosPxDx -> Bool # (/=) :: ConePosPxDx -> ConePosPxDx -> Bool # | |
Show ConePosPxDx # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ConePosPxDx -> ShowS # show :: ConePosPxDx -> String # showList :: [ConePosPxDx] -> ShowS # |
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\]
Instances
Eq ConePosPyDy # | |
Defined in Lucan.Math.Types (==) :: ConePosPyDy -> ConePosPyDy -> Bool # (/=) :: ConePosPyDy -> ConePosPyDy -> Bool # | |
Show ConePosPyDy # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ConePosPyDy -> ShowS # show :: ConePosPyDy -> String # showList :: [ConePosPyDy] -> ShowS # |
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\]
Instances
Eq ConePosPzDz # | |
Defined in Lucan.Math.Types (==) :: ConePosPzDz -> ConePosPzDz -> Bool # (/=) :: ConePosPzDz -> ConePosPzDz -> Bool # | |
Show ConePosPzDz # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ConePosPzDz -> ShowS # show :: ConePosPzDz -> String # showList :: [ConePosPzDz] -> ShowS # |
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\]
ConePosPxyzDx | |
|
Instances
Eq ConePosPxyzDx # | |
Defined in Lucan.Math.Types (==) :: ConePosPxyzDx -> ConePosPxyzDx -> Bool # (/=) :: ConePosPxyzDx -> ConePosPxyzDx -> Bool # | |
Show ConePosPxyzDx # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ConePosPxyzDx -> ShowS # show :: ConePosPxyzDx -> String # showList :: [ConePosPxyzDx] -> ShowS # |
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\]
ConePosPxyzDy | |
|
Instances
Eq ConePosPxyzDy # | |
Defined in Lucan.Math.Types (==) :: ConePosPxyzDy -> ConePosPxyzDy -> Bool # (/=) :: ConePosPxyzDy -> ConePosPxyzDy -> Bool # | |
Show ConePosPxyzDy # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ConePosPxyzDy -> ShowS # show :: ConePosPxyzDy -> String # showList :: [ConePosPxyzDy] -> ShowS # |
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\]
ConePosPxyzDz | |
|
Instances
Eq ConePosPxyzDz # | |
Defined in Lucan.Math.Types (==) :: ConePosPxyzDz -> ConePosPxyzDz -> Bool # (/=) :: ConePosPxyzDz -> ConePosPxyzDz -> Bool # | |
Show ConePosPxyzDz # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ConePosPxyzDz -> ShowS # show :: ConePosPxyzDz -> String # showList :: [ConePosPxyzDz] -> ShowS # |
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\]
Instances
Eq ConeNegPxDx # | |
Defined in Lucan.Math.Types (==) :: ConeNegPxDx -> ConeNegPxDx -> Bool # (/=) :: ConeNegPxDx -> ConeNegPxDx -> Bool # | |
Show ConeNegPxDx # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ConeNegPxDx -> ShowS # show :: ConeNegPxDx -> String # showList :: [ConeNegPxDx] -> ShowS # |
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\]
Instances
Eq ConeNegPyDy # | |
Defined in Lucan.Math.Types (==) :: ConeNegPyDy -> ConeNegPyDy -> Bool # (/=) :: ConeNegPyDy -> ConeNegPyDy -> Bool # | |
Show ConeNegPyDy # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ConeNegPyDy -> ShowS # show :: ConeNegPyDy -> String # showList :: [ConeNegPyDy] -> ShowS # |
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\]
Instances
Eq ConeNegPzDz # | |
Defined in Lucan.Math.Types (==) :: ConeNegPzDz -> ConeNegPzDz -> Bool # (/=) :: ConeNegPzDz -> ConeNegPzDz -> Bool # | |
Show ConeNegPzDz # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ConeNegPzDz -> ShowS # show :: ConeNegPzDz -> String # showList :: [ConeNegPzDz] -> ShowS # |
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\]
ConeNegPxyzDx | |
|
Instances
Eq ConeNegPxyzDx # | |
Defined in Lucan.Math.Types (==) :: ConeNegPxyzDx -> ConeNegPxyzDx -> Bool # (/=) :: ConeNegPxyzDx -> ConeNegPxyzDx -> Bool # | |
Show ConeNegPxyzDx # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ConeNegPxyzDx -> ShowS # show :: ConeNegPxyzDx -> String # showList :: [ConeNegPxyzDx] -> ShowS # |
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\]
ConeNegPxyzDy | |
|
Instances
Eq ConeNegPxyzDy # | |
Defined in Lucan.Math.Types (==) :: ConeNegPxyzDy -> ConeNegPxyzDy -> Bool # (/=) :: ConeNegPxyzDy -> ConeNegPxyzDy -> Bool # | |
Show ConeNegPxyzDy # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ConeNegPxyzDy -> ShowS # show :: ConeNegPxyzDy -> String # showList :: [ConeNegPxyzDy] -> ShowS # |
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\]
ConeNegPxyzDz | |
|
Instances
Eq ConeNegPxyzDz # | |
Defined in Lucan.Math.Types (==) :: ConeNegPxyzDz -> ConeNegPxyzDz -> Bool # (/=) :: ConeNegPxyzDz -> ConeNegPxyzDz -> Bool # | |
Show ConeNegPxyzDz # | |
Defined in Lucan.Math.Types showsPrec :: Int -> ConeNegPxyzDz -> ShowS # show :: ConeNegPxyzDz -> String # showList :: [ConeNegPxyzDz] -> ShowS # |
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\]
Instances
Eq TorusPxyzDx # | |
Defined in Lucan.Math.Types (==) :: TorusPxyzDx -> TorusPxyzDx -> Bool # (/=) :: TorusPxyzDx -> TorusPxyzDx -> Bool # | |
Show TorusPxyzDx # | |
Defined in Lucan.Math.Types showsPrec :: Int -> TorusPxyzDx -> ShowS # show :: TorusPxyzDx -> String # showList :: [TorusPxyzDx] -> ShowS # |
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\]
Instances
Eq TorusPxyzDy # | |
Defined in Lucan.Math.Types (==) :: TorusPxyzDy -> TorusPxyzDy -> Bool # (/=) :: TorusPxyzDy -> TorusPxyzDy -> Bool # | |
Show TorusPxyzDy # | |
Defined in Lucan.Math.Types showsPrec :: Int -> TorusPxyzDy -> ShowS # show :: TorusPxyzDy -> String # showList :: [TorusPxyzDy] -> ShowS # |
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\]
Instances
Eq TorusPxyzDz # | |
Defined in Lucan.Math.Types (==) :: TorusPxyzDz -> TorusPxyzDz -> Bool # (/=) :: TorusPxyzDz -> TorusPxyzDz -> Bool # | |
Show TorusPxyzDz # | |
Defined in Lucan.Math.Types showsPrec :: Int -> TorusPxyzDz -> ShowS # show :: TorusPxyzDz -> String # showList :: [TorusPxyzDz] -> ShowS # |
Datatype for a box represented as a 3x2 matrix with minimum and maximum coordinates in each dimension.
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.
Datatype for different axis directions.
Datatype for ascending or descending order.
Datatype for the unit of an angle which could either be radiant or degrees.
Model.Types
The datatype System represents the whole optical system.
System | |
|
A Part is a physical object that light can interact with.
Part | |
|
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.
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.
Surface | |
|
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
Datatype for different methods of how to determine the refractive index
Refract Double | Constant refractive index independent of wavelength |
RefractSellmeier SellmeierCoefficients | Refractive index calculated by the Sellmeier equation |
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}\]
Instances
Eq SellmeierCoefficients # | |
Defined in Lucan.Model.Types (==) :: SellmeierCoefficients -> SellmeierCoefficients -> Bool # (/=) :: SellmeierCoefficients -> SellmeierCoefficients -> Bool # | |
Show SellmeierCoefficients # | |
Defined in Lucan.Model.Types showsPrec :: Int -> SellmeierCoefficients -> ShowS # show :: SellmeierCoefficients -> String # showList :: [SellmeierCoefficients] -> ShowS # |
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.
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} \]
data DeflectMethod #
Method that determines the behaviour of raytracing
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
Eq DeflectMethod # | |
Defined in Lucan.Model.Types (==) :: DeflectMethod -> DeflectMethod -> Bool # (/=) :: DeflectMethod -> DeflectMethod -> Bool # | |
Show DeflectMethod # | |
Defined in Lucan.Model.Types showsPrec :: Int -> DeflectMethod -> ShowS # show :: DeflectMethod -> String # showList :: [DeflectMethod] -> ShowS # |
An ray is defined by its geometric properties orgin and direction together with physical properties.
Ray | |
|
Datatype for the result after raytracing.
data Intersection #
Where a ray hits a part there is an intersection. This datatype describes all the geometric and optical properties of an intersection.
Instances
Eq Intersection # | |
Defined in Lucan.Model.Types (==) :: Intersection -> Intersection -> Bool # (/=) :: Intersection -> Intersection -> Bool # | |
Show Intersection # | |
Defined in Lucan.Model.Types showsPrec :: Int -> Intersection -> ShowS # show :: Intersection -> String # showList :: [Intersection] -> ShowS # |
An Impact is the pair of an incident ray and an intersection.
Impact | |
|
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.
Spot | |
|
A Raypoint can be any point on a ray. It is not related to a part or surface.
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 #
Instances
Eq Orientation | |
Defined in Graphics.Havis.Types (==) :: Orientation -> Orientation -> Bool # (/=) :: Orientation -> Orientation -> Bool # |
View | |
|
Math.Lowlin.Types
Types for various matrix- and vector-like representations.