rotate a plane to a face rot ?

I got a Bmesh plane or sort of plane with fillet

and I need to set this to same angles then a certain face on an object

how do you do that with smalls script ?

one problem is that if object has been Crtl-A then you loose the object rotations !

thanks
happy bl

You need to do the following:

  1. Get the face normal vector (it’s a property of the face)
  2. Convert local vector to global coordinates using global matrix of the object
  3. Get the normal vector of your new object
  4. Convert to global
  5. Using Vectors, calculate angle between them
  6. Apply Euler rotation using the difference of step 5

If I have time I will try to write a script.

Ctrl+A is not a problem, because normal vector will tell you the “direction” of the face in global space.

would help with min script to get this to work
and see how practical it can be

first first object would be nice to have option may be and work either with face or object rot
but this object if it is Ctrl-a you loose the rotation!

thanks
happy bl

If you use as origin rotation an object and the rotation is applied, you cannot get the rotation, so you must use a face of the original object to get the normal direction.

I will try to create an script :slight_smile:

Even the bounding box is changed with Ctral-A!

well I can always select on face on the first object function of global axis
but then might to use like and offset to help locate it

just wondering here
is not there a var like old rot for ob ?
saw something like that long time ago but never used it !

happy bl