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

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

Diagrams.ThreeD.Align

Contents

Description

Alignment combinators specialized for three dimensions. See Diagrams.Align for more general alignment combinators.

The basic idea is that alignment is achieved by moving diagrams' local origins relative to their envelopes or traces (or some other sort of boundary). For example, to align several diagrams along their tops, we first move their local origins to the upper edge of their boundary (using e.g. map alignZMax), and then put them together with their local origins along a line (using e.g. cat from Diagrams.Combinators).

Synopsis

Absolute alignment

Align by envelope

alignXMin :: (Alignable a, HasOrigin a, V a ~ R3) => a -> a Source

Translate the diagram along unitX so that all points have positive x-values.

alignXMax :: (Alignable a, HasOrigin a, V a ~ R3) => a -> a Source

Translate the diagram along unitX so that all points have negative x-values.

alignYMin :: (Alignable a, HasOrigin a, V a ~ R3) => a -> a Source

Translate the diagram along unitY so that all points have positive y-values.

alignYMax :: (Alignable a, HasOrigin a, V a ~ R3) => a -> a Source

Translate the diagram along unitY so that all points have negative y-values.

alignZMin :: (Alignable a, HasOrigin a, V a ~ R3) => a -> a Source

Translate the diagram along unitZ so that all points have positive z-values.

alignZMax :: (Alignable a, HasOrigin a, V a ~ R3) => a -> a Source

Translate the diagram along unitZ so that all points have negative z-values.

Align by trace

snugXMin :: (Fractional (Scalar (V a)), Alignable a, Traced a, HasOrigin a, V a ~ R3) => a -> a Source

snugXMax :: (Fractional (Scalar (V a)), Alignable a, Traced a, HasOrigin a, V a ~ R3) => a -> a Source

snugYMin :: (Fractional (Scalar (V a)), Alignable a, Traced a, HasOrigin a, V a ~ R3) => a -> a Source

snugYMax :: (Fractional (Scalar (V a)), Alignable a, Traced a, HasOrigin a, V a ~ R3) => a -> a Source

Move the origin along unitY until it touches the edge of the diagram.

snugZMin :: (Fractional (Scalar (V a)), Alignable a, Traced a, HasOrigin a, V a ~ R3) => a -> a Source

Move the origin along unit_Z until it touches the edge of the diagram.

snugZMax :: (Fractional (Scalar (V a)), Alignable a, Traced a, HasOrigin a, V a ~ R3) => a -> a Source

Move the origin along unitZ until it touches the edge of the diagram.

Relative alignment

alignX :: (Alignable a, HasOrigin a, V a ~ R3) => Double -> a -> a Source

alignX and snugX move the local origin along unitX as follows:

  • alignX (-1) moves the local origin to the low-x of the boundary;
  • align 1 moves the local origin to the high-x edge;
  • any other argument interpolates linearly between these. For example, alignX 0 centers, alignX 2 moves the origin one "radius" to the right of the right edge, and so on.
  • snugX works the same way.

snugX :: (Fractional (Scalar (V a)), Alignable a, Traced a, HasOrigin a, V a ~ R3) => Double -> a -> a Source

See the documentation for alignX.

alignY :: (Alignable a, HasOrigin a, V a ~ R3) => Double -> a -> a Source

Like alignX, but moving the local origin vertically, with an argument of 1 corresponding to the top edge and (-1) corresponding to the bottom edge.

snugY :: (Fractional (Scalar (V a)), Alignable a, Traced a, HasOrigin a, V a ~ R3) => Double -> a -> a Source

alignZ :: (Alignable a, HasOrigin a, V a ~ R3) => Double -> a -> a Source

Like alignX, but moving the local origin in the Z direction, with an argument of 1 corresponding to the top edge and (-1) corresponding to the bottom edge.

snugZ :: (Fractional (Scalar (V a)), Alignable a, Traced a, HasOrigin a, V a ~ R3) => Double -> a -> a Source

Centering

centerX :: (Alignable a, HasOrigin a, V a ~ R3) => a -> a Source

Center the local origin along the X-axis.

centerY :: (Alignable a, HasOrigin a, V a ~ R3) => a -> a Source

Center the local origin along the Y-axis.

centerZ :: (Alignable a, HasOrigin a, V a ~ R3) => a -> a Source

Center the local origin along the Z-axis.

centerXY :: (Alignable a, HasOrigin a, V a ~ R3) => a -> a Source

Center along both the X- and Y-axes.

centerXZ :: (Alignable a, HasOrigin a, V a ~ R3) => a -> a Source

Center along both the X- and Z-axes.

centerYZ :: (Alignable a, HasOrigin a, V a ~ R3) => a -> a Source

Center along both the Y- and Z-axes.

centerXYZ :: (Fractional (Scalar (V a)), Alignable a, Traced a, HasOrigin a, V a ~ R3) => a -> a Source

Center an object in three dimensions.

snugCenterX :: (Fractional (Scalar (V a)), Alignable a, Traced a, HasOrigin a, V a ~ R3) => a -> a Source

snugCenterY :: (Fractional (Scalar (V a)), Alignable a, Traced a, HasOrigin a, V a ~ R3) => a -> a Source

snugCenterZ :: (Fractional (Scalar (V a)), Alignable a, Traced a, HasOrigin a, V a ~ R3) => a -> a Source

snugCenterXY :: (Fractional (Scalar (V a)), Alignable a, Traced a, HasOrigin a, V a ~ R3) => a -> a Source

snugCenterXZ :: (Fractional (Scalar (V a)), Alignable a, Traced a, HasOrigin a, V a ~ R3) => a -> a Source

snugCenterYZ :: (Fractional (Scalar (V a)), Alignable a, Traced a, HasOrigin a, V a ~ R3) => a -> a Source

snugCenterXYZ :: (Fractional (Scalar (V a)), Alignable a, Traced a, HasOrigin a, V a ~ R3) => a -> a Source