pytorch3d.utils

pytorch3d.utils.ico_sphere(level: int = 0, device=None)[source]

Create verts and faces for a unit ico-sphere, with all faces oriented consistently.

Parameters:
  • level – integer specifying the number of iterations for subdivision of the mesh faces. Each additional level will result in four new faces per face.
  • device – A torch.device object on which the outputs will be allocated.
Returns:

Meshes object with verts and faces.

pytorch3d.utils.torus(r: float, R: float, sides: int, rings: int, device: Optional[torch.device] = None) → pytorch3d.structures.meshes.Meshes[source]

Create vertices and faces for a torus.

Parameters:
  • r – Inner radius of the torus.
  • R – Outer radius of the torus.
  • sides – Number of inner divisions.
  • rings – Number of outer divisions.
  • device – Device on which the outputs will be allocated.
Returns:

Meshes object with the generated vertices and faces.