Safe Haskell | None |
---|---|
Language | Haskell2010 |
Lucan
Synopsis
- 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 {
- lOrigin :: !(V3 Double)
- lDirection :: !(V3 Double)
- data Axis
- data Order
- data AngleUnit
- data System = System {
- sParts :: [Part]
- sSurrounding :: Material
- sDeflect :: DeflectMethod
- data Part = Part {}
- data Surface = Surface {}
- data Material = Material {}
- data Refract
- type SellmeierCatalog = [(String, SellmeierCoefficients)]
- data SellmeierCoefficients = SellmeierCoefficients {}
- data Transmit = Transmit Double
- data DeflectMethod
- data Ray = Ray {
- rOrigin :: !(V3 Double)
- rDirection :: !(V3 Double)
- rWavelength :: Double
- rMaterial :: Material
- data Raytrace = Raytrace {}
- data Intersection = Intersection {}
- angularLines2d :: Double -> Int -> [Line]
- angularLines3d :: Double -> Int -> [Line]
- parallelLines2d :: Double -> Int -> [Line]
- parallelLines3d :: Double -> Int -> [Line]
- moveLine :: V3 Double -> V3 Double -> Line -> Line
- moveLines :: V3 Double -> V3 Double -> [Line] -> [Line]
- infinity :: Double
- epsilon :: Double
- getBoxDiameter :: Box -> Double
- traceRay :: System -> Ray -> Raytrace
- traceRays :: System -> [Ray] -> [Raytrace]
- getPartsForPoint :: System -> V3 Double -> [Part]
- isInsidePart :: Part -> V3 Double -> Bool
- toRays :: Double -> Material -> [Line] -> [Ray]
- exportParts :: FilePath -> Double -> Box -> [Part] -> IO ()
- initView :: String -> V2 Int -> V2 Int -> Box -> IO View
- runView :: View -> IO ()
- runViews :: [View] -> IO ()
- viewParts :: View -> [Part] -> IO ()
- viewPoint :: View -> V3 Double -> IO ()
- viewPoints :: View -> [V3 Double] -> IO ()
- viewLine :: View -> Line -> IO ()
- viewLines :: View -> [Line] -> IO ()
- viewRay :: View -> Ray -> IO ()
- viewRays :: View -> [Ray] -> IO ()
- viewRaytrace :: View -> Raytrace -> IO ()
- viewRaytraces :: View -> [Raytrace] -> IO ()
Types
Math.Types
Sum type of all geometric surface shapes.
Constructors
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 \]
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} \]
Constructors
Cylinder | |
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 | |
Instances
Eq CylinderDx # | |
Defined in Lucan.Math.Types | |
Show CylinderDx # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
CylinderDy | |
Instances
Eq CylinderDy # | |
Defined in Lucan.Math.Types | |
Show CylinderDy # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
CylinderDz | |
Instances
Eq CylinderDz # | |
Defined in Lucan.Math.Types | |
Show CylinderDz # | |
Defined in Lucan.Math.Types Methods 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 Methods (==) :: CylinderPyzDx -> CylinderPyzDx -> Bool # (/=) :: CylinderPyzDx -> CylinderPyzDx -> Bool # | |
Show CylinderPyzDx # | |
Defined in Lucan.Math.Types Methods 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 Methods (==) :: CylinderPzxDy -> CylinderPzxDy -> Bool # (/=) :: CylinderPzxDy -> CylinderPzxDy -> Bool # | |
Show CylinderPzxDy # | |
Defined in Lucan.Math.Types Methods 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 Methods (==) :: CylinderPxyDz -> CylinderPxyDz -> Bool # (/=) :: CylinderPxyDz -> CylinderPxyDz -> Bool # | |
Show CylinderPxyDz # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ParabolPosPxDx | |
Instances
Eq ParabolPosPxDx # | |
Defined in Lucan.Math.Types Methods (==) :: ParabolPosPxDx -> ParabolPosPxDx -> Bool # (/=) :: ParabolPosPxDx -> ParabolPosPxDx -> Bool # | |
Show ParabolPosPxDx # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ParabolPosPyDy | |
Instances
Eq ParabolPosPyDy # | |
Defined in Lucan.Math.Types Methods (==) :: ParabolPosPyDy -> ParabolPosPyDy -> Bool # (/=) :: ParabolPosPyDy -> ParabolPosPyDy -> Bool # | |
Show ParabolPosPyDy # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ParabolPosPzDz | |
Instances
Eq ParabolPosPzDz # | |
Defined in Lucan.Math.Types Methods (==) :: ParabolPosPzDz -> ParabolPosPzDz -> Bool # (/=) :: ParabolPosPzDz -> ParabolPosPzDz -> Bool # | |
Show ParabolPosPzDz # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ParabolPosPxyzDx | |
Fields
|
Instances
Eq ParabolPosPxyzDx # | |
Defined in Lucan.Math.Types Methods (==) :: ParabolPosPxyzDx -> ParabolPosPxyzDx -> Bool # (/=) :: ParabolPosPxyzDx -> ParabolPosPxyzDx -> Bool # | |
Show ParabolPosPxyzDx # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ParabolPosPxyzDy | |
Fields
|
Instances
Eq ParabolPosPxyzDy # | |
Defined in Lucan.Math.Types Methods (==) :: ParabolPosPxyzDy -> ParabolPosPxyzDy -> Bool # (/=) :: ParabolPosPxyzDy -> ParabolPosPxyzDy -> Bool # | |
Show ParabolPosPxyzDy # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ParabolPosPxyzDz | |
Fields
|
Instances
Eq ParabolPosPxyzDz # | |
Defined in Lucan.Math.Types Methods (==) :: ParabolPosPxyzDz -> ParabolPosPxyzDz -> Bool # (/=) :: ParabolPosPxyzDz -> ParabolPosPxyzDz -> Bool # | |
Show ParabolPosPxyzDz # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ParabolNegPxDx | |
Instances
Eq ParabolNegPxDx # | |
Defined in Lucan.Math.Types Methods (==) :: ParabolNegPxDx -> ParabolNegPxDx -> Bool # (/=) :: ParabolNegPxDx -> ParabolNegPxDx -> Bool # | |
Show ParabolNegPxDx # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ParabolNegPyDy | |
Instances
Eq ParabolNegPyDy # | |
Defined in Lucan.Math.Types Methods (==) :: ParabolNegPyDy -> ParabolNegPyDy -> Bool # (/=) :: ParabolNegPyDy -> ParabolNegPyDy -> Bool # | |
Show ParabolNegPyDy # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ParabolNegPzDz | |
Instances
Eq ParabolNegPzDz # | |
Defined in Lucan.Math.Types Methods (==) :: ParabolNegPzDz -> ParabolNegPzDz -> Bool # (/=) :: ParabolNegPzDz -> ParabolNegPzDz -> Bool # | |
Show ParabolNegPzDz # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ParabolNegPxyzDx | |
Fields
|
Instances
Eq ParabolNegPxyzDx # | |
Defined in Lucan.Math.Types Methods (==) :: ParabolNegPxyzDx -> ParabolNegPxyzDx -> Bool # (/=) :: ParabolNegPxyzDx -> ParabolNegPxyzDx -> Bool # | |
Show ParabolNegPxyzDx # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ParabolNegPxyzDy | |
Fields
|
Instances
Eq ParabolNegPxyzDy # | |
Defined in Lucan.Math.Types Methods (==) :: ParabolNegPxyzDy -> ParabolNegPxyzDy -> Bool # (/=) :: ParabolNegPxyzDy -> ParabolNegPxyzDy -> Bool # | |
Show ParabolNegPxyzDy # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ParabolNegPxyzDz | |
Fields
|
Instances
Eq ParabolNegPxyzDz # | |
Defined in Lucan.Math.Types Methods (==) :: ParabolNegPxyzDz -> ParabolNegPxyzDz -> Bool # (/=) :: ParabolNegPxyzDz -> ParabolNegPxyzDz -> Bool # | |
Show ParabolNegPxyzDz # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ConePosPxDx | |
Instances
Eq ConePosPxDx # | |
Defined in Lucan.Math.Types | |
Show ConePosPxDx # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ConePosPyDy | |
Instances
Eq ConePosPyDy # | |
Defined in Lucan.Math.Types | |
Show ConePosPyDy # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ConePosPzDz | |
Instances
Eq ConePosPzDz # | |
Defined in Lucan.Math.Types | |
Show ConePosPzDz # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ConePosPxyzDx | |
Fields
|
Instances
Eq ConePosPxyzDx # | |
Defined in Lucan.Math.Types Methods (==) :: ConePosPxyzDx -> ConePosPxyzDx -> Bool # (/=) :: ConePosPxyzDx -> ConePosPxyzDx -> Bool # | |
Show ConePosPxyzDx # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ConePosPxyzDy | |
Fields
|
Instances
Eq ConePosPxyzDy # | |
Defined in Lucan.Math.Types Methods (==) :: ConePosPxyzDy -> ConePosPxyzDy -> Bool # (/=) :: ConePosPxyzDy -> ConePosPxyzDy -> Bool # | |
Show ConePosPxyzDy # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ConePosPxyzDz | |
Fields
|
Instances
Eq ConePosPxyzDz # | |
Defined in Lucan.Math.Types Methods (==) :: ConePosPxyzDz -> ConePosPxyzDz -> Bool # (/=) :: ConePosPxyzDz -> ConePosPxyzDz -> Bool # | |
Show ConePosPxyzDz # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ConeNegPxDx | |
Instances
Eq ConeNegPxDx # | |
Defined in Lucan.Math.Types | |
Show ConeNegPxDx # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ConeNegPyDy | |
Instances
Eq ConeNegPyDy # | |
Defined in Lucan.Math.Types | |
Show ConeNegPyDy # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ConeNegPzDz | |
Instances
Eq ConeNegPzDz # | |
Defined in Lucan.Math.Types | |
Show ConeNegPzDz # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ConeNegPxyzDx | |
Fields
|
Instances
Eq ConeNegPxyzDx # | |
Defined in Lucan.Math.Types Methods (==) :: ConeNegPxyzDx -> ConeNegPxyzDx -> Bool # (/=) :: ConeNegPxyzDx -> ConeNegPxyzDx -> Bool # | |
Show ConeNegPxyzDx # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ConeNegPxyzDy | |
Fields
|
Instances
Eq ConeNegPxyzDy # | |
Defined in Lucan.Math.Types Methods (==) :: ConeNegPxyzDy -> ConeNegPxyzDy -> Bool # (/=) :: ConeNegPxyzDy -> ConeNegPxyzDy -> Bool # | |
Show ConeNegPxyzDy # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
ConeNegPxyzDz | |
Fields
|
Instances
Eq ConeNegPxyzDz # | |
Defined in Lucan.Math.Types Methods (==) :: ConeNegPxyzDz -> ConeNegPxyzDz -> Bool # (/=) :: ConeNegPxyzDz -> ConeNegPxyzDz -> Bool # | |
Show ConeNegPxyzDz # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
TorusPxyzDx | |
Instances
Eq TorusPxyzDx # | |
Defined in Lucan.Math.Types | |
Show TorusPxyzDx # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
TorusPxyzDy | |
Instances
Eq TorusPxyzDy # | |
Defined in Lucan.Math.Types | |
Show TorusPxyzDy # | |
Defined in Lucan.Math.Types Methods 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\]
Constructors
TorusPxyzDz | |
Instances
Eq TorusPxyzDz # | |
Defined in Lucan.Math.Types | |
Show TorusPxyzDz # | |
Defined in Lucan.Math.Types Methods showsPrec :: Int -> TorusPxyzDz -> ShowS # show :: TorusPxyzDz -> String # showList :: [TorusPxyzDz] -> ShowS # |
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
|
Datatype for the orientation (direction) of an axis.
Datatype for ascending or descending order.
Datatype for the unit of an angle which could either be radiant or degrees.
Optics.Types
The Datatype System represents the whole optical system.
Constructors
System | |
Fields
|
A Part is a physical object with a geometric shell and a material that light can interact with.
Constructors
Part | |
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
|
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 : mRefract = Refract infinity ; mTransmit = Transmit 0
- ideal transmitters : mTransmit = Transmit 1
Constructors
Material | |
Datatype for different methods of how to determine the refractive index
Constructors
Refract Double | constant refractive index independent of wavelength |
RefractSellmeier SellmeierCatalog String | refractive index calculated by the Sellmeier equation. Therefore a SellmeierCatalog with a valid material-key must be given |
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. Please see the examples on how to use this.
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 | |
Instances
Eq SellmeierCoefficients # | |
Defined in Lucan.Optics.Types Methods (==) :: SellmeierCoefficients -> SellmeierCoefficients -> Bool # (/=) :: SellmeierCoefficients -> SellmeierCoefficients -> Bool # | |
Show SellmeierCoefficients # | |
Defined in Lucan.Optics.Types Methods showsPrec :: Int -> SellmeierCoefficients -> ShowS # show :: SellmeierCoefficients -> String # showList :: [SellmeierCoefficients] -> ShowS # |
The value for internal transmittance \( T_i \) of a material is between 0 and 1 and describes the preservation of irradiance in a unit depth \(d\) of 1cm. Info: 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
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
Eq DeflectMethod # | |
Defined in Lucan.Optics.Types Methods (==) :: DeflectMethod -> DeflectMethod -> Bool # (/=) :: DeflectMethod -> DeflectMethod -> Bool # | |
Show DeflectMethod # | |
Defined in Lucan.Optics.Types Methods 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.
Constructors
Ray | |
Fields
|
Datatype for the result after raytracing.
Constructors
Raytrace | |
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 | |
Instances
Eq Intersection # | |
Defined in Lucan.Optics.Types | |
Show Intersection # | |
Defined in Lucan.Optics.Types Methods showsPrec :: Int -> Intersection -> ShowS # show :: Intersection -> String # showList :: [Intersection] -> ShowS # |
Functions
Math.Create
angularLines2d :: Double -> Int -> [Line] #
Creates a 2d-cone of lines in the xy-plane with the same origin (0,0,0) and central direction (1,0,0).
Parameters:
Double :
aperture angle of the lines in degreesInt :
number of lines[Line] :
resulting lines
Example:
lines = angularLines2d 15 10
Available in: Free | Base | Pro
angularLines3d :: Double -> Int -> [Line] #
Creates a cone of lines in 3d with the same origin (0,0,0) and central direction (1,0,0).
Parameters:
Double :
aperture angle of the lines in degreesInt :
number of lines[Line] :
resulting lines
Example:
lines = angularLines3d 15 200
Available in: Free | Base | Pro
parallelLines2d :: Double -> Int -> [Line] #
Creates a list of parallel lines in yz-plane in positve x-direction. The origin of the beam center is in (0,0,0).
Parameters:
Double :
lines widthInt :
number of lines[Line] :
resulting lines
Available in: Free | Base | Pro
parallelLines3d :: Double -> Int -> [Line] #
Creates a list of parallel lines with circular profile in positive x-direction. The orgin of the beam center is in (0,0,0).
Parameters:
Double :
lines width (diameter)Int :
number of lines[Line] :
resulting lines
Available in: Free | Base | Pro
Math.Transform
moveLine :: V3 Double -> V3 Double -> Line -> Line #
6-Parameter Transformation of a Line. This function can be used to move a newly created line to some arbitrary orientation and position.
Parameters:
V3 Double :
euler angles(alpha, beta, gamma)
in degrees of the rotation matrix for the new orientation. The order of rotation is:- Rotate around z-Axis with angle alpha
- Rotate around x-Axis with angle beta
- Rotate around z-Axis with angle gamma
V3 Double :
translation vector(tx, ty, tz)
to the new positionLine :
line to transformLine :
resulting line
Available in: Free | Base | Pro
moveLines :: V3 Double -> V3 Double -> [Line] -> [Line] #
6-Parameter Transformation of multiple Lines. The transformation parameters are the same as in moveLine
.
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
getBoxDiameter :: Box -> Double #
Calculates the diameter of a box.
Available in: Free | Base | Pro
Optics.Raytrace
traceRay :: System -> Ray -> Raytrace #
This Function is for trace a single ray through a system. The raytrace ends when the source ray or any deflected ray of the trace has no more next intersection. This also means if a ray does not hit any surface, it won't be added to the raytrace and therefore is not visualized. To visualize all possible rays, you can add a part which is a bounding box around all the other parts of the system. This way there is an intersection where an escaping ray hits the bounding box and it will be visualized. The bounding box should be of the same material as the surrounding to ensure that there is no deflection.
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.
Available in: Free | Base | Pro
Optics.Util
getPartsForPoint :: System -> V3 Double -> [Part] #
Returns the list of parts where a point lies inside.
Available in: Base | Pro
isInsidePart :: Part -> V3 Double -> Bool #
Tests if a point lies inside an part.
Parameters:
Part :
partV3 Double :
pointBool :
boolean return value
Available in: Base | Pro
toRays :: Double -> Material -> [Line] -> [Ray] #
Converts lines in a bulk to rays by assigning them all the same optical properties. Be careful with this function, since all line origins should lie within parts of the same material that is assigned.
Parameters:
Double :
wavelength of the rays light in vacuum in micrometersMaterial :
assigned material where the orgins lie in[Line] :
list of halflines[Ray] :
list of resulting rays
Available in: Free | Base | Pro
UI.Export
exportParts :: FilePath -> Double -> Box -> [Part] -> IO () #
Exports parts in various formats for import into external CAD programs. The file format is identified by the extension in the filepath. The following formats are supported:
- XYZ (extension .xyz): Sampled 3d points on the part shells are saved in a text file. Each line consists of the coordinates of one point separated by a whitespace. There is no separation between different parts in the exported file.
- STEP (extension .stp or .step): 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.
Parameters:
FilePath :
output filepath, a relative path is possibleDouble :
resolution of a point sampling on the parts shellsBox :
bounding box that encloses the parts[Part] :
parts to exportIO () :
returned IO action
Available in: Base | Pro
UI.View
initView :: String -> V2 Int -> V2 Int -> Box -> IO View #
Before visualizing any graphical content a view object must be initialized with initView
. It's possible to create multiple view instances. The view coordinate system is such that the coordinate origin (0,0,0) lies in the center of the screen and the x-axis points to the right and the y-axis to the top. The z-axis points upward from the screen into the users eye. Call this function within an IO block.
Parameters:
String :
window titleV2 Int :
window sizeV2 Int :
window positionBox :
bounding box of the volume to renderIO View :
returned IO action with the view
Example:
view <- initView "myTitle" (800,600) (100,100) ((20,20),(20,20),(20,20))
Available in: Free | Base | Pro
Shows a view and runs its renderloop. Call this function within an IO block. 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: Some graphic content, such as the parts, is 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
Available in: Free | Base | Pro
Shows multiple views and runs their mainloops. User interactions are accepted for each of them. Call this function within an IO block.
Available in: Free | Base | Pro
viewParts :: View -> [Part] -> IO () #
Adds parts to a view. Call this function within an IO block.
Available in: Free | Base | Pro
viewPoint :: View -> V3 Double -> IO () #
Adds a single point to a view. Call this function within an IO block.
Available in: Free | Base | Pro
viewPoints :: View -> [V3 Double] -> IO () #
Adds multiple points to a view. Call this function within an IO block.
Available in: Free | Base | Pro
viewLine :: View -> Line -> IO () #
Adds a single line to a view. Call this function within an IO block.
Available in: Free | Base | Pro
viewLines :: View -> [Line] -> IO () #
Adds multiple lines to a view. Call this function within an IO block.
Available in: Free | Base | Pro
viewRay :: View -> Ray -> IO () #
Adds a single ray to a view. Call this function within an IO block.
Available in: Free | Base | Pro
viewRays :: View -> [Ray] -> IO () #
Adds multiple rays to a view. Call this function within an IO block.
Available in: Free | Base | Pro
viewRaytrace :: View -> Raytrace -> IO () #
Adds a single raytrace to a view. Call this function within an IO block.
Available in: Free | Base | Pro
viewRaytraces :: View -> [Raytrace] -> IO () #
Adds multiple raytraces to a view. Call this function within an IO block.
Available in: Free | Base | Pro