Builder.add()
Add an atom.
Usage
Builder.add(
symbol,
parent=None,
slot=None,
*,
toward=None,
length=None,
)Parameters
symbol: str-
Atomic symbol.
parent: int | None = None-
Atom to bond to. Must be
Nonefor the first atom, which goes at the origin. slot: int | None = None-
Slot of
parentto bond through. If neither this nortowardis given, use the first empty slot. toward: ArrayLike | None = None-
Direction to bond in. The empty slot of
parentclosest to this direction is used. length: float | None = None-
Bond length. Defaults to
xh_lengthfor bonds to hydrogen andxy_lengthotherwise.
Returns
int- Index of the new atom.
Raises
ValueError- If the parent, slot, or position is invalid.