How to Align or Rotate shape to a specific direction?

Hello everyone,

I placed a rectangle by its center and moved it to the center of the 12 shapes I made in an ellipse. My goal is for the rectangles to follow the angle or direction of its respective shape. I’m not exactly sure how to do this but it should follow along the black lines I drew.

Thanks in advance.

SitePlanMH.gh (31.9 KB)

you can use Orient to do that:

SitePlanMH_Re.gh (17.1 KB)

or you could just create the rectangles on those planes directly:

SitePlanMH_Re2.gh (16.6 KB)

Thank you I used the first option you provided ! Just a quick question how does the Vector2Pt work in this process? Is it creating those imaginary black lines I had drawn based on the origin and point (in this case center point) I provided? If I were to move the point to another spot in that shape would the rectangle orientation be different?

Vector 2Pt creates a vector from two points A and B, here we are using Plane XY as point A, and all the Area Centroids of the split surfaces as point B:

then we create a XY plane centered on each Area Centroid point:

and Align those XY planes using the Direction of the Vectors we just created:

as last step we orient the Rectangle from its center point:

onto each of those aligned planes:

one very important thing to mention, Orient components wants reference Planes, and we are just providing the Rectangle center point, no Plane… why it works? GH -as standard behavior- whenever it wants a plane and you provide just a point, will draw the XY Plane centered on that point:

2 Likes

A clean explanation.

Conversely to this:

and in explanation to this:

when you feed a plane into an input expecting a point, the component assumes you mean the origin of the plane as a point.

1 Like