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.
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
center
Returns the coordinate center of the bounding box.
dcenter
Coordinate of the center of the bounding box in um.
dsize_info
dx
X coordinate of the center of the bounding box in um.
dxmax
Returns the x-coordinate of the right edge of the bounding box.
dxmin
Returns the x-coordinate of the left edge of the bounding box.
dxsize
Returns the width of the bounding box.
dy
Y coordinate of the center of the bounding box in um.
dymax
Returns the y-coordinate of the top edge of the bounding box.
dymin
Returns the y-coordinate of the bottom edge of the bounding box.
dysize
Returns the height of the bounding box.
icenter
Returns the coordinate center of the bounding box.
isize_info
ix
Returns the x-coordinate of the center of the bounding box.
ixmax
Returns the x-coordinate of the right edge of the bounding box.
ixmin
Returns the x-coordinate of the left edge of the bounding box.
ixsize
Returns the width of the bounding box.
iy
Returns the y-coordinate of the center of the bounding box.
iymax
Returns the y-coordinate of the top edge of the bounding box.
iymin
Returns the y-coordinate of the bottom edge of the bounding box.
iysize
Returns the height of the bounding box.
kcl
size_info
x
Returns the x-coordinate of the center of the bounding box.
xmax
Returns the x-coordinate of the right edge of the bounding box.
xmin
Returns the x-coordinate of the left edge of the bounding box.
xsize
Returns the width of the bounding box.
y
Returns the y-coordinate of the center of the bounding box.
ymax
Returns the y-coordinate of the top edge of the bounding box.
ymin
Returns the y-coordinate of the bottom edge of the bounding box.
ysize
Returns the height of the bounding box.