-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in conversion of certain euler angles when loading star file #366
Comments
+1 on pushing this over to scipy - I'm not sure of the best way to handle these floating point errors in a general way within |
Oooh this is a funky one. We are in luck though, as of Blender 4.0, Geometry Nodes now explicitly supports quaternions. They were actually always using quaternions under the hood, and just exposing eulers to the user. Which means we should be able to use the This is actually a refactoring across all of MN that can be done, for the biological assembly and CellPack instancing as well can be changed to in theory, remove the necessity for The major refactoring I am now done with (I think), so hopefully it is clear how the package still works. If you'd like to open a PR for the starfile stuff, then I can add in the CellPack / biological assembly stuff as well (unless you wanted to have a crack at them as well). |
Actually looking in to the Blender |
Using quaternions is probably the way to go, especially when thinking about animations, but the problem then becomes converting the relion/frealign euler angle conventions into blenders quaternion convention. Thinking about it a bit, probably the neatest approach would be to do this conversion inside Geometry Nodes using "Rotate around axis" nodes. This way this is completely exposed in the node tree and could be easily tinkered with. So in this scenario:
I will look into this and create a PR for the starfile code first and we can go from there to assembly/cellpack (my impression was that assembly use a transformation matrix, right?) |
Yeah that's a good idea to just keep the raw The assembly / cellpack uses rotation matrices, which is where I can replace the currently |
This should now be fixed in the latest release after #374 . |
Describe the bug
Some eulerangles are not converting correctly into blender coordinate system. It might be related to this bug, alisterburt/eulerangles#8, in the eulerangles package used for the conversion.
This can be fixed when falling back to the previous conversion code from
to
Happy to submit a PR, but noticed you are currently making the 4.0 transistion and refactoring a bit, so I can wait until this is more or less finished.
Thanks,
Johannes
To Reproduce
I pasted a diagnostic starfile below
Expected behavior
Currently this loads like this (notice incosnisten behaviour in central cross):
while it should look like this
Error Codes
Please include associated error codes that are shown in the python console when the error occurs.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: