# How to find rotate direction?

Dear friends,
As a simple example, we have a path (closed loop) and a face (have direction). We don’t know start point of path. Now we wish to move face to path, make face perpendicular to path and execute “followme”. We can move face to path first point. Also we can rotate face in path first point and second point direction. Now we should rotate face 90 degrees. (rotate Clockwise or opposite). Direction should be toward inside of path but how can I understand this direction?

There are about three hundred thousand billion (plus-minus forty billion) different options to place your face on the path and follow. At least considering the built-in accuracy.

“You should describe more precisely what you want to achieve.”

• What will the final result look like?
• Is the shorter edge of the face always in the plane of the path?
• Is the normal vector of the face always parallel to the plane of the path?
• Are any edges of the face always perpendicular to one of the edges of the path?
• Is the path always a rectangle?
• Is the face always triangular?
• Does it matter which vertex of the face we align onto the path?
• etc…etc

Dear Dezmo,
Please don’t recount different options again!!! I don’t know answer of most of your questions and it depend on users that will use extension.
I used path and made a temporary face then check lower points of face after rotation 90 degree clockwise are inside of temporary face or not. If not rotate it 90 degree anticlockwise. This solution can cover most of options and I believe it is good enough.

Attached you can see result of codes. As you know user can select room shape and corners angle.