diagrams-lib-1.4.1.2: Embedded domain-specific language for declarative graphics

Copyright(c) 2011 diagrams-lib team (see LICENSE)
LicenseBSD-style (see LICENSE)
Maintainerdiagrams-discuss@googlegroups.com
Safe HaskellNone
LanguageHaskell2010

Diagrams.ThreeD.Shapes

Contents

Description

Various three-dimensional shapes.

Synopsis

Skinned class

class Skinned t where #

Types which can be rendered as 3D Diagrams.

Minimal complete definition

skin

Methods

skin :: (Renderable t b, N t ~ n, TypeableFloat n) => t -> QDiagram b V3 n Any #

Instances

(RealFloat n, Ord n) => Skinned (CSG n) # 

Methods

skin :: (Renderable (CSG n) b, (* ~ N (CSG n)) n, TypeableFloat n) => CSG n -> QDiagram b V3 n Any #

Skinned (Frustum n) # 

Methods

skin :: (Renderable (Frustum n) b, (* ~ N (Frustum n)) n, TypeableFloat n) => Frustum n -> QDiagram b V3 n Any #

OrderedField n => Skinned (Box n) # 

Methods

skin :: (Renderable (Box n) b, (* ~ N (Box n)) n, TypeableFloat n) => Box n -> QDiagram b V3 n Any #

OrderedField n => Skinned (Ellipsoid n) # 

Methods

skin :: (Renderable (Ellipsoid n) b, (* ~ N (Ellipsoid n)) n, TypeableFloat n) => Ellipsoid n -> QDiagram b V3 n Any #

Basic 3D shapes

data Ellipsoid n #

Constructors

Ellipsoid (Transformation V3 n) 

Instances

OrderedField n => Enveloped (Ellipsoid n) # 

Methods

getEnvelope :: Ellipsoid n -> Envelope (V (Ellipsoid n)) (N (Ellipsoid n)) #

OrderedField n => Traced (Ellipsoid n) # 

Methods

getTrace :: Ellipsoid n -> Trace (V (Ellipsoid n)) (N (Ellipsoid n)) #

Fractional n => Transformable (Ellipsoid n) # 
OrderedField n => Skinned (Ellipsoid n) # 

Methods

skin :: (Renderable (Ellipsoid n) b, (* ~ N (Ellipsoid n)) n, TypeableFloat n) => Ellipsoid n -> QDiagram b V3 n Any #

Fractional n => Renderable (Ellipsoid n) NullBackend # 
(Num n, Ord n) => HasQuery (Ellipsoid n) Any # 

Methods

getQuery :: Ellipsoid n -> Query (V (Ellipsoid n)) (N (Ellipsoid n)) Any #

type V (Ellipsoid n) # 
type V (Ellipsoid n) = V3
type N (Ellipsoid n) # 
type N (Ellipsoid n) = n

sphere :: Num n => Ellipsoid n #

A sphere of radius 1 with its center at the origin.

data Box n #

Constructors

Box (Transformation V3 n) 

Instances

OrderedField n => Enveloped (Box n) # 

Methods

getEnvelope :: Box n -> Envelope (V (Box n)) (N (Box n)) #

(Fractional n, Ord n) => Traced (Box n) # 

Methods

getTrace :: Box n -> Trace (V (Box n)) (N (Box n)) #

Fractional n => Transformable (Box n) # 

Methods

transform :: Transformation (V (Box n)) (N (Box n)) -> Box n -> Box n #

OrderedField n => Skinned (Box n) # 

Methods

skin :: (Renderable (Box n) b, (* ~ N (Box n)) n, TypeableFloat n) => Box n -> QDiagram b V3 n Any #

Fractional n => Renderable (Box n) NullBackend # 

Methods

render :: NullBackend -> Box n -> Render NullBackend (V (Box n)) (N (Box n)) #

(Num n, Ord n) => HasQuery (Box n) Any # 

Methods

getQuery :: Box n -> Query (V (Box n)) (N (Box n)) Any #

type V (Box n) # 
type V (Box n) = V3
type N (Box n) # 
type N (Box n) = n

cube :: Num n => Box n #

A cube with side length 1, in the positive octant, with one vertex at the origin.

data Frustum n #

Constructors

Frustum n n (Transformation V3 n) 

Instances

(OrderedField n, RealFloat n) => Enveloped (Frustum n) # 

Methods

getEnvelope :: Frustum n -> Envelope (V (Frustum n)) (N (Frustum n)) #

(RealFloat n, Ord n) => Traced (Frustum n) # 

Methods

getTrace :: Frustum n -> Trace (V (Frustum n)) (N (Frustum n)) #

Fractional n => Transformable (Frustum n) # 

Methods

transform :: Transformation (V (Frustum n)) (N (Frustum n)) -> Frustum n -> Frustum n #

Skinned (Frustum n) # 

Methods

skin :: (Renderable (Frustum n) b, (* ~ N (Frustum n)) n, TypeableFloat n) => Frustum n -> QDiagram b V3 n Any #

Fractional n => Renderable (Frustum n) NullBackend # 

Methods

render :: NullBackend -> Frustum n -> Render NullBackend (V (Frustum n)) (N (Frustum n)) #

OrderedField n => HasQuery (Frustum n) Any # 

Methods

getQuery :: Frustum n -> Query (V (Frustum n)) (N (Frustum n)) Any #

type V (Frustum n) # 
type V (Frustum n) = V3
type N (Frustum n) # 
type N (Frustum n) = n

frustum :: Num n => n -> n -> Frustum n #

A frustum of a right circular cone. It has height 1 oriented along the positive z axis, and radii r0 and r1 at Z=0 and Z=1. cone and cylinder are special cases.

cone :: Num n => Frustum n #

A cone with its base centered on the origin, with radius 1 at the base, height 1, and it's apex on the positive Z axis.

cylinder :: Num n => Frustum n #

A circular cylinder of radius 1 with one end cap centered on the origin, and extending to Z=1.

Constructive solid geometry

data CSG n #

A tree of Constructive Solid Geometry operations and the primitives that can be used in them.

Instances

RealFloat n => Enveloped (CSG n) #

The Envelope for an Intersection or Difference is simply the Envelope of the Union. This is wrong but easy to implement.

Methods

getEnvelope :: CSG n -> Envelope (V (CSG n)) (N (CSG n)) #

(RealFloat n, Ord n) => Traced (CSG n) # 

Methods

getTrace :: CSG n -> Trace (V (CSG n)) (N (CSG n)) #

Fractional n => Transformable (CSG n) # 

Methods

transform :: Transformation (V (CSG n)) (N (CSG n)) -> CSG n -> CSG n #

(RealFloat n, Ord n) => Skinned (CSG n) # 

Methods

skin :: (Renderable (CSG n) b, (* ~ N (CSG n)) n, TypeableFloat n) => CSG n -> QDiagram b V3 n Any #

(Floating n, Ord n) => HasQuery (CSG n) Any # 

Methods

getQuery :: CSG n -> Query (V (CSG n)) (N (CSG n)) Any #

type V (CSG n) # 
type V (CSG n) = V3
type N (CSG n) # 
type N (CSG n) = n

union :: (CsgPrim a, CsgPrim b) => a n -> b n -> CSG n #

intersection :: (CsgPrim a, CsgPrim b) => a n -> b n -> CSG n #

difference :: (CsgPrim a, CsgPrim b) => a n -> b n -> CSG n #