PFrames direction

Hello, is there a way to force alignment every time upwards on PFrames on the y axis.

Thanks for any help and ideas

You could maybe compare the y-axes of the planes to the z-axis of the world xy-plane, and adjust them accordingly?

When constructing a plane, the component will try to satisfy the X axis BEFORE trying to satisfy the Y axis.
So, if the two vectors are not perpendicular (and since the planes are orthogonal), the component will set the Y axis to the closest vector you input, that is also perpendicular to the X axis.

Note that we have to deal with vertical lines (or vertical ends of curves), where the tangent vector to the curve would be equal to the unit Z vector.
You can change the vector in the red blob to anything you want.
If you’re sure not to have vertical ends, you could remove that part and the dispaches as well :slight_smile:

Frame_alignments.gh (9.9 KB)

2 Likes

I don’t fully understand the script yet but I’ll take a close look to figure it out. The script and you are amazing. Thank you so much for your help