Rotation around moving plane/axis

Hello-

I’m trying to set up a script to rotate two breps, one along the end of the other. I’ve got a plane defined by the end of the first brep rotating as I’d expect, but the second object (and a curve I’ve aligned with it) seems to be moving around an axis unrelated to the new plane.

Can anyone point me towards how this should be set up, if I’m missing anything needed to rotate an object around a variable center point?

Multi Rotation Test.gh (12.1 KB)

Like this?

Multi Rotation Test-b.gh (15.7 KB)

Not quite-

I might need to phrase the question differently, I’m trying to get one brep to rotate around a point on another brep that is also rotating, my main issue is with the changing location of the smaller brep.

Any better?

Multi Rotation Test-c.gh (12.6 KB)

That looks good! From looking around at you script it looks like I should have been rotating the smaller brep first and then merging it with the larger one. Thanks for the help!