# Geometry nodes, how to rotate a face?

this grid is a combination of doors and windows. is there a way to rotate these faces similar to the picture below?

001

002

Yes, there is a way. You will need to select each face by Index, offset it's center and then rotate it using set position node. Here is an example only for one face.

------------------------------------------------------
UPD

------------------------------------------------------
UPD2
When you have an ngon (polygon with more than 4 verts) it's not that simple to find it's center. So ther workaround here looks like this.
First,you can calculate the center of each face using node setup from this thread: Geometry Nodes. Find the center of a rectangle whether or not there are multiple vertices on one side
Second, you need to calculate the size of the face along Y axis.
Third, you need to substract half of the size of the face from it's position along Y axis and then you can rotate.
Hope this helps.

• thanks for your answer, I have tried it, and it creates a small gap between the rotated face and the others. also, it seems that it doesn't work on different forms of faces. (I uploaded the blend file ) Dec 1, 2023 at 21:00
• Use split edges and capture attrubute instead of separate geometry. Then it will work correctly. I added blend file to my answer. Take a look. Dec 1, 2023 at 21:13
• gap still there. Dec 1, 2023 at 21:23
• Updated blend file, shouldn't be any gap now Dec 1, 2023 at 21:32
• thank u, well done Dec 1, 2023 at 21:41