Spaces:
Running on Zero
Running on Zero
Ruining Li commited on
Commit ·
0a3ba4a
1
Parent(s): b195f11
Change preview axis orientation
Browse files
particulate/visualization_utils.py
CHANGED
|
@@ -58,6 +58,11 @@ def plot_mesh(mesh):
|
|
| 58 |
ax.legend()
|
| 59 |
ax.set_title("Mesh with Axes (Select Up Direction)")
|
| 60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
ax.set_box_aspect([1,1,1])
|
| 62 |
return fig
|
| 63 |
|
|
|
|
| 58 |
ax.legend()
|
| 59 |
ax.set_title("Mesh with Axes (Select Up Direction)")
|
| 60 |
|
| 61 |
+
# Rotate view 180 degrees around x-axis relative to the default view
|
| 62 |
+
current_elev = ax.elev if ax.elev is not None else 0
|
| 63 |
+
current_azim = ax.azim if ax.azim is not None else 0
|
| 64 |
+
ax.view_init(elev=-current_elev, azim=-current_azim)
|
| 65 |
+
|
| 66 |
ax.set_box_aspect([1,1,1])
|
| 67 |
return fig
|
| 68 |
|