compensate()

Moves error segments on a given layer by a given distance. Output layer can only be used as input to dve_quadout and dve_plgout commands. Returns: A layer with selected edge segments.

See also: dve_plgout(), dve_quadout()

Syntax

edgeLayerOut = dve_drc(compensate (edgeLayerIn, distance [,resourceName, resourceValue]);

where:

edgeLayerIn, edgeLayerOut An edge layer
distance A real value

Compensate Template Qualifier

DVE_RN_COMP_TEMPLATE

Qualifier Resource Value

DVE_RV_CHAMFER Compensate using an angle from the orthogonal
DVE_RV_ALIGN (default) Compensate using an alignment to the adjacent edge
DVE_RV_BISECT Compensate where the angle is bisected at the corner
DVE_RV_OPPOSITE Compensate directly opposite the edge

Positive and Negative Compensations

Both positive compensation and negative compensation are supported.

Positive compensation: for example, suppose that when two edges face one another within a specified clearance distance D=50 they must be compensated towards each other by 10.0

lyrEdges = dve_drc(spacing(lyrCond) < 50, "d < 50", DVE_RN_EDGE_ANGLES, 
DVE_RV_PARALLEL);
lyrEdgesComp = dve_drc(compensate(lyrEdges, 10));
lyrPolyComp  = dve_quadout(lyrEdgesComp);
lyrError101  = dve_drc(all_edges(lyrPolyComp), "positive compensation");

For negative compensation, edges are moved away from each other by the specified amount:

Then a not function can be used to cut these sections away from the original polygon:

lyrEdges = dve_drc(spacing(lyrCond) < 50, "d < 50", DVE_RN_EDGE_ANGLES, 
DVE_RV_PARALLEL);
lyrEdgesComp = dve_drc(compensate(lyrEdges , -10));
lyrPolyComp  = dve_quadout(lyrEdgesComp);
lyrPolyNot   = dve_bool_not(lyrCond, lyrPolyComp);

Adjusting the COMPENSATE command

The compensate command can be given qualifiers which tell it:

How to chamfer a compensated segment

Normally, the compensated segment is projected orthogonally to the edge:

As an alternative, specify a chamfer angle in degrees:

lyrEdgesComp = dve_drc(compensate(lyrEdges ,30), DVE_RN_COMP_TEMPLATE, 
      DVE_RV_CHAMFER, DVE_RN_CHAMFER_ANGLE, 45);

The chamfer angle is expressed as the deviation from the orthogonal, so "DVE_RN_CHAMFER_ANGLE, 0" is the (default) orthogonal.

The template used by the compensate command

Consider an edge to be compensated, which ends at a concave and a convex corner:

The default behavior is to align the compensated section at the concave corner and to project it orthogonally at the convex corner:

A different behavior can be defined by specifying a compensate template:
Compensate with an opposite template

lyrEdgesComp = dve_drc(compensate(lyrEdges, 5), DVE_RN_COMP_TEMPLATE, DVE_RV_OPPOSITE);

Compensate with a bisect template. The program bisects the angle at the corners:

lyrEdgesComp = dve_drc(compensate(lyrEdges ,5), DVE_RN_COMP_TEMPLATE, DVE_RV_BISECT);

Compensate with an align template. The compensated section is aligned at the adjacent edge:

lyrEdgesComp = dve_drc(compensate(lyrEdges ,5), DVE_RN_COMP_TEMPLATE, DVE_RV_ALIGN);

Example

decl lyrCond = dve_import_layer ("cond");
decl lyrError101 = dve_export_layer ("error101");
decl lyrEdges = NULL;
decl lyrEdgesComp = NULL;
decl lyrPolyCond = NULL;
decl lyrPolyComp = NULL;
decl lyrPolyOversize = NULL;
// Generate an oversized polygon
lyrEdges = dve_drc (width (lyrCond) < 5.0);
lyrEdgesComp = dve_drc (compensate (lyrEdges, 0.5),
                DVE_RN_COMP_TEMPLATE, DVE_RV_CHAMFER,
                DVE_RN_CHAMFER_ANGLE, 45);
lyrPolyCond = dve_quadout (lyrEdges);
lyrPolyComp = dve_quadout (lyrEdgesComp);
lyrPolyOversize = dve_bool_or (lyrPolyCond, lyrPolyComp);
// Check gap clearance
lyrError101 += dve_drc (gap (lyrPolyOversize) < 4.0, "Gap clearance < 4.0");
 

Privacy Statement  | Terms of Use  | Legal | Contact Us  | © Agilent 2000-2008 

Contents
Additional Resources