Skip to content
This repository was archived by the owner on Nov 27, 2024. It is now read-only.

Add visualisation #243

Open
samwaseda opened this issue Jan 11, 2024 · 2 comments · May be fixed by pyiron/structuretoolkit#184
Open

Add visualisation #243

samwaseda opened this issue Jan 11, 2024 · 2 comments · May be fixed by pyiron/structuretoolkit#184
Assignees
Labels
enhancement New feature or request

Comments

@samwaseda
Copy link
Member

Currently there's only 2D projections in pyiron, while most of the calculations are for 3D. @jan-janssen and I talked about the following possibilities:

  • plotly (example in the next comment)
  • PyVista (already part of dependencies)
  • paraview
@samwaseda samwaseda added the enhancement New feature or request label Jan 11, 2024
@samwaseda samwaseda self-assigned this Jan 11, 2024
@samwaseda
Copy link
Member Author

import plotly.graph_objects as go
data = go.Isosurface(
    x=x_mesh.reshape(-1, 3)[:, 0],
    y=x_mesh.reshape(-1, 3)[:, 1],
    z=x_mesh.reshape(-1, 3)[:, 2],
    value=values,
    isomin=0,
    isomax=0.5,
    surface_fill=0.5,
    # opacity=0.5,
    surface_count=5, # number of isosurfaces, 2 by default: only min and max
    # colorbar_nticks=3, # colorbar ticks correspond to isosurface values
    caps=dict(x_show=False, y_show=False, z_show=False),
    colorscale="Turbo"
)
fig = go.Figure(data=data)
fig = go.Figure(data=fig.data + gb.structure.plot3d(mode='plotly', particle_size=10).data)
fig.update_scenes(aspectmode='data')
# fig.layout.scene.camera.projection.type = 'orthographic'
# fig.show()
fig.update_layout(autosize=True, height=600) # remove height=800
# fig.show(renderer="browser")  # remove display(fig)

@samwaseda
Copy link
Member Author

Being implemented here

@mbruns91 mbruns91 linked a pull request Jun 4, 2024 that will close this issue
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant