next up previous contents index
Next: The !jw Command: Join Up: Layout Editing Previous: The !bloat Command: Expand   Contents   Index


The !join Command: Join Touching Objects

Syntax: !join [-l | -a]

This command will merge boxes, polygons, and optionally wires into complex polygons. Use of merged geometry can reduce memory use and the size of the layout data file.

The Join, Join Lyr, and Join All buttons in the Join or Split Objects panel from the Join/Split button in the Edit Menu provide an equivalent to the !join command.

There are three basic operating modes. The !join command without arguments will join only selected objects. With the ``layer'' argument, all objects on the current layer may be joined, With the ``all'' argument, objects on any layer may be joined.' In these two cases, objects will be joined whether selected or not. For the arguments, the traditional ``-'' is actually optional, and only the first letter is considered, case insensitive, So, ``!join -a'', ``!join All'', and ``!join apple'' are all equivalent.

If a layer has the NoMerge keyword applied, in general joining (merging) is forbidden on the layer. However, this is overridden by the !join command without arguments. In this mode, the user must select the objects to join, and it is assumed that the user really wants them joined. In the other modes, objects on layers with this keyword set will not be joined. The user must first remove the keyword with the Tech Parameter Editor from the Attributes Menu, or otherwise.

In any case, the layer must be visible. With the ``all'' option, the layer must also be selectable.

The !join command, the Join, Join Lyr, and Join All buttons, the Join, JoinObjects and GroupObjects script functions, and other commands such as !layer which perform a join operation, are sensitive to four variables which fine-tune the behavior and performance. The default values emphasize speed but limit the complexity of resulting polygons. The user may need to set one or more of these variables in order for the operation to meet requirements. These variables can be set from the Join or Split Objects panel, using the analogous controls.

In addition, the JoinSplitWires variable, which also has a corresponding check box in the Join or Split Objects panel, determines whether wires are included in join operations. By default, wires do not participate in the join, however if the variable (or equivalently, the check box) is set, wires will behave the same as polygons.

To join a set of objects, the first step internally is to decompose each object onto a collection of trapezoids. As the objects are decomposed, the trapezoids are added to a list, which will be sent on to the function which performs the join. The variable JoinMaxPolyQueue sets the limit on the number of trapezoids that can accumulate before the list is processed. All or none of the trapezoids from a given object are added to the list, i.e., objects are not broken up at this point. If the addition of the trapezoids would cause the list to exceed the limit, then the list is sent on for processing, and a new list started. If JoinMaxPolyQueue is set to 0, there is no limit, and only a single list will be processed. When this variable is not set, the effective default value is 0 (no limit).

When a list is sent on for processing, the first operation is to break up the list into groups. Each group contains one or more trapezoids, such that the trapezoids in each group are ``connected'', i.e., the aggregate forms a single figure. The variable JoinMaxPolyGroup specifies a limit on the number of trapezoids in any single group. If this limit is reached, no additional trapezoids are added, instead they are placed in a new group or possibly some other existing group. If this variable is set to 0, then no limit is applied, and in this case all groups are guaranteed to be disjoint. When this variable is not set, the effective default value is 0 (no limit).

For each group, one or more polygons are created, which exactly cover the area of the trapezoids. The variable JoinMaxPolyVerts specifies a limit on the number of vertices which can appear in any single polygon. Thus, if the limit is reached, more than one polygon will be generated. If this variable is set to 0, then no limit is applied, and a single polygon will be created for each group. When this variable is not set, the effective default value is 600.

When the effective value of JoinMaxPolyVerts is nonzero, the JoinBreakClean variable determines now the partitioning is done. If this variable is not set, then the polygons are built up by adding trapezoids until the vertex limit is reached, at which point a new polygon is started, and constructed using the remaining trapezoids. The process continues until all trapezoids have been included in a polygon. The resulting collection of polygons may have complicated boundaries that interleave in a rather random way.

If JoinBreakClean is set, the vertex limit is initially ignored, and a single polygon is created from all of the trapezoids. If the vertex limit is exceeded, the polygon is split in two pieces, either horizontally or vertically. If either piece still exceeds the limit, it is subdivided in the same way, and so on until all polygons are within the limit. In this case, the boundaries are Manhattan. This processing is more compute-intensive than the other approach, but provides a better looking layout.


next up previous contents index
Next: The !jw Command: Join Up: Layout Editing Previous: The !bloat Command: Expand   Contents   Index
Stephen R. Whiteley 2022-05-28