Grow/Shrink Polygons
Moves the edges of the shapes on visible layers outward by a distance, or inward if the distance is negative. Open it from Tools → Boolean Operations → Grow/Shrink Polygons. The tool needs the Tools option.
When to Use
- To compensate a process bias, such as etch undercut or resist spread, by sizing a layer up or down
- To derive a clearance or keep-out layer around existing geometry
- To remove features narrower than a given width: shrink by half that width, then grow back by the same amount
Options
| Option | Description | Default |
|---|---|---|
| Distance | How far the edges move, in the display units. Positive values grow the polygons, negative values shrink them | 1.0 |
| Corners | Shape of the corners added where moved edges part: Round (circular arcs at the arc precision), Miter (edges extended until they meet, cut off at the miter limit) or Square (corners cut off at the offset distance) | Round |
| Miter limit | Longest miter, as a multiple of the distance; a longer miter is cut off. Used with Miter corners | 2.0 |
| Offset holes (holes shrink when polygons grow) | When on, holes move with their polygon: they shrink when the polygon grows. When off, only the outer contours move | On |
| Arc Precision | Precision used for round corners and for curved shapes converted before the offset | |
| Fill Rule | How overlaps of the shapes are interpreted: Non-zero winding rule or Even-odd rule | |
| Draw generated holes using… | Cut-lines in re-entrant polygons, Sliced simple polygons, or Extract holes as polygons | |
| Apply To | All Visible geometry or only the current Selection | All Visible |
How It Works
- The shapes of each layer are merged into the area they cover
- The outline of that area moves by the distance, adding corners of the chosen style where edges part
- The result replaces the original shapes, with holes drawn as chosen
When the polygons grow, holes shrink, and shapes that come closer than twice the distance merge. When they shrink, parts narrower than twice the distance vanish.
Command Line
The Offset command of --apply-tool and of ToolApply in command files runs the same tool:
Offset(D[,JOIN[,LIMIT]][,HOLES])| Argument | Description |
|---|---|
D | Distance, in the current units; negative shrinks |
JOIN | Round (default, arcs at the SetResolution precision), Miter or Square |
LIMIT | Miter limit as a multiple of D; default 2 |
HOLES | OffsetHoles (default, holes shrink as polygons grow) or KeepHoles (only outer contours move) |
The command uses the fill rule and holes mode set before it. This example removes everything narrower than 10 µm:
linkcad -i in.gds -o out.gds --output-format GDSII \ --apply-tool "SetUnits(um);Offset(-5,Miter,2);Offset(5,Miter,2)" \ --quit --no-save-settingsFrom Python, the same operation is linkcad.edit.OffsetTask; see linkcad.edit.
Technical Notes
- Zero-width polylines are not changed
- Shapes on different layers are never merged with each other
- Growing and then shrinking by the same distance closes gaps and notches narrower than twice the distance; shrinking and then growing removes slivers narrower than twice the distance