Orient and align profiles to curve

Hi all, I’m trying to align a profile (polygon) so that it stays tangent or aligned to one side of a curve that it intersects - I hope the images below illustrate what I’m trying to achieve - also attaching the definition. Thanks for any help!

2018_0520b.gh (25.4 KB)

Something like this?

2018_0520b_re.gh (28.2 KB)

Thank you HS_Kim - I’m looking through your solution to understand the logic - thanks very much!