Intersect shapes via scripting


I’d like to make something like this:

This image is created with Affinity Designer by intersecting layers. One layer with a shape of S and other filled up with small squares.

Is there a way to do this in Glyphs via scripting? How to intersect one shape with a pattern of shapes? Is it possible in Glyphs?


Ok, I got this with: selectedLayer.pathIntersect_(None)