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.
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
bboxReturns the bounding box of the Path.
centerReturns the center of the bounding box.
sizeReturns the (x, y) size of the bounding box.
xReturns the x-coordinate of the center of the bounding box.
xmaxReturns the maximum x-value of the bounding box.
xminReturns the minimum x-value of the bounding box.
xsizeReturns the horizontal size of the bounding box.
yReturns the y-coordinate of the center of the bounding box.
ymaxReturns the maximum y-value of the bounding box.
yminReturns the minimum y-value of the bounding box.
ysizeReturns the vertical size of the bounding box.