Trait spade::HasPosition

source ·
pub trait HasPosition {
    type Scalar: SpadeNum;

    // Required method
    fn position(&self) -> Point2<Self::Scalar>;
}
Expand description

An object with position.

Vertices need to implement this trait to allow being inserted into triangulations.

Required Associated Types§

source

type Scalar: SpadeNum

The number type used by this coordinate type.

Required Methods§

source

fn position(&self) -> Point2<Self::Scalar>

Returns the position of this object.

Note: It is assumed that the position doesn’t change once it has been inserted into a triangulation. Failing this requirement can lead to crashes, invalid results or endless loops.

Implementors§