-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A constructive solid geometry (CSG) modeling language. -- -- Mecha is a constructive solid geometry modeling language and compiles -- to POV-Ray and OpenSCAD. @package mecha @version 0.1.0 module Language.Mecha.Types type Vector = (Double, Double, Double) type Vertex = Vector type Normal = Vector type Color = (Double, Double, Double, Double) class Moveable a move :: Moveable a => Vector -> a -> a rotateX :: Moveable a => Double -> a -> a rotateY :: Moveable a => Double -> a -> a rotateZ :: Moveable a => Double -> a -> a class Scaleable a scale :: Scaleable a => Vector -> a -> a class Colorable a color :: Colorable a => Color -> a -> a class Setable a union :: Setable a => a -> a -> a intersection :: Setable a => a -> a -> a difference :: Setable a => a -> a -> a moveX :: Moveable a => Double -> a -> a moveY :: Moveable a => Double -> a -> a moveZ :: Moveable a => Double -> a -> a scaleAll :: Scaleable a => Double -> a -> a scaleX :: Scaleable a => Double -> a -> a scaleY :: Scaleable a => Double -> a -> a scaleZ :: Scaleable a => Double -> a -> a unions :: Setable a => [a] -> a module Language.Mecha.Solid data Solid Primitive :: [Transform] -> Color -> Primitive -> Solid Union :: Solid -> Solid -> Solid Intersection :: Solid -> Solid -> Solid Difference :: Solid -> Solid -> Solid data Primitive -- | Diameter. Sphere :: Double -> Primitive -- | Bottom diameter, top diameter, height. Cone :: Double -> Double -> Double -> Primitive -- | (x min, x max) (y min, ymax) (z min, z max). Box :: (Double, Double) -> (Double, Double) -> (Double, Double) -> Primitive data Transform Scale :: (Vector) -> Transform Move :: (Vector) -> Transform RotateX :: Double -> Transform RotateY :: Double -> Transform RotateZ :: Double -> Transform -- | A sphere with diameter, centered at origin. sphere :: Double -> Solid -- | A cone with base at the origin, given base diameter, top diameter, and -- height. cone :: Double -> Double -> Double -> Solid -- | A hollow cylinder with base at the origin, given outer diameter, inner -- diamter, and height. -- -- A box with ranges or X, Y, and Z positions. box :: (Double, Double) -> (Double, Double) -> (Double, Double) -> Solid -- | A cube with edge length, centered at origin. cube :: Double -> Solid -- | A cylinder with base at the origin, given diameter and height. cylinder :: Double -> Double -> Solid tube :: Double -> Double -> Double -> Solid -- | Arranges a solid in a radial pattern. radial :: (Double -> Solid) -> Int -> Solid instance Eq Primitive instance Eq Transform instance Eq Solid instance Colorable Solid instance Setable Solid instance Scaleable Solid instance Moveable Solid -- | Export model generation. module Language.Mecha.Export povray :: Solid -> String openSCAD :: Solid -> String -- | Mecha is a constructive solid modeling language. module Language.Mecha -- | A constructive solid geometry widget. module Language.Mecha.Examples.CSG -- | A CSG widget. csg :: Solid