#螺旋 #WebAssembly #Web应用 #衍射

bin+lib helixiser

用于计算螺旋物体衍射模式的软件包

7 个不稳定版本 (3 个破坏性更新)

0.4.2 2021年1月24日
0.4.1 2021年1月23日
0.3.0 2021年1月22日
0.2.1 2021年1月21日
0.1.0 2021年1月19日

#740 in 图像

MIT 许可证

44KB
542

用于计算螺旋物体衍射模式的库

Web应用

helixiser Rust 软件包在编译成 WebAssembly 时作为 Helixiser Web应用的底层。

您可以在 https://nemoandrea.github.io/helixiser/ 尝试Web应用

入门

螺旋化器围绕 helix 对象。

  1. 让我们创建一个螺旋家族
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. 计算这个螺旋家族的“解析衍射模式”并将其保存为图像
// 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");

依赖项

~9MB
~131K SLoC