Note
Go to the end to download the full example code.
example of hinge shaped surface¶
# Authors: Julien Lefevre <julien.lefevre@univ-amu.fr>
# License: MIT
# sphinx_gallery_thumbnail_number = 2
importation of slam modules
import slam.curvature as scurv
import slam.generate_parametric_surfaces as sgps
import numpy as np
Creating an examplar 3-4-…n hinge mesh
hinge_mesh = sgps.generate_hinge(n_hinge=4)
mesh_curvatures = scurv.curvatures_and_derivatives(hinge_mesh)
mean_curvature = 1 / 2 * mesh_curvatures[0].sum(axis=0)
Calculating vertex normals .... Please wait
Finished calculating vertex normals
Calculating curvature tensors ... Please wait
Finished Calculating curvature tensors
Calculating Principal Components ... Please wait
Finished Calculating principal components
VISUALIZATION USING plotly¶
import slam.plot as splt
display_settings = {}
display_settings['colorbar_label'] = 'Mean Curvature'
mesh_data = {}
mesh_data['vertices'] = hinge_mesh.vertices
mesh_data['faces'] = hinge_mesh.faces
mesh_data['title'] = 'Hinge'
intensity_data = {}
intensity_data['values'] = mean_curvature
intensity_data["mode"] = "vertex"
fig = splt.plot_mesh(
mesh_data=mesh_data,
intensity_data=intensity_data,
display_settings=display_settings)
fig.show()
fig
Total running time of the script: (0 minutes 4.992 seconds)