Trying to project face to uneven surface

I have this outline that I want to project onto this group. Is there any way I can get this done using the API so that it looks like the second gif.

Perhaps you could position the pattern above the target surfaces, and then fire rays directly downward ?

It’s going to be a tough one. Maybe the Sketchup::Entities#intersect_with method ? (You’d have to extrude the pattern into a set of solid volumes.)

I tried raytest using the verticies of the polygons but that is what got me the result in the first gif. I think I need to generate a bunch of points using the projected polygon and then raytest using those points the problem comes from trying to figure out where to do that.