-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: #475 adding labels #474
base: main
Are you sure you want to change the base?
Conversation
This will help people learn and understand better about 3d models
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job, @MYlab10! 🎉 Thank you for submitting your pull request for Virtuo-Learn. Our dedicated team will review it diligently.Your contribution is valuable and we appreciate your efforts to improve our project.
help users understand better about 3d models
This will help people learn and understand better about 3d models
Related Issue
Closes #475
Description
import pyvista as pv
from pyvista import examples
Download a sample mesh (bunny model)
mesh = examples.download_bunny_coarse()
Create a Plotter object
pl = pv.Plotter()
Add the bunny mesh to the plotter
pl.add_mesh(mesh, show_edges=True, color='white')
Add points on the mesh (for visualization, not necessary for labeling)
#pl.add_points(mesh.points, color='red', point_size=20)
Define the coordinates and labels for different parts of the bunny model
labels = {
"Ear Left": [-0.08508963,0.15244128,-0.07269581],
"Ear Right": [-0.01597024,0.13926028,-0.02299697],
"Nose": [-0.11643464,0.05128627,0.07609549],
"Bottom": [0.14346997,-0.08839463,0.04595339],
}
Add labels to the plotter
for label, coord in labels.items():
pl.add_point_labels([coord], [label], point_color='blue', point_size=10, font_size=20, text_color='black')
Set the camera position for a better view
pl.camera_position = [(0.02, 0.30, 0.73),
(0.02, 0.03, -0.022),
(-0.03, 0.94, -0.34)]
Show the plot
pl.show()
Screenshots
Checklist