Skip to content

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

OptionDescriptionDefault
DistanceHow far the edges move, in the display units. Positive values grow the polygons, negative values shrink them1.0
CornersShape 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 limitLongest miter, as a multiple of the distance; a longer miter is cut off. Used with Miter corners2.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 moveOn
Arc PrecisionPrecision used for round corners and for curved shapes converted before the offset
Fill RuleHow 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 ToAll Visible geometry or only the current SelectionAll Visible

How It Works

  1. The shapes of each layer are merged into the area they cover
  2. The outline of that area moves by the distance, adding corners of the chosen style where edges part
  3. 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])
ArgumentDescription
DDistance, in the current units; negative shrinks
JOINRound (default, arcs at the SetResolution precision), Miter or Square
LIMITMiter limit as a multiple of D; default 2
HOLESOffsetHoles (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:

Terminal window
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-settings

From 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