Copyright | (c) 2011 diagrams-lib team (see LICENSE) |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | diagrams-discuss@googlegroups.com |
Safe Haskell | None |
Language | Haskell2010 |
Various three-dimensional shapes.
- class Skinned t where
- 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
Types which can be rendered as 3D Diagrams.
skin :: (Renderable t b, N t ~ n, TypeableFloat n) => t -> QDiagram b V3 n Any #
Basic 3D shapes
OrderedField n => Enveloped (Ellipsoid n) # | |
OrderedField n => Traced (Ellipsoid n) # | |
Fractional n => Transformable (Ellipsoid n) # | |
OrderedField n => Skinned (Ellipsoid n) # | |
Fractional n => Renderable (Ellipsoid n) NullBackend # | |
(Num n, Ord n) => HasQuery (Ellipsoid n) Any # | |
type V (Ellipsoid n) # | |
type N (Ellipsoid n) # | |
Box (Transformation V3 n) |
OrderedField n => Enveloped (Box n) # | |
(Fractional n, Ord n) => Traced (Box n) # | |
Fractional n => Transformable (Box n) # | |
OrderedField n => Skinned (Box n) # | |
Fractional n => Renderable (Box n) NullBackend # | |
(Num n, Ord n) => HasQuery (Box n) Any # | |
type V (Box n) # | |
type N (Box n) # | |
A cube with side length 1, in the positive octant, with one vertex at the origin.
Frustum n n (Transformation V3 n) |
(OrderedField n, RealFloat n) => Enveloped (Frustum n) # | |
(RealFloat n, Ord n) => Traced (Frustum n) # | |
Fractional n => Transformable (Frustum n) # | |
Skinned (Frustum n) # | |
Fractional n => Renderable (Frustum n) NullBackend # | |
OrderedField n => HasQuery (Frustum n) Any # | |
type V (Frustum n) # | |
type 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
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) |
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. |
(RealFloat n, Ord n) => Traced (CSG n) # | |
Fractional n => Transformable (CSG n) # | |
(RealFloat n, Ord n) => Skinned (CSG n) # | |
(Floating n, Ord n) => HasQuery (CSG n) Any # | |
type V (CSG n) # | |
type 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 #