Hello Bryce,
I probably did back then. Just reusing old code right now.
The one you suggested gets it almost right, but the rotation about Z is wrong.
May have something to do with me trying to rotate on the spot, and not world 0,0,0.
In this specific use case, I don't want the Matrix from UCS to World (with 0,0,0), but between UCS-Normal and World-Z and keep UCS-Origin.
I'll keep playing around with it. I've got a version that does exactly what I want, just trying to simplify it.

------------------------------
Ronny Schneider
------------------------------
Original Message:
Sent: 03-07-2026 08:55
From: Bryce Haire
Subject: is there a more elegant way to compute the Matrix4D between two vectors - i.e. Normal and WCS
I'm guessing you tried the Matrix constructor (point, vector, vector)?
In this case, I believe the Z would be the Normal and Point3D.Zero as the origin.

------------------------------
Bryce Haire
Original Message:
Sent: 03-06-2026 21:21
From: Ronny Schneider
Subject: is there a more elegant way to compute the Matrix4D between two vectors - i.e. Normal and WCS
Currently I'm doing it the following way, result is correct, just wondering if there is a one-liner for it.
centerp = o.OriginOfUcs nv = o.Normal.Clone() # will only work if Normal != 0, 0, 1 vx = nv.Clone() # rotate 90 degrees around world-Z axis and make it level with world horizon vx.RotateAboutZ(math.pi/2) vx.Horizon = 0 # don't really need vy here - do it anyway # clone the axis and rotate it 90 degrees around Normal vy = vx.Clone() vy.Rotate(BiVector3D(nv, math.pi/2)) # vx, vy and Normal are now square to each other # compute matrix to line up UCS-X,Z with World-X,Z axis rottozero = Spinor3D.ComputeRotation(vx, nv, Vector3D(1,0,0), Vector3D(0,0,1)) # transformation to 0, 0, 0 #matrixtozero = Matrix4D.BuildTransformMatrix(Vector3D(centerp), Vector3D(centerp, Point3D(0, 0, 0)), rottozero, Vector3D(1,1,1)) #matrixbackfromzero = Matrix4D.Inverse(matrixtozero) # transformation without shift - just flatten it matrixtoflat = Matrix4D.BuildTransformMatrix(Vector3D(centerp), Vector3D(0, 0, 0), rottozero, Vector3D(1,1,1)) matrixbackfromflat = Matrix4D.Inverse(matrixtoflat)
Is there a built-in function to compute the Matrix4D between a Normal vector and World?
I've tried,
Plane3D.GetTransformMatrix(o.Normal)
as shown in the ConvertToLinestring sample macro, but the result is wrong.
------------------------------
Ronny Schneider
------------------------------