def project_verteces(self, mesh, orientation):
"""Supplement the mesh array with scalars (max and median)
for each face projected onto the orientation vector.
Args:
mesh (np.array): with format face_count x 6 x 3.
orientation (np.array): with format 3 x 3.
Returns:
adjusted mesh.
"""
mesh[:, 4, 0] = np.inner(mesh[:, 1, :], orientation)
mesh[:, 4, 1] = np.inner(mesh[:, 2, :], orientation)
mesh[:, 4, 2] = np.inner(mesh[:, 3, :], orientation)
mesh[:, 5, 1] = np.max(mesh[:, 4, :], axis=1)
mesh[:, 5, 2] = np.median(mesh[:, 4, :], axis=1)
sleep(0) # Yield, so other threads get a bit of breathing space.
return mesh
评论列表
文章目录