Module

# Graphics.Isometric

Package
purescript-isometric
Repository
sharkdp/purescript-isometric

### #FaceSource

``type Face = ThreeOrMore Point``

A `Face` is a list of (at least) three points which all lie in a plane.

### #ShapeSource

``type Shape = List Face``

A Shape consists of several `Face`s.

### #extrudeSource

``extrude :: ThreeOrMore Point -> Number -> Shape``

Project a 2D path onto the xy plane and extrude it by the given height.

### #extrudeConeSource

``extrudeCone :: ThreeOrMore Point -> Number -> Shape``

Create a cone-like object by extruding the points from a base path in the xy plane to a single point above (or below) it.

### #prismSource

``prism :: Point -> Number -> Number -> Number -> Shape``

A prism, constructed from a given corner point and the width, height and depth (dimensions in x, y, and z-direction).

### #cubeSource

``cube :: Point -> Number -> Shape``

A cube is a prism with three equal sides.

### #coneSource

``cone :: Point -> Int -> Number -> Number -> Shape``

A cone, determined by the center of the bottom face, the number of sides, the radius and the height.

### #pyramidSource

``pyramid :: Point -> Number -> Number -> Shape``

A four-sided pyramid, determined by the center of the bottom face, the base length and the height.

### #pyramid3Source

``pyramid3 :: Point -> Number -> Number -> Shape``

A three-sided pyramid, determined by the center of the bottom face, the base length and the height.

### #cylinderSource

``cylinder :: Point -> Int -> Number -> Number -> Shape``

A cylinder, determined by the center of the bottom face, the number of sides, the radius and the height.

### #SceneSource

``data Scene``

Main data type for the description of a 3D isometric scene.

#### Constructors

• `Fill Color Shape`
• `Many (List Scene)`

#### Instances

• `Semigroup Scene`
• `Monoid Scene`

### #translateXSource

``translateX :: Number -> Scene -> Scene``

Translate a scene by a given offset in x-direction.

### #translateYSource

``translateY :: Number -> Scene -> Scene``

Translate a scene by a given offset in y-direction.

### #translateZSource

``translateZ :: Number -> Scene -> Scene``

Translate a scene by a given offset in z-direction.

### #rotateXSource

``rotateX :: Angle -> Scene -> Scene``

Rotate a scene around the x-axis.

### #rotateYSource

``rotateY :: Angle -> Scene -> Scene``

Rotate a scene around the y-axis.

### #rotateZSource

``rotateZ :: Angle -> Scene -> Scene``

Rotate a scene around the z-axis.

### #scaleSource

``scale :: Number -> Scene -> Scene``

Scale a scene by a multiplicative factor (with respect to the origin).

### #filledSource

``filled :: Color -> Shape -> Scene``

Fill a shape with a given base color. Individual faces can be brighter.

### #renderSceneSource

``renderScene :: Vector -> Scene -> Drawing``

Render a three-dimensional `Scene` into a two-dimensional `Drawing`, using an isometric projection. The vector determines the direction of light.

## Re-exports from Color

### #ColorSource

``data Color``

The representation of a color.

Note:

• The `Eq` instance compares two `Color`s by comparing their (integer) RGB values. This is different from comparing the HSL values (for example, HSL has many different representations of black (arbitrary hue and saturation values).
• Colors outside the sRGB gamut which cannot be displayed on a typical computer screen can not be represented by `Color`.

#### Instances

• `Show Color`
• `Eq Color`

## Re-exports from Data.List.ThreeOrMore

### #ThreeOrMoreSource

``type ThreeOrMore a = NonEmpty (NonEmpty (NonEmpty List)) a``

### #toListSource

``toList :: forall a. ThreeOrMore a -> List a``

### #reverseSource

``reverse :: forall a. ThreeOrMore a -> ThreeOrMore a``

### #lastSource

``last :: forall a. ThreeOrMore a -> a``

## Re-exports from Graphics.Isometric.Types

### #VectorSource

``type Vector = Point``

A vector or direction.

### #PointSource

``type Point = { x :: Number, y :: Number, z :: Number }``

A 3D point.

### #AngleSource

``type Angle = Number``