Unveiling Interfaces and Structures: Cryogenic Laser Ablation and Plasma Focused Ion Beam Techniques for Complex and Beam-Sensitive Systems
Contents
Coin Cell Holder Notebook
import k3d
from k3d.transform import process_transform_arguments
import ipywidgets
import numpy as np
with open('data/Battery Holder.STL', 'rb') as stl:
data = stl.read()
plt_holder = [
k3d.stl(
data,
# wireframe=True,
color=0x008000,
)
]
process_transform_arguments(plt_holder[0],
rotation=[3, np.pi / 2, 10, 10])
plot = k3d.plot(
grid_visible=False, # hide grid
axes_helper=0, # hide axes
menu_visibility=False, # hide menu
camera_no_rotate=False, # disable rotation
)
plot += plt_holder[0]layout = ipywidgets.Layout(width="400px")
out = ipywidgets.Output(layout=layout)
with out:
plot.display()
alpha_slider = ipywidgets.FloatSlider(
value=0,
min=-360,
max=360,
step=0.5,
description='alpha [deg]',
# continuous_update=False,
layout=layout
)
beta_slider = ipywidgets.FloatSlider(
value=0,
min=-360,
max=360,
step=0.5,
description='beta [deg]',
# continuous_update=False,
layout=layout
)
def return_alpha_tilt(tilt_deg):
return k3d.transform(
rotation=[np.deg2rad(tilt_deg),0,1,0]
)
def return_beta_tilt(tilt_deg):
return k3d.transform(
rotation=[np.deg2rad(tilt_deg),1,0,0]
)
def tilt_alpha(change):
alpha_deg = change['new']
tf = return_alpha_tilt(alpha_deg)
plt_holder[0] = process_transform_arguments(
plt_holder[0],
transform = tf,
)
def tilt_beta(change):
beta_deg = change['new']
tf = return_beta_tilt(beta_deg)
plt_holder[0] = process_transform_arguments(
plt_holder[0],
transform = tf,
)
alpha_slider.observe(tilt_alpha,'value')
beta_slider.observe(tilt_beta,'value')ipywidgets.VBox(
[
out,
alpha_slider,
beta_slider
]
)VBox(children=(Output(layout=Layout(width='400px'), outputs=({'output_type': 'display_data', 'data': {'text/pl…