Skip to content

Added rotation matrix to headless mode#37

Merged
briling merged 1 commit intobriling:masterfrom
aligfellow:headless-rot
Mar 18, 2026
Merged

Added rotation matrix to headless mode#37
briling merged 1 commit intobriling:masterfrom
aligfellow:headless-rot

Conversation

@aligfellow
Copy link
Contributor

No description provided.

@briling
Copy link
Owner

briling commented Mar 18, 2026

Thanks! But how would you use it?

@aligfellow
Copy link
Contributor Author

v can translate a unit cell and we can make use of that in xyzrender. Normal rotation of a molecule is fine because we only need the positions. If there is a unit cell involved too, then we need to rotate that alongside the atoms. The rotation alone is fine because we can work out the rotation applied in v based on the positions. However, when we move the unit cell then we can't just get a rotation matrix to equivalently reorient the unit cell too.

So we can use vmol.capture(args=["exitcom:uz"])

Then with a cell, we return the translated + rotated coordinates, and also the rotation applied.
Alternatively, one could also simply return the reoriented cell alongside the xyz coordinates which may be more in keeping with printing the coordinates?
Or the cell could be printed in the header line of the xyz like the extxyz style.

Does that make any sense?

@briling
Copy link
Owner

briling commented Mar 18, 2026

oh now i see! i think extxyz makes sense too

@briling
Copy link
Owner

briling commented Mar 18, 2026

I will merge this one now and add extxyz header printout later today, so you can use the output you like more!

@briling briling merged commit 010e733 into briling:master Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants