<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "klayout_doc.dtd">

<doc>

  <title>Creating Clips</title>
  <keyword name="Clip"/>

  <p>
  KLayout provides a utility to create rectangular clips from a given cell.
  One or more rectangles can be specified. The current cell is cut along the edges of these rectangles.
  For each rectangle, a new cell is created containing the clipped content for the rectangle. Finally, if more
  than one rectangle is specified, all the clips are combined into a master top cell which appears as a new
  top cell in the cell hierarchy.
  </p>

  <p>
  The clips can be either specified by coordinates, taken from another layer (which must contain boxes which then are 
  copied into the output as well) or taken from the rulers. In the latter case, the rulers' start and end
  points are taken as the corners of the clip rectangles. It is convenient therefore to create a new ruler type
  with a box appearance for this purpose.
  </p>

  <p>
  Clips are done hierarchically: child cells are clipped as well, potentially creating variants (which may be shared 
  by several clips). This way, large clips can be created from large layouts in an efficient way.
  <b>Hint:</b> Clipping will not work exactly if the layout contains cell instances with arbitrary rotation
  angles such as 45 degree.
  </p>

</doc>

