gnome.utilities.geometry

geometry package

This package has:

A few higher-level objects for geometry: a Bounding Box class and a Polygon class.

It also has some lover level code basic geometry that acts on numpy arrays of points:

i.e. a polygon is expressed as a Nx2 numpy array of float64

Some of these are in Cython for speed.

Submodules

Package Contents

Functions

is_clockwise_convex(poly)

returns True if the polygon is clockwise ordered, false if not

is_clockwise(poly)

returns True if the polygon is clockwise ordered, false if not

gnome.utilities.geometry.is_clockwise_convex(poly)

returns True if the polygon is clockwise ordered, false if not

expects a sequence of tuples, or something like it, of the points:

[ (x1, y1), (x2, y2), (x3, y3), …(xi, yi) ]

This only works for concave polygons. See:

http://paulbourke.net/geometry/clockwise/

gnome.utilities.geometry.is_clockwise(poly)

returns True if the polygon is clockwise ordered, false if not

expects a sequence of tuples, or something like it (Nx2 array for instance), of the points:

[ (x1, y1), (x2, y2), (x3, y3), …(xi, yi) ]

See: http://paulbourke.net/geometry/clockwise/