gdsfactory.path.Path#
- class gdsfactory.path.Path(path: ndarray[tuple[int, ...], dtype[floating[Any]]] | Path | None = None)[source]#
You can extrude a Path with a CrossSection to create a Component.
- Parameters:
path – array-like[N][2], Path, or list of Paths.
- __init__(path: ndarray[tuple[int, ...], dtype[floating[Any]]] | Path | None = None) None [source]#
Creates an empty path.
Methods
__init__
([path])Creates an empty path.
append
(path)Attach Path to the end of this Path.
centerpoint_offset_curve
(points, ...)Creates a offset curve computing the centerpoint offset of x and y points.
copy
()Returns a copy of the Path.
curvature
()Calculates Path curvature.
extrude
()Returns Component by extruding a Path with a CrossSection.
extrude_transition
(transition)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
(value)Moves an object by a specified x-distance.
movey
(value)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.
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.