# Plane orientation

Hi!
I need to orient a number of planes so i can construct some beams (Sweep), but I´m missing something, because it doesn’t work.
the first line is horizontal but its plane it is the most rotated. The are vertical lines that show this.

Any thoughts?
Thank you

Plane Orientation.gh (14.9 KB)

Hi,

You’re not providing a plane as Master input M to the Align component, but a line. This is problematic because I believe the line gets interpreted as the Z-axis of a default XY-plane or something. You thus lose all other axis information that is still relevant.

In order to remedy this, you could calculate the cross product between the world Z-axis and the normal or Z-axis of your current plane, which should give you the X-axis of a new plane, whose Y-axis becomes the world Z-axis, and is thus aligned to the latter.

Plane Orientation Rev.gh (13.5 KB)

1 Like

It looks like you are looking for Align Plane (rather than Align Planes). This takes a Vector input, rather than a Plane.

Thanks! Would you please explain the “XProd” step? I don’t get why the cross product between “z” (which in this case is absolute vertical) and "Pframe"´s “z” (which are a kind of horizontal group of lines) is used as “x” for creating a new plane.

Thank again At each curve end you have a perpendicular frame, which is a plane whose Z-axis is tangential to the curve. The cross product between this Z-axis and and the Z-axis of the world XY-plane gives you a third vector that is perpendicular to both, and a “normal” to the curve (perpendicular to it).

A curve has an infinite number of normals like this - much like there are an infinite number of points on a circle -, but since this one is perpendicular to the world Z-axis, you can construct an new aligned plane with it as its X-axis and the world Z-axis as its Y-axis. It’s the same as rotating your original planes to align them to the world Z-axis, just done differently with the cross product, which is a super usual thing!

1 Like

I get it now.

Thank you very much 