gchemol_geometry/lib.rs
1// [[file:../gchemol-geometry.note::5e31e50b][5e31e50b]]
2//! # Example
3//!
4//! ```ignore
5//! use gchemol::geom::Superpose;
6//! use gchemol::Molecule;
7//! use gchemol::prelude::*;
8//!
9//! // load test molecules
10//! let mol1 = Molecule::from_file("tests/files/alignment/reference.mol2").unwrap();
11//! let mol2 = Molecule::from_file("tests/files/alignment/candidate.mol2").unwrap();
12//!
13//! // take the first 5 atoms for superposition
14//! let reference: Vec<_> = mol1.positions().take(5).collect();
15//! let candidate: Vec<_> = mol2.positions().take(5).collect();
16//!
17//! // align the candidate onto the reference
18//! let sp = Superpose::new(&candidate).onto(&reference, None);
19//!
20//! // apply superposition to all atoms
21//! let superimposed_structure = sp.apply(&candidate);
22//!
23//! // apply translation only
24//! let translated_structure = sp.apply_translation(&candidate);
25//! ```
26// 5e31e50b ends here
27
28// [[file:../gchemol-geometry.note::f065136b][f065136b]]
29use gut::prelude::*;
30// f065136b ends here
31
32// [[file:../gchemol-geometry.note::a70e28c8][a70e28c8]]
33mod alignment;
34mod base;
35mod traits;
36mod transform;
37
38pub mod random;
39// a70e28c8 ends here
40
41// [[file:../gchemol-geometry.note::62451bc9][62451bc9]]
42/// Three-dimensional Cartesian coordinates
43pub type Coord3 = [f64; 3];
44
45pub use crate::alignment::*;
46pub use crate::base::*;
47
48#[cfg(feature = "adhoc")]
49pub use crate::transform::*;
50
51pub mod prelude {
52 pub use crate::traits::*;
53}
54// 62451bc9 ends here