torch_geometric.transforms.FaceToEdge

class FaceToEdge(remove_faces: bool = True)[source]

Bases: BaseTransform

Converts mesh faces of shape [3, num_faces] or [4, num_faces] to edge indices of shape [2, num_edges] (functional name: face_to_edge).

This transform supports both 2D triangular faces, represented by a tensor of shape [3, num_faces], and 3D tetrahedral mesh faces, represented by a tensor of shape [4, num_faces]. It will convert these faces into edge indices, where each edge is defined by the indices of its two endpoints.

Parameters:

remove_faces (bool, optional) – If set to False, the face tensor will not be removed.