How to trim boundary rectangular panels with trimmed base surface?

Hi everyone!
What’s the best way to trim those rectangular panels exceeding the boundary of the surface (highlighted in blue)? I tried to cull the points outside the closed curve but it doesn’t work.

file attached below.

I haven’t been using GH for nearly 5 years now and everything is so rusty! Sorry for the naive nature of my question.

trim panels.gh (12.6 KB) trim panels.3dm (2.4 MB)

This could be one way.


trim panels_re.gh (9.3 KB)

Thanks a lot @HS_Kim! Really helps me to recapitulate forgotten logics!