How nperreau/moleculeviewer works
Molecule Viewer is a Unity application for turning a SMILES string into an interactive 3D molecular view. The documented workflow accepts the string, processes it with RDKit, retrieves metadata and nomenclature from PubChem, and renders the resulting structure for exploration. The graph also shows the documented rotation and photo-mode capabilities. The README supplies the high-level architecture; source excerpts were limited to generated Burst code, so detailed call ownership and some component wiring cannot be verified.
Main entry points: SmilesInputUpdater.cs SMILES entry · PubChemAPI.cs PubChem lookup · RDKit3DGenerator.cs Structure processing · MoleculeNameLoader.cs Name display
Components 11
Input
- SMILES entry
Assets/MoleculeViewer/Scripts/SmilesInputUpdater.cs
Chemistry and metadata
- Structure processing
Assets/MoleculeViewer/Scripts/RDKit3DGenerator.cs - PubChem lookup
Assets/MoleculeViewer/Scripts/PubChem/PubChemAPI.cs - Name display
Assets/MoleculeViewer/Scripts/MoleculeNameLoader.cs
Visualization
- Molecule rendering
- Atom materials
Assets/MoleculeViewer/Scripts/MaterialList.cs
Interaction
- Molecule rotation
Assets/MoleculeViewer/Scripts/MoleculeRotator.cs - User controls
Assets/MoleculeViewer/Inputs/User Inputs Action.cs - Photo mode
Assets/MoleculeViewer/Scripts/Photo.cs
Other components
- User
- PubChem REST API
Connections 12
- User → SMILES entry: enters SMILES
- SMILES entry → Structure processing: provides input
- SMILES entry → PubChem lookup: provides input
- PubChem lookup → PubChem REST API: requests metadata
- PubChem lookup → Name display: provides nomenclature
- Structure processing → Molecule rendering: provides structure
- Name display → Molecule rendering: provides metadata
- Atom materials → Molecule rendering: styles atoms
- User → User controls: operates
- User controls → Molecule rotation: drives rotation
- Molecule rotation → Molecule rendering: updates view
- User → Photo mode: captures view