Python API Reference

Geometry Construction

Classes and functions for construction and manipulation of geometric objects.

Classes

gdstk.Polygon(points[, layer, datatype])

Polygonal geometric object.

gdstk.Curve(xy[, tolerance])

Curve object for construction of complex polygons.

gdstk.FlexPath(points, width[, offset, ...])

Flexible path creation.

gdstk.RobustPath(initial_point, width[, ...])

Robust path creation.

gdstk.Repetition([columns, rows, spacing, ...])

Repetition object that creates multiple identical elements.

Functions

gdstk.rectangle(corner1, corner2[, layer, ...])

Create a rectangle.

gdstk.cross(center, full_size, arm_width[, ...])

Create a cross shape.

gdstk.regular_polygon(center, side_length, sides)

Create a regular polygon.

gdstk.ellipse(center, radius[, ...])

Create an ellipse, circle, slice or ring.

gdstk.racetrack(center, straight_length, radius)

Create a racetrack shape.

gdstk.text(text, size, position[, vertical, ...])

Create polygonal text.

gdstk.contour(data[, level, length_scale, ...])

Extract polygonal contours from 2-d array data at given level.

gdstk.offset(polygons, distance[, join, ...])

Dilate or erode polygons.

gdstk.boolean(operand1, operand2, operation)

Execute boolean (clipping) operations between polygons.

gdstk.slice(polygons, position, axis[, ...])

Slice polygons along x and y axes.

gdstk.inside(points, polygons)

Check whether each point is inside the set of polygons.

gdstk.all_inside(points, polygons)

Check whether all points are inside the set of polygons.

gdstk.any_inside(points, polygons)

Check whether any of the points are inside the set of polygons.

Library Organization

Classes and functions used to create and organize the library in a GDSII/OASIS file.

Classes

gdstk.Label(text, origin[, anchor, ...])

Text objects with out geometrical information.

gdstk.Reference(cell[, origin, rotation, ...])

Reference to another cell.

gdstk.Cell(name)

Cell structure.

gdstk.RawCell(name)

A Cell structure that is stored in binary GDSII format.

gdstk.Library([name, unit, precision])

GDSII/OASIS library.

gdstk.GdsWriter(outfile[, name, unit, ...])

Multi-step GDSII stream file writer.

Functions

gdstk.read_gds(infile[, unit, tolerance, filter])

Import a library from a GDSII stream file.

gdstk.read_oas(infile[, unit, tolerance])

Import a library from an OASIS stream file.

gdstk.read_rawcells(infile)

Load cells form a GDSII file without decoding them.

gdstk.gds_units(infile)

Read the unit and precision of a GDSII file.

gdstk.gds_info(infile)

Gather information from a GDSII file without loading the geometry.

gdstk.oas_precision(infile)

Read the precision of an OASIS file.

gdstk.oas_validate(infile)

Check the validation signature of an OASIS file, if any.