Skip to content

Commit bfae45a

Browse files
majinge7846yaugenst-flex
authored andcommitted
feat: abstract simulation support plot_3d too
1 parent 70af873 commit bfae45a

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

tidy3d/components/base_sim/simulation.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,3 +702,15 @@ def from_scene(cls, scene: Scene, **kwargs) -> AbstractSimulation:
702702
medium=scene.medium,
703703
**kwargs,
704704
)
705+
706+
def plot_3d(self, width=800, height=800) -> None:
707+
"""Render 3D plot of ``AbstractSimulation`` (in jupyter notebook only).
708+
Parameters
709+
----------
710+
width : float = 800
711+
width of the 3d view dom's size
712+
height : float = 800
713+
height of the 3d view dom's size
714+
715+
"""
716+
return self.scene.plot_3d(width=width, height=height)

tidy3d/components/mode/mode_solver.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2671,3 +2671,15 @@ def _patch_data(self, data: ModeSolverData):
26712671
self._cached_properties["data_raw"] = data
26722672
self._cached_properties.pop("data", None)
26732673
self._cached_properties.pop("sim_data", None)
2674+
2675+
def plot_3d(self, width=800, height=800) -> None:
2676+
"""Render 3D plot of ``ModeSolver`` (in jupyter notebook only).
2677+
Parameters
2678+
----------
2679+
width : float = 800
2680+
width of the 3d view dom's size
2681+
height : float = 800
2682+
height of the 3d view dom's size
2683+
2684+
"""
2685+
return self.simulation.plot_3d(width=width, height=height)

0 commit comments

Comments
 (0)