Object ‘snap’ to a Boundary line

Hi all,
I am cautious if there is a button or plugin can work similar to “move object to plane” button, so that you can provide a vector for a shape (say,rectangle), then let it snap to boundary line ,but at the same time it can somehow rotate the object to make a perfect fit to the boundary line (see attached images).
Thanks for any hint,

You can use Kangaroo to achieve what you want:

Jack_Zeng.gh (23.7 KB)

Great! thanks Mahdiyar!

Hi Mahdiyar,
I have play around with your GH file and think it is really great.
But I realize when you use a true circle as the object the Kangaroo doesn’t work…
Although I know we can use polygon to mimic true circle, I just wonder why it doesn’t accept circle.
Would you know why?

TEST 01.3dm (42.1 KB)
TEST 01.gh (38.9 KB)


I remember now…you cannot feed any curves into kangaroo.
Kangaroo takes straight lines only.

Now you can!


Wooooww, cool!
Thanks for the big progress Daniel!