Hello,
I am trying to fit a plane to the glenoid to define a new local coordinate system, to calculate the transform between that coordinate system and a previous one.
The glenoid’s previous coordinate system is currently aligned with the global coordinate system, so as far as I understand I can use this code from @lassoan for the transform calculation.
However, I am running into issues defining my new coordinate system.
My goal is to create a plane fit to the eigenvectors of the glenoid surface mesh, and then simply translate the origin of the coordinate system to 0,0,0 (so that I am only checking rotation differences from the original coordinate system).
I found this very useful code by @mau_igna_06 from this related topic.
It is exactly what I am looking for.
However, when I test it, the plane x and y are not aligned with the surface object y and y:
Looking at this section of the code
modelZ = np.zeros(3)
modelX = eigenvectors0[0]
modelY = eigenvectors0[1]
vtk.vtkMath.Cross(modelX, modelY, modelZ)
modelZ = modelZ/np.linalg.norm(modelZ)
modelOrigin = modelPointsMean
I would expect the X and Y axes to be like this (my end goal):
In fact, it seems like the code is somehow fitting to the orginal scapula model - I made the glenoid with the curve cut tool. Could the vertices of the rest of the scapula somehow still be references by the plane fitting code?
I also tested the script Fit Markups Plane to Model and the plane is similarly misaligned (this code explicitly defines center and normal direction, so I wanted to use it as a test - and do not understand why the normal is not aligned to the global Z axis):
Additional question:
Is there a way to visualize the global CS as axes centered at 0,0,0 instead of in the bottom right of the screen?
Thank you!
Eva