Show Menu
TOPICS×

class s7vampy.path.Path

Paths are built from a set of independent contours. Each contour contains a series of connected line segments.
add_contour ( * points *)
Parameters:
points ( list )
List of (x, y) tuples. Must contain at least two points.
Add a contour defined as a list of points to the path.
close ()
Close the last contour of the path. Does nothing if the contour is already closed.
close_all ()
Close all contours. Does nothing to contours that are already closed.
contours
Iterator that runs over the contours.
empty [bool, read-only]
Check if the path is empty.
lineto ( * x *, * y *)
Parameters:
  • x
    Point x-value
  • y
    Point y-value
Create a new line segment starting at the last added point and ending at the given coordinate.
moveto ( * x *, * y *)
Parameters:
  • x
    Point x-value
  • y
    Point y-value
Create a new contour starting at the given point.
num_contours [int, read-only]
Return the total number of contours.
num_segments [int, read-only]
Return the total number of segments.
rlineto ( * x *, * y *)
Parameters:
  • x
    Point x-value
  • y
    Point y-value
Create a new line segment starting at the last added point and ending at the given coordinate. The point is relative to the last point added to the path.
rmoveto ( * x *, * y *)
Parameters:
  • x
    Point x-value
  • y
    Point y-value
Create a new contour starting at the given point. The point is relative to the last point added to the path.
segments
Generator that returns all segments.