geometry.coord_path

Build coordinate paths from common geometric shapes.

A coordinate path is an ordered collection of coordinates, as calculated from some parametric function. Provided functions include common geometric shapes, like lines, circles and Bézier curves.

The path coordinates are discretised to the grid (always integer values), and contain no adjacent duplicates (however, duplicates may occur in the total path if the parametric curve crosses itself).

supreme.geometry.coord_path.build(*iterables) Build a coordinate-path from one or more iterable.
supreme.geometry.coord_path.line(start, end) Generate coordinates for a line.
supreme.geometry.coord_path.circle(centre, ...) Generate coordinates for a circle.
supreme.geometry.coord_path.spline(pts) Generate coordinates for a cubic spline.

build

supreme.geometry.coord_path.build(*iterables)

Build a coordinate-path from one or more iterable.

Every iterator should yield coordinate tuples/arrays between (and including) start and end. The points generated should be roughly one pixel apart, and does not need to be discretised (i.e. (1.41,2.06) is fine).

line

supreme.geometry.coord_path.line(start, end)
Generate coordinates for a line.

circle

supreme.geometry.coord_path.circle(centre, radius)
Generate coordinates for a circle.

spline

supreme.geometry.coord_path.spline(pts)

Generate coordinates for a cubic spline.

A 4-dimensional (3rd order) spline is guided by a polyline through the provided list of points. At least 3 points must be specified.