module Chem::Gen

Defined in:

chem/formats/gen.cr

Class Method Summary

Class Method Detail

def self.read(io : IO, guess_bonds : Bool = false, guess_names : Bool = false) : Structure #

Reads the structure from io.

Fractional coordinates are always converted to Cartesian coordinates.


[View source]
def self.read(path : Path | String, guess_bonds : Bool = false, guess_names : Bool = false) : Structure #

Reads the structure from path.

Fractional coordinates are always converted to Cartesian coordinates.


[View source]
def self.write(io : IO, obj : Structure | AtomView, fractional : Bool = false) : Nil #

Writes a structure or group of atoms to io.

Atom positions are written in fractional coordinates if fractional is true, Cartesian otherwise. Raises Spatial::NotPeriodicError if fractional is true and the structure is not periodic.


[View source]
def self.write(path : Path | String, obj : Structure | AtomView, fractional : Bool = false) : Nil #

Writes a structure or group of atoms to path.

Atom positions are written in fractional coordinates if fractional is true, Cartesian otherwise. Raises Spatial::NotPeriodicError if fractional is true and the structure is not periodic.


[View source]