Note
Go to the end to download the full example code
Multiscaling and landmarksΒΆ
Landmarks are preserved in the multiscale representation.
Imports
import pyvista
from pyvista import examples
import skshapes as sks
Load a mesh and define landmarks
Create the multiscale representation
Create an animation of the shape at various scales with landmarks
cpos = [
(11.548847281353684, -19.784217817604652, 8.581378858601008),
(1.606399655342102, 2.120710074901581, 8.925199747085571),
(-0.021305501811855157, -0.025357814432988603, 0.9994513779267742),
]
p = pyvista.Plotter()
p.enable_hidden_line_removal()
p.open_gif("animation.gif", fps=2)
for ratio in [1, *ratios]:
p.clear_actors()
p.add_mesh(
multiscale.at(ratio=ratio).to_pyvista(),
color="tan",
opacity=0.99,
show_edges=True,
)
p.add_points(
multiscale.at(ratio=ratio).landmark_points.numpy(),
color="red",
point_size=20,
render_points_as_spheres=True,
)
p.camera_position = cpos
p.write_frame()
p.show()
Total running time of the script: (0 minutes 3.917 seconds)