Basics of vedo#

from vedo import *

settings.default_backend = "vtk"  # or k3d, ipyvtk, trame, or 2d
# Show an empty window (press q to close it)
plt = Plotter()
plt.show()
plt.close()
sphere = Sphere().linewidth(1)
sphere

Sphere:   vedo.mesh.Mesh
bounds
(x/y/z)
-0.9977 ... 0.9977
-0.9977 ... 0.9977
-1.000 ... 1.000
center of mass (0, 0, 0)
average size 1.000
nr. points / faces 1058 / 2112
plt = Plotter()
plt += sphere
plt.show()
plt.close()
# We can add multiple objects:
plt = Plotter()

# Add a sphere
sphere = Sphere(r=1.5).c("red", 0.2)

# Add a box
box = Box(pos=(1, 0, 0)).triangulate().c("green", 0.2) 

# We can get its intersection
intersection = sphere.intersect_with(box).linewidth(4).c("black")

plt += sphere
plt += box
plt += intersection

plt.show()
plt.close()