Search code examples
paperjs

Nested polygons empty the filling of outer polygon


With the help of paper.js: Is it possible to create two polygons that lie on top of each other whereas one makes the color of the other transparent? Please see the image below as it makes the question more understandable.

enter image description here


Solution

  • Yes you can use CompoundPath to create complex shapes with holes. Here is an example.