xmcd_projection.stl_visualisation

class xmcd_projection.stl_visualisation.Visualizer(struct, magnetisation, p)

Bases: object

Object for visualising the xmcd projection on the stl file. This does not take into account the simulation or the raytracing and is just here for the quick rough visualization. This class has not been updated for a while so might not work properly.

generate_view()
save_render(filename, size=(1024, 1024))
set_camera(ele=90, azi=30, dist=500000.0, fov=1, center=[0, - 3000, 0])
show()
start()
update_data(struct, magnetisation)
xmcd_projection.stl_visualisation.show_magnetisation(struct, magnetisation, step=1, ax=None, rescale=True, length=100)

Shows vectors of magnetisation of the given trimesh structure on matplotlib quiver plot

Parameters
  • struct (trimesh) – structure to show

  • magnetisation – per vertex magnetisation vector (Nx3)

  • step – each how many points to show (if the structure has a lot of points, it is useful to only show say every 5th to speed up the plotting)

  • ax – axes on which to plot. If none new axes are created

  • rescale – if the axes should be rescaled to the new structure

Returns

ax

xmcd_projection.stl_visualisation.show_structure_points(struct, step=1, ax=None, rescale=True)

Shows points of the given trimesh structure on matplotlib plot

Parameters
  • struct (trimesh) – structure to show

  • step – each how many points to show (if the structure has a lot of points, it is useful to only show say every 5th to speed up the plotting)

  • ax – axes on which to plot. If none new axes are created

  • rescale – if the axes should be rescaled to the new structure

Returns

ax