Im having some problems with the Transform.GetYawPitchRoll Method. I made a Rotationmatrix that is Rotating a Circle by a given Vector Using Transform.Rotation. Actually the geometrical Rotation is done properly but if i want to calculate the Euler-Angles using the Transform.GetYawPitchRoll Method it fails to calculate the Angles. I cant understand why.
What am i doing wrong ? Am i missing something ?
I`m using Rhino6 Version 6.16.19190.7001
Here`s my method…
import System.Guid, System.Array, System.Enum
import rhinoscriptsyntax as rs
import scriptcontext as sc
import os, re, sys, fileinput, math, time, copy
from shutil import copyfile
from Rhino import *
from Rhino.Geometry import*
from System.Drawing import *
def positionhandler():
zvec = Vector3d(0,0,1)
centerpoint = Point3d(-480.65,1389.284,301.983)
rotvek = Vector3d(-0.001547,0.030698,0.999528)
rotvek.Unitize()
circleorig = Circle(centerpoint,42.61).ToNurbsCurve()
circlerot = circleorig.Duplicate()
rot = Transform.Rotation(zvec,rotvek,centerpoint)
eulerypr = Transform.GetYawPitchRoll(rot)
if eulerypr[0] == True:
print("Euler YPR")
print(eulerypr)
else:
print("No Eulerypr")
circlerot.Transform(rot)
sc.doc.Objects.AddCurve(circleorig)
sc.doc.Objects.AddCurve(circlerot)