-
Notifications
You must be signed in to change notification settings - Fork 13
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
swap position x z coordinate interpretation #488
Comments
@dave-doty Is this the correct way to access and write to the position field? if (position_x_z_should_swap && grid_is_none) {
// prior to version 0.13.0, x and z had the opposite role
num swap = helix_builder.position_.x;
helix_builder.position_.x = helix_builder.position_.z;
helix_builder.position_.z = swap;
} I'm running into weird issues where the fields are still null after I set them. |
Should be. Make sure the builder is being built and re-stored wherever it needs. (I'm not sure which line of code this is.) |
@dave-doty I investigated some more and it turns out the issue has to do with the |
It's probably a mistake to have a global |
@dave-doty Seems like if (position_x_z_should_swap && (grid_is_none && !grid_is_none || helix_builder_is_in_none_grid)) {
// prior to version 0.13.0, x and z had the opposite role
num swap = helix_builder.position_.x;
helix_builder.position_.x = helix_builder.position_.z;
helix_builder.position_.z = swap;
} Any suggestions on getting the |
I don't know, I'd have to get back into that code and inspect to see. If |
I think It is not nullable: scadnano/lib/src/state/helix.dart Line 67 in 36d27dd
and the
Don't think any other actions touch the |
@dave-doty Thinking of reusing this test: scadnano/test/other_unit_test.dart Lines 140 to 187 in 36d27dd
Planning to uncomment the expect statements. Is the TODO comment relevant anymore? Thinking of removing it. |
Another thing to fix is to change the labels and variables associated with #308 (inverting y axis) specifically the part inverting of the z-axis would instead now be inverrting the x-axis |
Fixes #488; swap position x z coordinate
Undo what was done to close issue #307.
What I didn't realize when that was implemented is that it switched us from a right-handed coordinate system to a left-handed coordinate system. We want to go back to right-handed to make it simpler to export to 3D tools such as oxDNA.
Let's ensure backward compatibility here by bumping the minor version number once this is fixed, checking the version on import from a
.sc
file, and swapping the x-z coordinates on prior versions.Related to Python package issue 144.
The text was updated successfully, but these errors were encountered: