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
| Name | Type | Access | Description |
|---|---|---|---|
current_point | tuple[float, float] | None | Read | Where the last segment left off, or None for an empty path. |
is_empty | bool | Read | Whether the path has no segments at all. |
Methods
| Signature | Description |
|---|---|
__init__() | Calls init on this GraphicsPath instance. |
__len__() → int | Calls len on this GraphicsPath instance. |
__bool__() → bool | Calls bool on this GraphicsPath instance. |
move_to(x: float, y: float) → GraphicsPath | Start a new subpath at (x, y) (the m operator). |
line_to(x: float, y: float) → GraphicsPath | Add a straight segment to (x, y) (the l operator). |
curve_to(x1: float, y1: float, x2: float, y2: float, x: float, y: float) → GraphicsPath | Add a cubic Bézier curve to (x, y) (the c operator). |
quadratic_to(x1: float, y1: float, x: float, y: float) → GraphicsPath | Add a quadratic curve, written as the cubic that draws it exactly. |
close() → GraphicsPath | Close the current subpath back to where it started (h). |
rect(x: float, y: float, width: float, height: float) → GraphicsPath | Add a closed rectangle as its own subpath (the re operator). |
ellipse(x: float, y: float, width: float, height: float) → GraphicsPath | Add the ellipse inscribed in the box (x, y, width, height). |
circle(center_x: float, center_y: float, radius: float) → GraphicsPath | Add a circle of radius about (center_x, center_y). |
polyline(points: Iterable[Sequence[float]]) → GraphicsPath | Add an open subpath through points, a sequence of (x, y) pairs. |
polygon(points: Iterable[Sequence[float]]) → GraphicsPath | Add a closed subpath through points, a sequence of (x, y) pairs. |
__repr__() → str | Calls repr on this GraphicsPath instance. |