7.8

6 Data Structures

Most functions defined in the previous sections aim at producing specific geometric shapes. In this section, we will address functions that aim at creating abstract geometric shapes, in the sense of being represented by a set of positions in space. For example, a polygonal line can be represented by the sequence of positions through which it passes. That sequence can, however, be used for various other purposes, such as creating a sequence of spheres located at those positions or defining the trajectory of a tube passing through those positions. These examples show that the way we manipulate these sets of positions is independent from their subsequent use.

In order to manage sets of positions as a whole, it is necessary to group them in what is called a data structure: a particular arrangement of data that allows it to be treated as a whole. For example, a phone book can be perceived as a data structure that establishes associations between names and phone numbers.