Basic Types

Points

The most basic primitives spade can deal with are points.

There are many great crates out there that implement some sort of mathematical vector and point library. Spade didn't want to create its own point type and aims to be compatible with points from other crates instead. This is achieved with the PointN trait: It is implemented for the point types of all supported math libraries and gives you as a user the freedom to choose whichever library you want to use.

Currently, cgmath and nalgebra are supported as math crates. It is rather easy to implement PointN for other types, feel free to open up an issue if you are missing your favorite library.

Since we didn't want to force you to use any additional library, fixed size arrays of size 2 and 3 are also supported. We recommend using a proper point type though, as it tends to create better readable and less error prone code.

TL;DR

You're free to use most point types from the cgmath or nalgebra package with spade. Also, fixed size arrays are supported.

results matching ""

    No results matching ""