Pen Stroke

Single Pen Stroke

EXAMPLES:

>>> sample_stroke
pen stroke with 40 points
class quill.stroke.Stroke(pressure, thickness, red, green, blue, points)[source]

Bases: quill.graphics_object_color.GraphicsObjectThicknessColor

get_point(i)[source]

Return the i-th point

Parameters:i (integer) – index of the point to return
Return type:a tuple containing three floats (x, y, and pressure)

EXAMPLES:

>>> sample_stroke.get_point(24)
(0.17748723924160004, 0.09612473845481873, 0.5307917594909668)
>>> sample_stroke[24]
(0.17748723924160004, 0.09612473845481873, 0.5307917594909668)
has_pressure()[source]

Return whether the pen stroke has varying width (fountain pen tool).

Return type:boolean

EXAMPLES:

>>> sample_stroke.has_pressure()
False
n_points()[source]

Return the number of sample points.

Return type:integer

EXAMPLES:

>>> sample_stroke.n_points()
40
>>> len(sample_stroke)
40
thickness()

Return the pen thickness.

The thickness is counted 1/1600f of the page height. Quill’s “ultra-fine” pen has a thickness of 1.

Return type:integer

EXAMPLES:

>>> sample_stroke.thickness()
5

Previous topic

Page of a Notebook

Next topic

Image

This Page