Note
Go to the end to download the full example code.
Subdivision
Example showing subdivided polyhedrons.
import pygfx as gfx
scene = gfx.Group()
material = gfx.MeshBasicMaterial(wireframe=True, side="front")
geometries = [gfx.tetrahedron_geometry(subdivisions=i) for i in range(4)]
for i, geometry in enumerate(geometries):
polyhedron = gfx.Mesh(geometry, material)
polyhedron.local.position = (6 - i * 3, 0, 0)
scene.add(polyhedron)
if __name__ == "__main__":
disp = gfx.Display()
disp.show(scene, up=(0, 0, 1))
Total running time of the script: (0 minutes 0.380 seconds)