Draw simple atomic models consisely using the power of CeTZ and Typst.
Usage
To draw a simple atom use
#atom(atomic number (proton count), mass number (neutron count), electrons per shell, shells: 1.0, step: 0.4, center: 0.6, color: luma(90%))
The electrons should be passed in an array where the index corresponds to the shell, while the value is the amount of electrons on that shell. Here is an example:
#atom(29,64, "Cu", (1, 8, 18, 2))
You can also auto-populate orbitals.
#atom(29,64,"Cu",29)
To draw the same in a CeTZ canvas, use draw-atom
, which takes the same arguments as atom
#cetz.canvas({
draw-atom(29,64, "Cu", (1, 8, 18, 2))
})
If you’d like to exclusively draw the shells (for example to draw your own core) use draw-orbital(radius, electrons, color: luma(90%))