GraphicsPath

Overview

GraphicsPath is a class in Aspose.PDF FOSS for Python.

A path made of subpaths, to be filled, stroked or clipped with.

This class declares 14 methods for GraphicsPath objects in Python programs. Available methods include: __bool__, __init__, __len__, __repr__, circle, close, curve_to, ellipse, line_to, move_to, polygon, polyline, and 2 additional methods. Public members are accessible to any Python application after installing the Aspose.PDF FOSS for Python package. Properties: current_point, is_empty.

Properties

NameTypeAccessDescription
current_pointtuple[float, float] | NoneReadWhere the last segment left off, or None for an empty path.
is_emptyboolReadWhether the path has no segments at all.

Methods

SignatureDescription
__init__()Calls init on this GraphicsPath instance.
__len__() → intCalls len on this GraphicsPath instance.
__bool__() → boolCalls bool on this GraphicsPath instance.
move_to(x: float, y: float) → GraphicsPathStart a new subpath at (x, y) (the m operator).
line_to(x: float, y: float) → GraphicsPathAdd a straight segment to (x, y) (the l operator).
curve_to(x1: float, y1: float, x2: float, y2: float, x: float, y: float) → GraphicsPathAdd a cubic Bézier curve to (x, y) (the c operator).
quadratic_to(x1: float, y1: float, x: float, y: float) → GraphicsPathAdd a quadratic curve, written as the cubic that draws it exactly.
close() → GraphicsPathClose the current subpath back to where it started (h).
rect(x: float, y: float, width: float, height: float) → GraphicsPathAdd a closed rectangle as its own subpath (the re operator).
ellipse(x: float, y: float, width: float, height: float) → GraphicsPathAdd the ellipse inscribed in the box (x, y, width, height).
circle(center_x: float, center_y: float, radius: float) → GraphicsPathAdd a circle of radius about (center_x, center_y).
polyline(points: Iterable[Sequence[float]]) → GraphicsPathAdd an open subpath through points, a sequence of (x, y) pairs.
polygon(points: Iterable[Sequence[float]]) → GraphicsPathAdd a closed subpath through points, a sequence of (x, y) pairs.
__repr__() → strCalls repr on this GraphicsPath instance.

See Also