Transform.changebasis seems to be giving me incorrect results, unless I’m misunderstanding somewhere here… I have two planes with a shared origin but different normals. I take a sphere with the same origin, and transform it via change basis from one plane to the next. I would expect the sphere to just rotate, but it translates too.
Any idea whats going on?
Thanks,
Sam
'create the start plane
Dim StartPlane = New Plane(New Point3d(50, 30, 20), New Vector3d(0, 0, 1))
Dim StartPlaneSurface As New PlaneSurface(StartPlane, New Interval(-111, 111), New Interval(-111, 111))
doc.Objects.AddBrep(StartPlaneSurface.ToBrep)
'create the end plane
Dim EndPlane = New Plane(New Point3d(50, 30, 20), New Vector3d(1, 1, 1))
Dim EndPlaneSurface As New PlaneSurface(EndPlane, New Interval(-111, 111), New Interval(-111, 111))
doc.Objects.AddBrep(EndPlaneSurface.ToBrep)
'create the transform
Dim xform = Transform.ChangeBasis(EndPlane, StartPlane)
'create the initial sphere
Dim spherestart As New Rhino.Geometry.Sphere(New Point3d(50, 30, 20), 50)
doc.Objects.AddBrep(spherestart.ToBrep)
'transform the sphere
spherestart.Transform(xform)
doc.Objects.AddBrep(spherestart.ToBrep)