Skip to main content

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.

ArgumentTypeRequirementDescription
layerStringRequired, positionalA drawing layer from the technology file.
x0FloatOptional keywordConstrains the left edge.
y0FloatOptional keywordConstrains the bottom edge.
x1FloatOptional keywordConstrains the right edge.
y1FloatOptional keywordConstrains the top edge.
wFloatOptional keywordConstrains the width, x1 - x0.
hFloatOptional keywordConstrains the height, y1 - y0.
x0iFloatOptional fallbackInitial left edge, used when x0 is otherwise free.
y0iFloatOptional fallbackInitial bottom edge, used when y0 is otherwise free.
x1iFloatOptional fallbackInitial right edge, used when x1 is otherwise free.
y1iFloatOptional fallbackInitial 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.

ArgumentTypeRequirementDescription
x0FloatOptional keywordConstrains the left edge.
y0FloatOptional keywordConstrains the bottom edge.
x1FloatOptional keywordConstrains the right edge.
y1FloatOptional keywordConstrains the top edge.
wFloatOptional keywordConstrains the width.
hFloatOptional keywordConstrains the height.
layerStringOptional keywordOptional layer to associate with the rectangle.
x0iFloatOptional fallbackInitial value for x0.
y0iFloatOptional fallbackInitial value for y0.
x1iFloatOptional fallbackInitial value for x1.
y1iFloatOptional fallbackInitial 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.

ArgumentTypeRequirementDescription
layerStringRequired, positionalA drawing layer.
pointsIntRequired, positionalNumber of vertices. Coordinate indices run from 0 to points - 1.
xNFloatOptional keywordx coordinate of vertex N.
yNFloatOptional keywordy coordinate of vertex N.
xNiFloatOptional fallbackInitial x coordinate of vertex N.
yNiFloatOptional fallbackInitial 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.

ArgumentTypeRequirementDescription
layerStringRequired, positionalA drawing layer.
pointsIntRequired, positionalNumber of centerline points.
widthFloatOptional keywordFull width of the path. Must not solve to a negative value.
begin_extensionFloatOptional keywordHow far the path extends past its first point.
end_extensionFloatOptional keywordHow far the path extends past its last point.
xNFloatOptional keywordx coordinate of centerline point N.
yNFloatOptional keywordy coordinate of centerline point N.
widthiFloatOptional fallbackInitial width.
begin_extensioniFloatOptional fallbackInitial begin extension.
end_extensioniFloatOptional fallbackInitial end extension.
xNi / yNiFloatOptional fallbackInitial 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.

ArgumentTypeRequirementDescription
valueStringRequired, positionalThe text.
layerStringRequired, positionalLayer for the label.
xFloatRequired, positionalx coordinate of the label origin.
yFloatRequired, positionaly coordinate of the label origin.

Returns (). Nothing; the label is added to the current cell.

text("VDD", "text.label", 40., 80.);