To create multiple copies of something in Apparatus, you use a "spread". Toby recorded a tutorial video about how to use spreads. It is a fine introduction for most practical purposes, and you should watch it!
https://player.vimeo.com/video/140149972
The rest of this note is targeted at CS-type people, who are curious about questions like: What are spreads, really? And how do they relate to more traditional CS concepts?
I will be speedy! I'm most interested in getting these thoughts out here quickly. Please let me know if something is unclear.
Here's a little story about some spreads. It shows, in miniature contrived form, all the mechanics that define how spreads work. Along the way, I'll introduce a model of "parallel worlds" – the best I know yet for understanding why spreads do what they do.
Here is a rectangle in Apparatus. In the spreadsheet, its X and Y parameters are set to numbers, positioning the rectangle.
Here X is set to spread([0,1,2])
, which means "a spread of the numbers 0, 1, and 2". This makes three rectangles with three different X positions.
What's happening here? One way to think about it is that the "spread" function creates three parallel worlds. In one world X is 0, in another it is 1, and in a third it is 2. The way the rectangle is drawn depends on X, so the rectangle looks different in the three worlds. Ultimately, Apparatus shows all these parallel worlds together in the same picture. This is how spreads let you make multiple copies of a shape.
The green "swatch" next to X marks that it is spread – it takes on different values in different worlds. The green swatch next to Rectangle marks that it too is spread. The "link" icon inside of the swatch means that it varies across the same three parallel worlds created by the use of spread
in X. (X is its "spread origin".) We will see later why this is important.
Here Fill Color is computed with a formula involving X. Within a single world, the X in this formula is just an ordinary number – not an array of numbers or a special object. But since X varies between worlds, Fill Color will vary too. In the end, it will be a spread, spread in the same way as X. (This is why it gets a green link swatch, like Rectangle.)
In effect, we have performed a functional-programming "map" operation on the values in the X spread, but this happens implicitly.