# API Reference


## Classes


Core classes


[Builder](Builder.md#tetramol.Builder)  
Build a molecule atom by atom on a tetrahedral grid.


## Builder Methods


Methods for the Builder class


[Builder.slot_direction()](Builder.slot_direction.md#tetramol.Builder.slot_direction)  
Get the unit direction of a slot of an atom.

[Builder.open_slots()](Builder.open_slots.md#tetramol.Builder.open_slots)  
List the empty slots of an atom.

[Builder.add()](Builder.add.md#tetramol.Builder.add)  
Add an atom.

[Builder.add_hydrogens()](Builder.add_hydrogens.md#tetramol.Builder.add_hydrogens)  
Fill atoms up to their default valence (see `VALENCES`) with hydrogens.

[Builder.geometry()](Builder.geometry.md#tetramol.Builder.geometry)  
Get the geometry.

[Builder.umbrella_image()](Builder.umbrella_image.md#tetramol.Builder.umbrella_image)  
Add the mirror image of a branch, e.g. to draw an umbrella inversion.


## Functions


Public functions


[orient()](orient.md#tetramol.orient)  
Rotate a geometry by hand in the browser and get the rotation.

[render()](render.md#tetramol.render)  
Render a geometry as an SVG, looking down the z axis (x right, y up).

[tetrahedral_basis()](tetrahedral_basis.md#tetramol.tetrahedral_basis)  
Get the four bond directions of a tetrahedral grid.

[draw.orient_page()](draw.orient_page.md#tetramol.draw.orient_page)  
Make the web page for orienting a geometry in the browser.

[draw.serve_orient_page()](draw.serve_orient_page.md#tetramol.draw.serve_orient_page)  
Serve the orientation page from a local server, in a background thread.


## Constants


Module-level constants and data


[VALENCES](VALENCES.md#tetramol.VALENCES)  
Default number of bonds to each element, used by `Builder.add_hydrogens`.

[STYLE](STYLE.md#tetramol.STYLE)  
House style: flat atoms with black bonds, drawn as oriented (no auto-rotation).

[TETRAHEDRAL_ANGLE](TETRAHEDRAL_ANGLE.md#tetramol.TETRAHEDRAL_ANGLE)  
The ideal tetrahedral angle, arccos(-1/3) (about 109.47 degrees), in radians.

[XH_LENGTH](XH_LENGTH.md#tetramol.XH_LENGTH)  
Ideal bond length to hydrogen, in Angstroms.

[XY_LENGTH](XY_LENGTH.md#tetramol.XY_LENGTH)  
Ideal bond length between heavy atoms, in Angstroms.


## Other


Additional exports


[grid](grid.md#tetramol.grid)  
The tetrahedral grid: ideal bond directions, angles, and lengths.
