How to Create Molecular Models Using Claude

Three-dimensional molecular models can help students to visualise various bonds and reaction mechanisms.

They can be readily created using Claude, Gemini, ChatGPT and other suitable large language models. The prompt must encourage the reference of the Three.js library.

What is Three.js?

Three.js is a free, open-source JavaScript library used to create and display interactive 3D graphics directly in a web browser without needing any plugins.

By tapping into this library, the molecular models can be created more readily.

What is the prompt used?

Here’s a simplified prompt:
You are an expert coder and a high school Chemistry teacher. Create a Three.js model of xxx.


It is always good to include more details about the context i.e. what is the learner profile, which topic is this model used in, what are the key learning objectives.

What are some key considerations?

More likely than not, the first draft is not ideal. There will be awkward bond angles, inaccurate bond lengths and wrong relative atomic sizes to correct step by step.

For this model of benzene, after multiple iterations, we end up with something that looks rather decent:

However, the p orbitals are ovals, instead of having each half tapered towards the carbon atoms. The obvious step is to prompt the LLM to create tear-drop shaped p orbitals, which causes this:

Half an hour of prompting later, we got this:

Which was promising…. but frustrating. No matter how hard we prompted, we could not reach the appropriate shapes for p orbitals.

After leaving this model alone for a few days, we redefined the problem and envisioned each p orbital half as a curved cone with a hemisphere above it:

It then became a simple task to ensure that the radius of the hemisphere is the same as the radius of the curved cone.

Successful model of benzene with the correctly shaped p orbitals!

The key idea is to approach the prompting from a refreshed perspective – if approach X doesn’t work, perhaps approach Y would? – and be committed to designing the molecular models iteratively.

Here are more models we have created using the above approach. Please consider using them and sharing your feedback!

Scroll to Top