#helix #wasm #web-apps #diffraction

bin+lib helixiser

A crate for the calculation of diffraction patterns of helical objects

7 unstable releases (3 breaking)

0.4.2 Jan 24, 2021
0.4.1 Jan 23, 2021
0.3.0 Jan 22, 2021
0.2.1 Jan 21, 2021
0.1.0 Jan 19, 2021

#704 in Images

MIT license

44KB
542 lines

A library for the calculation of diffraction patterns of helical objects

Web application

The helixiser rust crate serves as the backend for the Helixiser web application when compiled to WebAssembly.

You can try the web application at https://nemoandrea.github.io/helixiser/

Getting started

Helixiser revolves around helix objects.

  1. Let's create a family of helices
let strand_1 = Helix {
    radius: 1.,
    rise: 0.34,
    frequency: 10.,
    unit_size: 0.18,
    offset: 0.,
    rotation: 0.,
    handedness: Handedness::Right,
};

let strand_2 = Helix {
    rotation: 143.,
    ..strand_1  // copy remaining fields over from strand 1
};

let dna_helices: Vec<Helix> = vec![strand_1, strand_2];
  1. Compute the "analytic diffraction pattern" for this family of helices and save as image
// lets get an image (as a 1D array, with values in order (R,G,B,A) and then next pixel etc.
let my_diffraction: Wavefront = diff_analytic(dna_helices, 5, 1, 0.01, 512);

// use the [image] crate to save array as an image for image
my_diffraction.rescale(12.);
my_diffraction.save_image("B-DNA_diffraction.png");

Dependencies

~17MB
~130K SLoC