helixiser

Crates.iohelixiser
lib.rshelixiser
version0.4.2
created_at2021-01-19 23:18:37.170729+00
updated_at2021-01-24 00:01:22.972441+00
descriptionA crate for the calculation of diffraction patterns of helical objects
homepage
repositoryhttps://github.com/NemoAndrea/helix-fft/tree/master/wasm/helixiser
max_upload_size
id344193
size55,157
Nemo (NemoAndrea)

documentation

https://docs.rs/helixiser/

README

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");
Commit count: 0

cargo fmt