Visualize Tidy3D simulations directly inside VS Code. Detect simulations in your Python files or notebooks, open an interactive 2D/3D viewer, and see changes update as you edit.
Features
Automatic detection of Tidy3D simulations in Python files and notebooks
Quick pick when multiple simulations exist in a file/cell
Live updates while you edit (debounced ~500 ms)
Status bar integration: simulation count and kernel readiness
Runs Python in-browser via Pyodide; installs tidy3d on first use
Embedded Tidy3D web viewer for rich 3D controls and inspection
Requirements
VS Code 1.99.0 or newer
Internet access for the first run (downloads the Python runtime, tidy3d, and loads the Tidy3D web viewer)
Install
From the Marketplace: search for “Tidy3D Viewer” in VS Code
Or install a packaged .vsix via the Extensions view menu → “Install from VSIX…”
Quick Start
Open a Python file or a Jupyter notebook in VS Code that defines a Tidy3D simulation (for example, sim = td.Simulation(...)).
Open the viewer:
Command Palette → “Open Tidy3D Viewer”
Or click the Tidy3D status bar item when it shows “Tidy3D: N simulations”
Or right‑click inside a Python editor and choose “Open Tidy3D Viewer”
If multiple simulations are detected, pick one. You can open multiple viewer panels (one per simulation).
Edit your code. The viewer refreshes automatically after short pauses.
Notebook support
Focus the code cell that defines your simulation and run “Open Tidy3D Viewer”. The extension includes imports and definitions from earlier Python cells so your simulation evaluates correctly.
Edits in any Python cell in the same notebook will trigger a refresh for the focused simulation.
How It Works
The extension slices the minimal Python needed to construct your selected simulation and evaluates it in a shared Pyodide worker.
The resulting simulation JSON is sent to an embedded Tidy3D viewer loaded from tidy3d.simulation.cloud inside the VS Code webview.
Privacy and Network Usage
First use downloads Pyodide and the tidy3d package; subsequent runs are faster due to caching.
The viewer UI is loaded from https://tidy3d.simulation.cloud/simulation-viewer and receives your simulation JSON via postMessage for rendering inside the webview.
No separate telemetry is added by this extension.
Troubleshooting
Viewer stays blank: wait a moment or use the panel’s refresh control. Resizing the panel can also help.
Nothing detected: confirm your code assigns a simulation to a variable, e.g. sim = td.Simulation(...).
First run is slow: allow the initial downloads to complete; a status bar item shows “Tidy3D Kernel: ready” when Python is warmed up.
Changelog and Support
See CHANGELOG.md for notable changes.
Development and contributing docs live in docs/README.md.