gdstk.regular_polygon
- gdstk.regular_polygon(center, side_length, sides, rotation=0, layer=0, datatype=0) gdstk.Polygon
Create a regular polygon.
- Parameters:
center (coordinate pair or complex) – Polygon center.
side_length (number) – Length of the sides of the polygon.
sides (integer) – Number of polygon sides.
rotation – Rotation angle (in radians).
layer – layer number assigned to this polygon.
datatype – data type number assigned to this polygon.
Examples
>>> poly3 = gdstk.regular_polygon((0, 0), 9, 3) >>> poly4 = gdstk.regular_polygon((10, 0), 7, 4, layer=1) >>> poly5 = gdstk.regular_polygon((0, 10), 5, 5, layer=2) >>> poly6 = gdstk.regular_polygon((10, 10), 4, 6, layer=3)