gdsfactory.path.Path

gdsfactory.path.Path#

class gdsfactory.path.Path(path=None)[source]#

Path object for smooth Paths. You can extrude a Path with a CrossSection to create a Component.

Parameters:

path – array-like[N][2], Path, or list of Paths. Points or Paths to append() initially.

__init__(path=None) None[source]#

Creates an empty path.

Methods

__init__([path])

Creates an empty path.

append(path)

Attach Path to the end of this Path.

copy()

Returns a copy of the Path.

curvature()

Calculates Path curvature.

extrude([cross_section, layer, width, ...])

Returns Component by extruding a Path with a CrossSection.

hash_geometry([precision])

Computes an SHA1 hash of the points in the Path and the start_angle and end_angle.

length()

Return cumulative length.

mirror([p1, p2])

Mirrors the Path across the line formed between the two specified points.

move([origin, destination, axis])

Moves the Path from the origin point to the destination.

movex([origin, destination])

Moves an object by a specified x-distance.

movey([origin, destination])

Moves an object by a specified y-distance.

offset([offset])

Offsets Path so that it follows the Path centerline plus an offset.

plot()

Plot path in matplotlib.

rotate([angle, center])

Rotates all Polygons in the Component around the specified center point.

to_dict()

Attributes

bbox

Returns the bounding box of the Path.

center

Returns the center of the bounding box.

size

Returns the (x, y) size of the bounding box.

x

Returns the x-coordinate of the center of the bounding box.

xmax

Returns the maximum x-value of the bounding box.

xmin

Returns the minimum x-value of the bounding box.

xsize

Returns the horizontal size of the bounding box.

y

Returns the y-coordinate of the center of the bounding box.

ymax

Returns the maximum y-value of the bounding box.

ymin

Returns the minimum y-value of the bounding box.

ysize

Returns the vertical size of the bounding box.