Understanding the path interior
Paths can be more complex than just a circle or convex polygon. Take a quick look at these three examples:
Figure 7.1 – Various paths
In Figure 7.1, we have different questions regarding how to color areas, such as the following:
- In the triangle, do we consider the inner triangle as inside or outside? Can we fill the complete big triangle or just the space between them?
- Can we color the full star shape or just the spikes?
- Can we color small segments of that multiple-circle path?
This section will help us to answer these questions. Regarding the third point, the following section, Clipping a drawing, will provide us with a tool.
For different area selecting and coloring, TikZ implements two different interior rules, used in computer graphics. We will discuss them both now.
The nonzero rule
Let’s say we have a closed path. Naturally, that path has a direction from start to end...