Geometry built-ins
These constructors add geometry to the current cell. Coordinate arguments are Float expressions.
rect
rect(layer: String, x0?, y0?, x1?, y1?, w?, h?, x0i?, y0i?, x1i?, y1i?) -> Rect
Draws an axis-aligned rectangle on a layer.
| Argument | Type | Requirement | Description |
|---|---|---|---|
layer | String | Required, positional | A drawing layer from the technology file. |
x0 | Float | Optional keyword | Constrains the left edge. |
y0 | Float | Optional keyword | Constrains the bottom edge. |
x1 | Float | Optional keyword | Constrains the right edge. |
y1 | Float | Optional keyword | Constrains the top edge. |
w | Float | Optional keyword | Constrains the width, x1 - x0. |
h | Float | Optional keyword | Constrains the height, y1 - y0. |
x0i | Float | Optional fallback | Initial left edge, used when x0 is otherwise free. |
y0i | Float | Optional fallback | Initial bottom edge, used when y0 is otherwise free. |
x1i | Float | Optional fallback | Initial right edge, used when x1 is otherwise free. |
y1i | Float | Optional fallback | Initial top edge, used when y1 is otherwise free. |
Returns Rect. The rectangle.
let gate = rect("poly", x0=0., y0=0., w=80., h=400.);
Give enough values or constraints to pin the rectangle down. If you drag an under-constrained rectangle in the GUI, it adds the missing initial values.
crect
crect(x0?, y0?, x1?, y1?, w?, h?, layer?, x0i?, y0i?, x1i?, y1i?) -> Rect
Creates a construction rectangle: usable in constraints and as bounds, but not exported.
| Argument | Type | Requirement | Description |
|---|---|---|---|
x0 | Float | Optional keyword | Constrains the left edge. |
y0 | Float | Optional keyword | Constrains the bottom edge. |
x1 | Float | Optional keyword | Constrains the right edge. |
y1 | Float | Optional keyword | Constrains the top edge. |
w | Float | Optional keyword | Constrains the width. |
h | Float | Optional keyword | Constrains the height. |
layer | String | Optional keyword | Optional layer to associate with the rectangle. |
x0i | Float | Optional fallback | Initial value for x0. |
y0i | Float | Optional fallback | Initial value for y0. |
x1i | Float | Optional fallback | Initial value for x1. |
y1i | Float | Optional fallback | Initial value for y1. |
Returns Rect. The construction rectangle. It takes part in constraints but is left out of layout export.
let bounds = crect(x0=0., y0=0., w=1000., h=800.);
polygon
polygon(layer: String, points: Int, x0?, y0?, …, x0i?, y0i?, …) -> Polygon
Creates a polygon with a fixed number of vertices, each constrained on its own.
| Argument | Type | Requirement | Description |
|---|---|---|---|
layer | String | Required, positional | A drawing layer. |
points | Int | Required, positional | Number of vertices. Coordinate indices run from 0 to points - 1. |
xN | Float | Optional keyword | x coordinate of vertex N. |
yN | Float | Optional keyword | y coordinate of vertex N. |
xNi | Float | Optional fallback | Initial x coordinate of vertex N. |
yNi | Float | Optional fallback | Initial y coordinate of vertex N. |
Returns Polygon. The polygon.
let triangle = polygon("met1", 3,
x0=0., y0=0.,
x1=100., y1=0.,
x2=50., y2=80.,
);
path
path(layer: String, points: Int, width?, begin_extension?, end_extension?, x0?, y0?, …) -> Path
Creates a constant-width path along a centerline.
| Argument | Type | Requirement | Description |
|---|---|---|---|
layer | String | Required, positional | A drawing layer. |
points | Int | Required, positional | Number of centerline points. |
width | Float | Optional keyword | Full width of the path. Must not solve to a negative value. |
begin_extension | Float | Optional keyword | How far the path extends past its first point. |
end_extension | Float | Optional keyword | How far the path extends past its last point. |
xN | Float | Optional keyword | x coordinate of centerline point N. |
yN | Float | Optional keyword | y coordinate of centerline point N. |
widthi | Float | Optional fallback | Initial width. |
begin_extensioni | Float | Optional fallback | Initial begin extension. |
end_extensioni | Float | Optional fallback | Initial end extension. |
xNi / yNi | Float | Optional fallback | Initial coordinates of centerline point N. |
Returns Path. The path.
let route = path("met2", 2, width=20., x0=0., y0=0., x1=300., y1=0.);
text
text(value: String, layer: String, x: Float, y: Float) -> ()
Places a text label on a layer.
| Argument | Type | Requirement | Description |
|---|---|---|---|
value | String | Required, positional | The text. |
layer | String | Required, positional | Layer for the label. |
x | Float | Required, positional | x coordinate of the label origin. |
y | Float | Required, positional | y coordinate of the label origin. |
Returns (). Nothing; the label is added to the current cell.
text("VDD", "text.label", 40., 80.);