Bool.dll Library Logo


Glossary of 2D Boolean Geometry Terms

In our documentation and examples we often use terms that either may not be familiar to our users, or which may have a different meaning to our users than we intend. This glossary is provided as a convenient location where we define such terms and, if appropriate, include some simple diagrams.










Cut Line


Winding rule















chord error





Definition - A convex boundary is one where if you draw a ray through it the ray crosses only once as it enters and once as it exits the boundary.

We can futher refine this definition into:

Convex in X - the ray passes through the boundary parallel to the X axis.

Convex in Y - the ray passes through the boundary parallel to the Y axis.

example of convex polygons



Definition - A vertex is the point where two edges of a boundary meet. A boundary is defined by listing its vertices in order either clockwise or counterclockwise.

How Vertex Data is Stored

Bool.dll stores boundary vertex data as a pair of coordinates; each the x and y component are each 4 byte signed integers. So each vertex requires 8 bytes (2x4) to store in memory.

example of boundary vertex

Notice that an entry is made for both the first and last vertex on the polygon which means that there is one more vertex that edge in the database.



Definition - Partitioning is a way of dividing up a large problem into multiple smaller ones. This is normally done to limit the computation time as the data set gets large.


When using Bool.dll the programmer can choose to block any partitioning, allow the library to best determine partitioning or specify precisely how the data is to be partitioned.

When partitioning is used, the output boundaries may be "sliced" if they cross a partition boundary. The programmer can call a function to "repair" those slices, if desired.

example of partitioning



Definition - Leonov is a term we use for a combination of boundaries where there is a single "parent" boundary who contains one or more child boundaries. This is named after the Russian mathematician, Michael Leonov, who wrote some seminal papers on boolean operations for such sets.


Whenever one must deal with a void inside of a boundary there is the issue as to how to represent this. On approach is to use a re-entrant polygon with cut lines. A second approach is to use Leonov polygons where each void is an independent boundary.

Bool.dll can write Leonov polygons and can read them. Some bool.dll functions do not support Leonov polygons.

example of leonov polygon

The parent must completely contain the children. The children may not touch the parent or other children.

Direction: this illustration implies that the parent must be drawn CCW and the children CW. There is no such requirement.



Definition - The parent polygon (or boundary) in a Leonov set is the outer one which contains all of the inner ones.


See Leonov and child



Definition - The child polygon (or boundary) in a Leonov set is completely inside of the parent polygon. There can be multiple child polygons contained within a single parent. Child polygons may not touch or intersect each other nor should they touch or intersect the parent.


See Leonov and parent


Winding Rule

Definition - The winding rule is used in order to determine which regions are "filled" when processing a polygon tha self intersects. In the EDA world, it is important to be consistent with the CATS program which is used by a majority of the mask shops to convert databases such as GDSII and OASIS into mask writing commands. CATS supports two options: ON and OFF which are illustrated below:

Consider this polygon(boundary) that self intersects. The vertices are labeled in order.

self intersecting polygon

Winding Rule = YES

A scan line algorithm running from left to right is used to separate the interior from the exterior of the polygon. Each time the scan line crosses a vertical edge going upwards the rule count is incremented by +1. Each time the scan line crosses a vertical edge going down the rule count is adjusted by -1. Then we could label the regions as shown below:

incrementing based on edge direction

Now the rule (with option YES) says: any region with a non-zero value is defined as data.

So we should render the polygon as shown below:

data region for winding=YES

Winding Rule = NO

For the CATS winding rule = NO option, we still increment or decrement the region value based on the vertical edge direction; however the rule now states:

Any region with even value = empty; regions with odd value = data.

Therefore we would render the polygon as shown below:

data region for winding=NO



Definition - Manhattan geometry consists of all polygons or paths whose edges are parallel to the X or Y axis.


Many IC layout tools still require that the input data be Manhattan as this allows one to greatly simplify various operations. Bool.dll has a flag for known Manhattan data - if the flag is set certain routines can be used that are faster than the routines used to handle all angle data. However bool.dll has no requirement to use only Manhattan data.

illustration of manhattan and non manhattan data


Cut Line

Definition - A cut line is a pair of edges that go "into" and "out of" a re-entrant polygon. A re-entrant polygon may have multiple sets of cut lines.



see Winding Rule and Re-Entrant Polygon

  Documentation Download Price Revision History

417 Ingalls St., Santa Cruz, CA 95060    Tel (831) 426-6163     Fax 426-2824    email: