gdsfactory.path.Path#
- class gdsfactory.path.Path(path=None)[source]#
You can extrude a Path with a CrossSection to create a Component.
- Parameters:
path (npt.NDArray[np.floating[Any]] | Path | list[tuple[float, float]] | None) – array-like[N][2], Path, or list of Paths.
- __init__(path=None)[source]#
Creates an empty path.
- Parameters:
path (ndarray[tuple[int, ...], dtype[floating[Any]]] | Path | list[tuple[float, float]] | None)
- Return type:
None
Methods
__init__([path])Creates an empty path.
append(path)Attach Path to the end of this Path.
bbox([layer])bbox_np()Returns the bounding box of the Path as a numpy array.
centerpoint_offset_curve(points, offset_distance)Creates a offset curve computing the centerpoint offset of x and y points.
copy()Returns a copy of the Path.
curvature()Calculates Path curvature.
dbbox([layer])dmirror([p1, p2])Mirror self at a line.
dmirror_x([x])Mirror self at an y-axis at position x.
dmirror_y([y])Mirror self at an x-axis at position y.
dmove(origin[, destination])Move self in um.
dmovex(origin[, destination])Move self in x-direction in um.
dmovey(origin[, destination])Move self in y-direction in um.
drotate(angle[, center])Rotate self by a given angle in degrees.
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.
ibbox([layer])imirror([p1, p2])Mirror self at a line.
imirror_x([x])Mirror self at an y-axis at position x.
imirror_y([y])Mirror self at an x-axis at position y.
imove(origin[, destination])Move self in dbu.
imovex(origin[, destination])Move self in x-direction in dbu.
imovey(origin[, destination])Move self in y-direction in dbu.
irotate(angle[, center])Rotate self in increments of 90°.
length()Return cumulative length.
mirror([p1, p2])Mirrors the Path across the line formed between the two specified points.
mirror_x([x])Mirror self at an y-axis at position x.
mirror_y([y])Mirror self at an x-axis at position y.
move(origin[, destination])Move self in dbu.
movex(origin[, destination])Move self in x-direction in dbu.
movey(origin[, destination])Move self in y-direction in dbu.
offset([offset])Offsets Path so that it follows the Path centerline plus an offset.
plot()Plot path in matplotlib.
rotate(angle[, center])Rotate self.
transform(trans, /)Attributes
centerReturns the coordinate center of the bounding box.
dcenterCoordinate of the center of the bounding box in um.
dsize_infodxX coordinate of the center of the bounding box in um.
dxmaxReturns the x-coordinate of the right edge of the bounding box.
dxminReturns the x-coordinate of the left edge of the bounding box.
dxsizeReturns the width of the bounding box.
dyY coordinate of the center of the bounding box in um.
dymaxReturns the y-coordinate of the top edge of the bounding box.
dyminReturns the y-coordinate of the bottom edge of the bounding box.
dysizeReturns the height of the bounding box.
icenterReturns the coordinate center of the bounding box.
isize_infoixReturns the x-coordinate of the center of the bounding box.
ixmaxReturns the x-coordinate of the right edge of the bounding box.
ixminReturns the x-coordinate of the left edge of the bounding box.
ixsizeReturns the width of the bounding box.
iyReturns the y-coordinate of the center of the bounding box.
iymaxReturns the y-coordinate of the top edge of the bounding box.
iyminReturns the y-coordinate of the bottom edge of the bounding box.
iysizeReturns the height of the bounding box.
kclsize_infoxReturns the x-coordinate of the center of the bounding box.
xmaxReturns the x-coordinate of the right edge of the bounding box.
xminReturns the x-coordinate of the left edge of the bounding box.
xsizeReturns the width of the bounding box.
yReturns the y-coordinate of the center of the bounding box.
ymaxReturns the y-coordinate of the top edge of the bounding box.
yminReturns the y-coordinate of the bottom edge of the bounding box.
ysizeReturns the height of the bounding box.