next up previous contents index
Next: The !area Command: Measure Up: Physical Previous: The !poly2path Command: Polygon   Contents   Index


The !bloat Command: Expand Objects

Syntax: !bloat dimen [mode]
The dimen is a dimension in microns. The command will operate on selected objects, and alter the dimensions according to the dimen given. If in layer-specific mode, only selected objects on the current layer are acted on, otherwise all selected objects are acted on. If the dimen is positive, the parts of edges that do not contact or overlap with an object on the same layer will be pushed out by dimen, expanding the objects. If dimen is negative, the reverse occurs: objects will shrink, but adjacent objects will remain touching. Objects may be severed into two or more pieces if the dimen is negative, or may disappear entirely.

Presently, there are four bloating algorithms available, selectable by an optional numeric second argument. If this argument is missing or 0, the default algorithm will be used.

Only boxes, wires and polygons are affected. Wires and boxes become polygons after the operation. An object is deselected if it is modified.

mode = 0 (default)

In the description, we assume that the object is being expanded, i.e., the dimen is greater than zero. For each edge, an extension out of the object normal to the edge is created. For each corner where the edge projections do not overlap, a 4-sided polygon is created. Three of the vertices are the figure corner vertex and the ends of the two adjacent projections. The fourth vertex is placed along the bisector of the angle formed by the other three vertices, a distance dimen from the object corner vertex. All of the projections are joined to the original object to create the expanded object. Note that the corners become rounded, i.e., bloated rectangles become polygons. Figure 14.1 illustrates the algorithm.

Figure 14.1: The default algorithm used in the !bloat command to enlarge an object.
\begin{figure}
\vspace{1.5ex}
\begin{center}
\epsfbox{bloat.eps}
\end{center}\end{figure}

If the dimen is less than zero, the object will be shrunk. In this case, the projections extend into the object, and the new object is formed by clipping these regions from the object.

mode = 1

This algorithm works with a trapezoid decomposition of the objects to be modified. An expansion is very fast, but a shrink requires polarity inversion of the trapezoid list, so is somewhat slower. This algorithm is not really recommended for non-Manhattan geometry, since in working at the trapezoid level without considering adjacency, small artifacts are often introduced at non-Manhattan corners.

The algorithm takes the following steps:

If dimen > 0 (expanding):
  1. Decompose all selected objects on a given layer into a trapezoid list.
  2. Create a second list containing trapezoids derived from the edges of trapezoids in the first list, created to enclose each edge and the surrounding area to + / - dimen normal to the edge.
  3. Merge the two lists and join into polygons.

If dimen < 0 (shrinking):
  1. Decompose all selected objects on a given layer into a trapezoid list.
  2. Invert the list in a rectangle that encloses all trapezoids bloated by dimen.
  3. Create an edge trapezoid list from the inverted list.
  4. Clip out the regions of the original list that overlap trapezoids in the edge list.
  5. Merge the resulting list into polygons.

mode = 2

In this algorithm, for dimen larger than 0, the objects are first joined into maximal polygons, i.e., no two of these polygons abut or overlap. The vertex list of each polygon is used to construct a ``wire'' of width 2*dimen, which is then converted to a polygon representation. The wire polygon covers the edge of the original polygon, extending by dimen inside and outside of the figure. Each polygon becomes the union of the original polygon and its ``wire'' polygon. If dimen is less than zero, the geometry is inverted first as in the previous algorithm. Thus, the edge ``wires'' around the clear areas are found. These are clipped from the dark areas, yielding the final figures. Without the inversion, polygons with holes would not be processed correctly.

Note that bloating modes 1 and 2 will not round the corners, i.e., Manhattan corners remain Manhattan.

mode = 3

This is very similar to mode 0, however it uses the DRC sizing functions (this was used for mode 0 in earlier releases).

This algorithm works best if a !join is performed before the bloat. This algorithm is rather compute intensive and slower than the other algorithms. In this algorithm, parts of edges that touch an object on the same layer will not be moved, whether or not the adjacent object was selected. In the other algorithms, unselected objects are completely ignored.


next up previous contents index
Next: The !area Command: Measure Up: Physical Previous: The !poly2path Command: Polygon   Contents   Index
Stephen R. Whiteley 2006-10-23