To determine if the path / shape of another one overlaps 1. Calculation of the area covered by the final shape achieved
2. The calculation of the sum of the areas of all forms independently (since this is SVG, and the details of each path element are known, this can be done)
3. Comparison of two areas. If the two areas are the same, then there is no overlap, otherwise at least 2 shapes overlap.
The difficult step is step 1, which can be roughly calculated using the pixel drawing algorithm (my preference). For other methods, you can move on to the next question about the overlap stack relative to the area of โโoverlapping circles
user2409836
source share