Shapes

Back to Data structures

A shape is a closed and simply connected subset of . A shape is called convex, if it holds that

A shape that is not convex is called concave. Shapes overlap if their intersection is non-empty.

Practice

Pastel implements various shapes, of which most are convex. The reason for this is that overlap testing between convex shapes is easier than between concave shapes.

Operator overloading

All shapes overload the operators +=, +, -=, and - to translate by a vector and the operators =, , /=, and / to scale by a real number. The scaling is always defined for a given shape so that it commutes with translation.

References

Geometric Tools for Computer Graphics, Philip J. Schneider, David Eberly, 2003.

Learn more

Files

Shape module

Template instantiation of shapes for testing