Skip to content
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

autopaste: paste strand with translation auto-calculated from last paste #580

Closed
dave-doty opened this issue Mar 20, 2021 · 0 comments
Closed
Labels
closed in dev Indicates issue is closed in the dev branch, available at: https://scadnano.org/dev/ enhancement New feature or request high priority Something cruicial to get working soon.

Comments

@dave-doty
Copy link
Member

dave-doty commented Mar 20, 2021

This idea originated with ENSnano, developed by Nicolas Schabanel and Nicolas Levy.

Currently, when pasting a copied strand, the only way to specify where it goes is to place the mouse cursor as a guide.

Frequently, it is the case that we will copy strands, paste them at a certain translation away from the original, and then want to repeatedly paste other copies at the same translation from the last pasted strand. For example, we copy these strands:

image

we manually paste them below:

image

Now, press Ctrl+Shift+V to autopaste. The strands will be pasted again, with the same translation (down by two helices) as between the original copied strands and the first paste:

image

Pressing Ctrl+Shift+V repeatedly will continue pasting strands along this same translation until they cannot be pasted anymore (because it would be out of bounds for the current helices):

image

More generally, the "translation vector" between the copied and pasted strands is in "y-axis units of Helix idx, in order of helices_view_order", "direction" (forward or reverse), and "x-axis units of offsets".

It is only possible to use this within one HelixGroup.

Combined with issue #579, this could reduce the time it takes to create a large design.

Even faster default translation

For even faster pasting for a common translation, if a strand has been copied, but no paste has occurred yet, then it is assumed that the translation is computed as follows

  1. Move strands down (increase Helix idx, or more generally iterating through Helices in order of helices_view_order in the HelixGroup), keep forward the same, until first helix where they can be pasted legally.
  2. If rule 1 is not possible with existing helices, move right (increasing offset, keep Helix idx and forward same) until they can be pasted.
  3. Otherwise don't paste anything.

If strands come from more than one HelixGroup, don't paste.

For example, if we select the following strand:

image

and press Ctrl+Shift+V to autopaste (without having pasted already), this is the result:

image

This can be repeated as before:

image

@dave-doty dave-doty added enhancement New feature or request high priority Something cruicial to get working soon. labels Mar 20, 2021
@dave-doty dave-doty changed the title paste strand with translation auto-calculated from last paste autopaste: paste strand with translation auto-calculated from last paste Apr 10, 2021
@dave-doty dave-doty added the closed in dev Indicates issue is closed in the dev branch, available at: https://scadnano.org/dev/ label Apr 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed in dev Indicates issue is closed in the dev branch, available at: https://scadnano.org/dev/ enhancement New feature or request high priority Something cruicial to get working soon.
Projects
None yet
Development

No branches or pull requests

1 participant