docstr: Computes the squared euclidean distance of points to edges
  Args:
      point: FloatTensor of shape (3)
      tri: FloatTensor of shape (3, 3)
  Returns:
      dist: FloatTensor of shape (1)
docstr_tok: ["Computes","the","squared","euclidean","distance","of","points","to","edges","Args",":","point",":","FloatTensor","of","shape","(","3",")","tri",":","FloatTensor","of","shape","(","3",",","3",")","Returns",":","dist",":","FloatTensor","of","shape","(","1",")"]
code: def _point_to_tri_distance(
      point: torch.Tensor, tri: torch.Tensor
  ) -> torch.Tensor:
      """
      Computes the squared euclidean distance of points to edges
      Args:
          point: FloatTensor of shape (3)
          tri: FloatTensor of shape (3, 3)
      Returns:
          dist: FloatTensor of shape (1)
      """
      a, b, c = tri.unbind(0)
      cross = torch.cross(b - a, c - a)
      norm = cross.norm()
      normal = torch.nn.functional.normalize(cross, dim=0)
  
      # p0 is the projection of p onto the plane spanned by (a, b, c)
      # p0 = p + tt * normal, s.t. (p0 - a) is orthogonal to normal
      # => tt = dot(a - p, n)
      tt = normal.dot(a) - normal.dot(point)
      p0 = point + tt * normal
      dist_p = tt * tt
  
      # Compute the distance of p to all edge segments
      e01_dist = TestPointMeshDistance._point_to_edge_distance(
          point, tri[[0, 1]]
      )
      e02_dist = TestPointMeshDistance._point_to_edge_distance(
          point, tri[[0, 2]]
      )
      e12_dist = TestPointMeshDistance._point_to_edge_distance(
          point, tri[[1, 2]]
      )
  
      with torch.no_grad():
          inside_tri = TestPointMeshDistance._is_inside_triangle(
              p0, tri
          )
  
      if inside_tri and (norm > TestPointMeshDistance.eps()):
          return dist_p
      else:
          if e01_dist.le(e02_dist) and e01_dist.le(e12_dist):
              return e01_dist
          elif e02_dist.le(e01_dist) and e02_dist.le(e12_dist):
              return e02_dist
          else:
              return e12_dist
  
imports: import unittest
  import numpy
  import torch
  from pytorch3d import _C
  from pytorch3d.loss import point_mesh_edge_distance, point_mesh_face_distance
  from pytorch3d.structures import Meshes, packed_to_list, Pointclouds
  from .common_testing import get_random_cuda_device, TestCaseMixin
label_desc: Use image node_id 8 for calling the TestPointMeshDistance obj's underlying member method code with example usage: obj._point_to_tri_distance(point, tri) and returns: dist_p, e01_dist, e02_dist, e12_dist