Rect
Rect is an axis-aligned rectangle. Drawn rectangles from rect and construction rectangles from crect both have this type.
Fields
| Field | Type | Description |
|---|---|---|
x0 | Float | Left edge. |
y0 | Float | Bottom edge. |
x1 | Float | Right edge. |
y1 | Float | Top edge. |
w | Float | Width, x1 - x0. |
h | Float | Height, y1 - y0. |
layer | String | Layer name. A construction rectangle may have none. |
How the fields relate
Give any combination of edges and sizes that pins the rectangle down, and the solver derives the rest:
let r = rect("met1", x0=10., y0=20., w=100., h=80.);
eq(r.x1, 110.);
eq(r.y1, 100.);
Arguments such as x0 are constraints. Arguments such as x0i are initial values for whatever is left free.
Related
rectandcrectbboxstd::intersectionandstd::union