Module iron_shapes::traits[][src]

Common traits for geometrical objects.

Traits

BoundingBox

Calculation of the 'bounding box', i.e. the smallest rectangle that contains the geometrical object.

DoubledOrientedArea

Calculate the doubled oriented area of a geometry. Using the doubled area allows to compute the area without using fractions. This is especially helpful when computing in integer coordinates.

MapPointwise

Transform the geometrical object by transforming each point of it.

Mirror

Mirror at the x or y axis.

RotateOrtho

Rotate by a integer multiple of 90 degrees.

Scale

Scale the geometrical shape. Scaling center is the origin (0, 0).

Translate

Translate the geometrical object by a vector.

TryBoundingBox

Try the calculation of the 'bounding box', i.e. the smallest rectangle that contains the geometrical object. In some cases this is not always possible, so the try might fail. For instance a set of polygons does not have a bounding box if the set is empty.

TryCastCoord

This trait defines the type-casting of the coordinate types for geometrical objects.

WindingNumber

Compute the winding number of a geometrical object around a point. The winding number is used to check if a point is contained in a shape.