Copyright | (c) 2011 diagrams-lib team (see LICENSE) |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | diagrams-discuss@googlegroups.com |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Various three-dimensional shapes.
Synopsis
- class Skinned t where
- skin :: (Renderable t b, N t ~ n, TypeableFloat n) => t -> QDiagram b V3 n Any
- data Ellipsoid n = Ellipsoid (Transformation V3 n)
- sphere :: Num n => Ellipsoid n
- data Box n = Box (Transformation V3 n)
- cube :: Num n => Box n
- data Frustum n = Frustum n n (Transformation V3 n)
- frustum :: Num n => n -> n -> Frustum n
- cone :: Num n => Frustum n
- cylinder :: Num n => Frustum n
- data CSG n
- = CsgEllipsoid (Ellipsoid n)
- | CsgBox (Box n)
- | CsgFrustum (Frustum n)
- | CsgUnion [CSG n]
- | CsgIntersection [CSG n]
- | CsgDifference (CSG n) (CSG 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
Skinned class
class Skinned t where Source #
Types which can be rendered as 3D Diagrams.
skin :: (Renderable t b, N t ~ n, TypeableFloat n) => t -> QDiagram b V3 n Any Source #
Instances
OrderedField n => Skinned (Box n) Source # | |
Defined in Diagrams.ThreeD.Shapes | |
(RealFloat n, Ord n) => Skinned (CSG n) Source # | |
Defined in Diagrams.ThreeD.Shapes | |
OrderedField n => Skinned (Ellipsoid n) Source # | |
Defined in Diagrams.ThreeD.Shapes | |
Skinned (Frustum n) Source # | |
Defined in Diagrams.ThreeD.Shapes |
Basic 3D shapes
Instances
OrderedField n => Enveloped (Ellipsoid n) Source # | |
Defined in Diagrams.ThreeD.Shapes | |
OrderedField n => Traced (Ellipsoid n) Source # | |
Fractional n => Transformable (Ellipsoid n) Source # | |
Defined in Diagrams.ThreeD.Shapes | |
OrderedField n => Skinned (Ellipsoid n) Source # | |
Defined in Diagrams.ThreeD.Shapes | |
Fractional n => Renderable (Ellipsoid n) NullBackend Source # | |
Defined in Diagrams.ThreeD.Shapes render :: NullBackend -> Ellipsoid n -> Render NullBackend (V (Ellipsoid n)) (N (Ellipsoid n)) # | |
(Num n, Ord n) => HasQuery (Ellipsoid n) Any Source # | |
type N (Ellipsoid n) Source # | |
Defined in Diagrams.ThreeD.Shapes | |
type V (Ellipsoid n) Source # | |
Defined in Diagrams.ThreeD.Shapes |
Box (Transformation V3 n) |
Instances
OrderedField n => Enveloped (Box n) Source # | |
Defined in Diagrams.ThreeD.Shapes | |
(Fractional n, Ord n) => Traced (Box n) Source # | |
Fractional n => Transformable (Box n) Source # | |
Defined in Diagrams.ThreeD.Shapes | |
OrderedField n => Skinned (Box n) Source # | |
Defined in Diagrams.ThreeD.Shapes | |
Fractional n => Renderable (Box n) NullBackend Source # | |
Defined in Diagrams.ThreeD.Shapes render :: NullBackend -> Box n -> Render NullBackend (V (Box n)) (N (Box n)) # | |
(Num n, Ord n) => HasQuery (Box n) Any Source # | |
type N (Box n) Source # | |
Defined in Diagrams.ThreeD.Shapes | |
type V (Box n) Source # | |
Defined in Diagrams.ThreeD.Shapes |
cube :: Num n => Box n Source #
A cube with side length 1, in the positive octant, with one vertex at the origin.
Frustum n n (Transformation V3 n) |
Instances
(OrderedField n, RealFloat n) => Enveloped (Frustum n) Source # | |
Defined in Diagrams.ThreeD.Shapes | |
(RealFloat n, Ord n) => Traced (Frustum n) Source # | |
Fractional n => Transformable (Frustum n) Source # | |
Defined in Diagrams.ThreeD.Shapes | |
Skinned (Frustum n) Source # | |
Defined in Diagrams.ThreeD.Shapes | |
Fractional n => Renderable (Frustum n) NullBackend Source # | |
Defined in Diagrams.ThreeD.Shapes render :: NullBackend -> Frustum n -> Render NullBackend (V (Frustum n)) (N (Frustum n)) # | |
OrderedField n => HasQuery (Frustum n) Any Source # | |
type N (Frustum n) Source # | |
Defined in Diagrams.ThreeD.Shapes | |
type V (Frustum n) Source # | |
Defined in Diagrams.ThreeD.Shapes |
cone :: Num n => Frustum n Source #
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 Source #
A circular cylinder of radius 1 with one end cap centered on the origin, and extending to Z=1.
Constructive solid geometry
A tree of Constructive Solid Geometry operations and the primitives that can be used in them.
CsgEllipsoid (Ellipsoid n) | |
CsgBox (Box n) | |
CsgFrustum (Frustum n) | |
CsgUnion [CSG n] | |
CsgIntersection [CSG n] | |
CsgDifference (CSG n) (CSG n) |
Instances
RealFloat n => Enveloped (CSG n) Source # | The Envelope for an Intersection or Difference is simply the Envelope of the Union. This is wrong but easy to implement. |
Defined in Diagrams.ThreeD.Shapes | |
(RealFloat n, Ord n) => Traced (CSG n) Source # | |
Fractional n => Transformable (CSG n) Source # | |
Defined in Diagrams.ThreeD.Shapes | |
(RealFloat n, Ord n) => Skinned (CSG n) Source # | |
Defined in Diagrams.ThreeD.Shapes | |
(Floating n, Ord n) => HasQuery (CSG n) Any Source # | |
type N (CSG n) Source # | |
Defined in Diagrams.ThreeD.Shapes | |
type V (CSG n) Source # | |
Defined in Diagrams.ThreeD.Shapes |
intersection :: (CsgPrim a, CsgPrim b) => a n -> b n -> CSG n Source #
difference :: (CsgPrim a, CsgPrim b) => a n -> b n -> CSG n Source #