next up previous contents index
Next: Attributes Up: Reference Manual Previous: Manipulating the Camera   Contents   Index

Clipping and Cropping

ePiX provides two masking operations to handle figure elements that lie far from the target: clipping (in the world) and cropping (in the screen). The ``clip box'' may be regarded as a set of ``walls''. When clipping is active, objects outside the walls are not visible. By default, the clip box is a large cube centered at the origin.

The ``crop box'' is a rectangle in the screen plane. When cropping is active, objects that project outside this rectangle are not visible. By default, the crop box is the bounding box. Since the figure is drawn (on the page) by affinely scaling the bounding box to a specified LATEX box, default cropping ensures that a figure lies inside the printed region allocated by LATEX.

Figure 3.1: Clipping and cropping a torus mesh (boxes added).

By default, clipping and cropping are off. The command clip(bool) (de)activates clipping. The argument defaults to true. The clip box may be set with the commands

  clip_box(P pt1, P pt2); // opposite corners
  clip_box(P pt);         // opposite corners pt and -pt
  clip_to (P pt);         //                  pt and P(0,0,0)
Analogously, cropping is (de)activted with crop(bool). The crop box is given by a pair of opposite corners, crop_box(pt1,pt2); third coordinates are discarded. With no arguments, the command crop_box() re-sets the crop box to the bounding box.


next up previous contents index
Next: Attributes Up: Reference Manual Previous: Manipulating the Camera   Contents   Index
Andrew D. Hwang 2004-09-04