Keeps shapes whose measure lies in the given bounds. One number is exact (area tolerance 0.5 dbu²). Two numbers are [min, max) with max exclusive, except inf. Length is the exception: its max is inclusive.
with_area(a, min, max)Available · yields polygons
layer s = with_area(m1, 0, 0.09)
layer s = with_area(m1, 0.09)
layer s = with_area(m1, 0.09, inf)
Area in dbu². One argument = exact (tolerance 0.5 dbu²). Two arguments: v ≥ min and v < max. inf as max = minimum only.
One argument is exact, not a minimum.
Notes
with_area(a, x, inf) for “at least x”. One value is not a minimum.max is exclusive (v < max). An area exactly equal to max is dropped.without_area(a, …)Available · yields polygons
layer w = without_area(m1, 0, 0.09)
a minus the shapes kept by with_area (identity per polygon equality).
Notes
with_area, inverted.with_perimeter(a, …)Available · yields polygons
layer p = with_perimeter(m1, 0, 2.0)
Perimeter including every ring. Same min/max/exact rules as area; the unit is length.
Notes
with_area.with_holes(a, n)Available · yields polygons
layer h = with_holes(m1, 1)
layer h = with_holes(m1, 1, inf)
Number of clockwise rings after the rings are separated. One argument = exactly n holes.
Notes
with_holes(a, 0): polygons without a hole, not “any number”.with_angle(a, …)Available · yields edges or edge pairs
layer e = with_angle(edges, 0, 1)
layer p = with_angle(m1, 90)
On edges: orientation atan2 in [0,180) — horizontal 0°, vertical 90°. On polygons: interior angle at each corner as an edge pair (prev–curr, curr–next). One value = exact (edges: 1e-6°, not 0.5 dbu).
Notes
with_angle(e, 45) is exact; 45.0001 is out.180-turn, a clockwise hole 180+turn — 90° rectangle corners stay 90°.with_internal_angle(pairs, …)Available · yields edge pairs
layer p = with_internal_angle(width(m1) < 0.2 um, 0, 10)
Angle between the two edges of a pair: acos(|cos|) → 0…90° (acute angle; sign/direction dropped). Non-pairs become markers first.
Notes
|cos| never exceeds 90 — obtuse pairs cannot be told from acute complements.with_length(e, min, max)Available · yields edges
layer k = with_length(edges(m1), 0.2 um, inf)
Keeps edges whose length lies in the interval. Implementation: all minus without_length. A missing min/max is unbounded.
Length max is inclusive; area max is exclusive.
Notes
edges() (skipped).with_area).without_length(e, min, max)Available · yields edges
layer k = without_length(edges(m1), 0, 0.5 um)
Keeps edges outside [min, max]. Both unbounded: the interval is “everything” → empty output.
Notes
without_length(e, 0, x): edges longer than x (short ones dropped).ongrid(a, g) (Layer)Available · yields edge pairs
layer v = ongrid(m1, 0.005 um)
layer v = ongrid(m1)
Per off-grid vertex a degenerate pair (a point, distance 0). Without g: setup grid. Not the whole polygons.
As a layer,
ongridyields off-grid vertices, not whole off-grid shapes.
Notes
ongrid(a) != g uses the same point pairs as markers.rectangles / non_rectanglesAvailable · yields polygons
layer r = rectangles(m1)
layer n = non_rectangles(m1)
An axis-aligned quad, 4 unique corners, area = bounding-box area (not a diamond, not a rotated rectangle, not a 45° rectangle).
Notes
n != 4).squares / non_squaresAvailable · yields polygons
layer s = squares(m1)
First rectangles, then bounding-box width == height.
Notes
rectangles).rectilinear / non_rectilinearAvailable · yields polygons
layer m = rectilinear(m1)
Every edge is axis-aligned (each step changes only X or only Y). L-shapes yes, 45° no. At least 3 edges.
Notes
non_rectilinear.holes / hulls than on a mixed stored ring.with_width(a, min, max)Available · yields polygons
layer w = with_width(m1, 0.5 um, inf)
Shapes whose local width (RelWidth per polygon, else bbox min side) lies in [min, max]. An L with a thin arm drops when min is above that arm, even if the bbox is large.
Notes
space(wide) — not a new operator.width(a) > x, not this filter.with_bbox / with_area_ratio / with_vertex_countAvailable · yields polygons
layer b = with_bbox(a, width=1 um, height=2 um)
with_bbox filters on the bounding box. with_area_ratio keeps shapes whose area/bbox-area is in [min, max]. with_vertex_count filters by vertex count (ring without a duplicated close). width= / height=: bbox width or height within 1 dbu. min=: smaller side ≥ min. max=: larger side ≤ max. aspect=: width/height (5 % relative tolerance).
Notes
width=: tall and flat rectangles of the same width both stay.min=1.5 um keeps 2×2, not 2×1 (min side 1).path_length(e, min, max)Available · yields edges
layer p = path_length(e, 1.0 um, inf)
Length of a chain of connected edges (shared endpoints, union-find), not a single segment. with_length stays per segment.
Notes
with_distance(pairs, min, max)Available · yields edge pairs
layer p = with_distance(space(m1) < 1 um, 0, 0.2 um)
Filter on the measured pair distance. The input must be edge pairs (e.g. space(a) < x). Other layer kinds: empty.
Notes
0.001 .. 0.2).