For the functions described below, a "zoidlist" argument can
actually have the following data types:
- (int) SetZref(thing)
This function sets the reference zoidlist. The reference zoidlist
represents the current ``background'' needed by some functions and
operators which manipulate zoidlists. For example, when a zoidlist is
polarity inverted, the reference zoidlist specifies the boundary of
the inversion, i.e., the inverse of an empty zoidlist would be the
reference zoidlist.
The reference zoidlist can be set from various types of object passed
as the variable. This can be a zoidlist, or an object handle, or the
constant 0, in which case the reference zoid list will be the boundary
of the physical current cell, or a large ``infinity'' box if there is
no current cell. This is the default if no reference zoid list is
given. This function will return 1 and never fails.
- (zoidlist) GetZref()
This function returns the current reference zoidlist, which will be
empty if no reference area has been set with SetZref or
otherwise.
- (int) AdvanceZref()
This function allows iteration over the area of a large cell by
establishing a grid over the current cell area and incrementally
setting the reference area (see SetZref) to elements of the
grid. The grid is aligned from the lower-left corner and iteration
advances right and up. The reference area is set to the intersection
of the grid element area and the bounding box of the current cell.
The size of the square grid elements is given by the LayerPartSize variable, or defaults to 100 microns if this variable
is not set.
With the boolean argument set to zero, the function will set the
reference area to the first (lower left) or next grid element
intersection area and return 1. The function will return zero when it
advances past the last grid element that overlaps the current cell
bounding box, in which case the reference area is returned to the
default value. Thus, this function can be used in a loop to limit the
computation area for each iteration, for large cells that would be
inefficient to process in one step.
If the argument is nonzero, the internal state is cleared. This
should be called if the iteration is not complete and one wishes to
start a new loop.
- (zoidlist) Zhead(zoidlist)
This function will remove the first trapezoid from the passed
trapezoid list, and return it as a new list. If the passed list is
empty, the returned list will be empty. If the passed list contains a
single trapezoid, it will become empty.
- (int) Zvalues(zoidlist, array)
This function will return the coordinates of the first trapezoid in
the list in the array, which must have size 6 or larger. The order of
the values is
0 |
x lower-left |
1 |
x lower-right |
2 |
y lower |
3 |
x upper-left |
4 |
x upper-right |
5 |
y upper |
On success, 1 is returned. If the passed trapezoid list is empty,
the return value is 0 and the array is untouched.
- (int) Zlength(zoidlist)
This function returns the number of trapezoids contained in the list
passed as an argument.
- (int) Zarea(zoidlist)
This function returns the total area of the trapezoids contained in
the list passed as an argument, in square microns. This does not
account for overlapping trapezoids, call GeomOr first if
overlapping trapezoids are present (lists returned from the script
functions have already been clipped/merged unless otherwise noted).
- (zoidlist) GetZlist(layername, depth)
This function returns a zoidlist from the layer given in the first
argument, which has the form layername[.cellname]. If
the cellname extension is not given, the current cell is
assumed. The returned list is clipped to the current reference area
(see SetZref). The second argument is the hierarchy depth to
search, which can be a non-negative integer or a string starting with
`a' to indicate ``all''. If not called in physical mode, an
empty list is returned.
- (zoidlist) BoxZ(l, b, r, t)
This function returns a zoidlist containing a single trapezoid which
represents the box given in the arguments. The given coordinates are
in microns. This function never fails.
- (zoidlist) ZoidZ(xll, xlr, yl,
xul, xur, yu)
This function returns a zoidlist containing a single horizontal
trapezoid which represents the horizontal trapezoid given in the
arguments. The six numbers must represent a non-degenerate figure or
the function will fail. The given coordinates are in microns.
- (zoidlist) ObjectZ(object_handle all)
This function returns a zoidlist which is generated by fracturing the
outlines of the objects in the object_handle. If all is
0, only the first object in the list is used. If all is
nonzero, all objects in the list are used. This function will fail if
the first argument is not a handle to an object list.
- (zoidlist) TransformZ(zoid_list, refx,
refy, newx, newy)
Return a transformed copy of the passed trapezoid list. The transform
should have been set previously with SetTransform or equivalent.
The original list is not touched and can be closed if no longer
needed. The function internally converts each input trapezoid to a
polygon, applies the transformation to the polygon coordinates, then
decomposes the polygons into a new trapezoid list, which is returned.
The remaining arguments are ``reference'' and ``new'' coordinates,
which provide for translations. The reference point is the point
about which rotations and mirroring are performed, and is translated
to the new location, if different.
- (zoidlist) BloatZ(dimen, zoid_list, mode)
This function returns a new zoidlist which is a bloated version of the
zoidlist passed as an argument (similar to the !bloat command).
Edges will be pushed outward or pulled inward by dimen (positive
values push outward). The dimen is given in microns.
The third argument is an integer that specifies the algorithm to use
for bloating. Giving zero specifies the default algorithm. See the
description of the !bloat command (14.14.4) for
documentation of the algorithms available.
- (zoidlist) EdgesZ(dimen, zoid_list, mode)
This returns a list of zoids that in some way describe edges in the
zoid list passed. There are currently three modes, 0--2 as set by
the third argument. The dimen is given in microns.
mode 0
The zoid list is logically merged into distinct polygons, and a
``halo'' extending outside of the polygon by width dimen
(positive value taken) is constructed. The trapezoids describing the
halo are returned.
mode 1
The zoid list is logically merged into distinct polygons, and a wire
object is constructed using each polygon vertex list. The wire width
is twice the dimen value passed. The trapezoid list
representing the wire area is returned. This may fail and give
strange shapes if the dimensions of a polygon are smaller than half
the wire width.
mode 2
For each zoid in the zoid_list argument, a new zoid is
constructed from each edge that covers the area within + / - dimen normal to the edge. The list of new zoids is returned.
- (zoidlist) ManhattanizeZ(dimen, zoid_list)
This function returns a new zoidlist which is a Manhattan
approximation of the zoidlist passed as an argument (similar to the
!manh command). The argument is the minimum rectangle width or
height in microns used to approximate non-Manhattan pieces. All of
the returned trapezoids are rectangles. The function will fail if the
argument is smaller than 0.01.
- (zoidlist) RepartitionZ(zoid_list)
This is a rather obscure function that conditions a list of trapezoids
so that the area covered will be constructed with trapezoids that are
as long (horizontally) as possible. Logically, this is what would
happen if the initial trapezoid list was converted to distinct
polygons, then split back into trapezoids.
- (lexper) ParseLayerExpr(string)
This function returns a variable which contains a parse tree for a
layer expression contained in the string passed as an argument. The
resulting variable is used to rapidly evaluate the layer expression.
The return value can not be assigned or otherwise manipulated, and can
only be passed to functions that expect this variable type. The
function will fail on a parse error in the layer expression.
- (zoidlist) EvalLayerExpr(layer_expr, zoid_list,
depth, isclear)
This function evaluates the layer expression passed as the first
argument. The first argument can be a string containing the layer
expression, or a return from ParseLayerExpr. If the
second argument is nonzero, it is taken as a reference zoidlist. If
0, the current reference zoidlist (as set with SetZref) will be
used. The third argument is the depth into the cell hierarchy to
process. This can be an integer, with 0 representing the current cell
only, or a string starting with `a' to indicate use of all
levels of the hierarchy. If isclear is 0, the returned zoidlist
will represent all areas within the reference where the layer
expression is ``true''. if isclear is nonzero, the complement
regions will be returned. The function will fail on a parse or
evaluation error.
- (int) TestCoverage(layer_expr, zoid_list,
testfull)
This function will return an integer value indicating the coverage of
the layer expression given in the first argument over the regions
described in the second argument. The first argument can be a string
containing a layer expression, or a return from ParseLayerExpr. If the second argument is 0, the current
reference zoidlist as set with SetZref is assumed. If the testfull argument is 0, the return values are 0 if there is no dark
area, and 1 if dark areas exist. If testfull is nonzero, an
additional return value of 2 is returned if the zoid_list is
completely covered by the layer expression result (i.e., completely
dark). This latter test if somewhat more expensive. The function
will fail on a parse or evaluation error.
- (object_handle) ZtoObjects(zoid_list,
lname, join, to_dbase)
This function will create a list of objects from a zoidlist. The
objects will be created on the layer whose name is given in the second
argument, which will be created if it does not already exist. If this
argument is 0, the current layer will be used. If the join
argument is nonzero, the objects created will comprise a minimal set
of polygons that enclose all of the trapezoids. If the join
argument is 0, the objects will be have the same geometry as the
individual trapezoids. If the to_dbase argument is nonzero, the
new objects will be added to the database. Otherwise, the new objects
will be ``copies'' that can be manipulated with other functions that
accept object copies, but they will not appear in the database. The
function will fail if not called in physical mode, or the layer could
not be created.
- (int) ZtoTempLayer(longname, zoid_list,
join)
This function creates a temporary layer using longname, and adds
the content of the zoid_list to the new layer, in the current
cell. If the temporary layer for longname exists, it will be
used, with existing geometry untouched. If join is nonzero, the
zoidlist will be added as a minimal set of polygons, otherwise each
zoid will be added as a box or polygon. The function returns 1 on
success, 0 otherwise. This works in physical mode only.
- (int) ClearTempLayer(longname)
This function will clear all of the objects in the current cell from
the given layer, without saving them in the undo list. If successful,
1 is returned, otherwise 0 is returned. This works in physical mode
only.
- (int) ZtoFile(filename, zoidlist)
Save the zoidlist in a file, whose name is given in the first
argument. The zoidlist can be recovered with ZfromFile. The
file is in OASIS format, using a single dummy cell (named
``zoidlist'') and layer (``0100''), and uses only TRAPEZOID and
CTRAPEZOID geometry records. The function returns 1 if successful, 0
otherwise.
- (zoidlist) ZfromFile(filename)
Read the file, which was produced by ZtoFile, and return the
list of trapezoids it contains. If an error occurs in reading or an
interrupt is received, this function will fail (halting the script).
Otherwise a zoidlist will always be returned, but the list may be
empty.
- (zoidlist) CxGetZlist(cx_handle, cellname,
scale, array, clip, all)
This function will create and return a trapezoid list created from
objects read from the file associated with the passed context.
The UseLayerList and LayerList variables should be set to
specify the layer or layers that will be processed. By default, all
layers will contribute to the trapezoid list, which will in effect
represent the union of all geometry.
If the context has been configured for area with CxSetArea for
the cell, only the cells and instances needed to display the
configuration area will be processed.
The cellname, which can not be null or empty, must be the name
of a cell in the context. The is the cell name after any aliasing
that was in force when the context was created.
The scale will multiply the scale factor provided to GetArchiveContext in the output trapezoids.
If the array argument is passed 0, no windowing will be used.
Otherwise the array should have four components which specify a
rectangle, in microns, in the coordinates of cellname. The
values are
array[0] |
X left |
array[1] |
Y bottom |
array[2] |
X right |
array[3] |
Y top |
If an array is given, only the objects and subcells needed to render
the window will be processed. This window should be equal to or
contained in the window used to configure the context, if any.
If the boolean value clip is nonzero and an array is given,
trapezoids will be clipped to the window. Otherwise no clipping is
done.
If the boolean variable all is nonzero, the objects in the
hierarchy under cellname will be transformed and added to the
trapezoid list, i.e., the list will be a flat representation of the
entire hierarchy. Otherwise, only objects in cellname are
processed.
- (zoidlist) GeomAnd(zoids1 [, zoids2])
This function takes either one or two arguments, each of which is
taken as a zoidlist after possible conversion as described in the text
for this section. If one argument is given, the return is a zoidlist
consisting of the intersection regions between zoids in the argument
list. If two arguments are given, the return is a list of
intersecting regions between the two argument lists.
- (zoidlist) GeomAndNot(zoids1, zoids2)
This function takes two arguments, each of which is taken as a
zoidlist after possible conversion as described in the text for this
section. The return is a list of regions covered by the first list
that are not covered by the second.
- (zoidlist) GeomCat(zoids1 [, ...])
This function takes one or more arguments, each of which is taken as a
zoidlist after possible conversion as described in the text for this
section. The return is a list of all regions from each of the
arguments. There is no attempt to clip or merge the returned list.
- (zoidlist) GeomNot(zoids)
This function takes one argument, which is taken as a zoidlist after
possible conversion as described in the text for this section. The
return is a list of zoids representing the areas of the reference area
not covered by the argument list.
- (zoidlist) GeomOr(zoids1, ...)
This function takes one or more arguments, each of which is taken as a
zoidlist after possible conversion as described in the text for this
section. The return is a list of all regions from each of the
arguments, merged and clipped so that no elements overlap.
- (zoidlist) GeomXor(zoids1 [, zoids2])
This function takes one or two arguments, each of which is taken as a
zoidlist after possible conversion as described in the text for this
section. If one argument is given, the return is a list of areas
where one and only one zoid from the argument has coverage (note that
this is not exclusive-or, in spite of the function name). If two
arguments are given, the return is the exclusive-or of the two lists,
i.e., the areas covered by either list but not both.