def _signed_volume_of_tri(self, tri):
"""Return the signed volume of the given triangle.
Parameters
----------
tri : :obj:`numpy.ndarray` of int
The triangle for which we wish to compute a signed volume.
Returns
-------
float
The signed volume associated with the triangle.
"""
v1 = self.vertices_[tri[0], :]
v2 = self.vertices_[tri[1], :]
v3 = self.vertices_[tri[2], :]
volume = (1.0 / 6.0) * (v1.dot(np.cross(v2, v3)))
return volume
评论列表
文章目录