def getPrincipalAxes(self):
X = self.VPos - self.getCentroid()
XTX = (X.T).dot(X)
(lambdas, axes) = linalg.eig(XTX)
#Put the eigenvalues in decreasing order
idx = lambdas.argsort()[::-1]
lambdas = lambdas[idx]
axes = axes[:, idx]
T = X.dot(axes)
maxProj = T.max(0)
minProj = T.min(0)
axes = axes.T #Put each axis on each row to be consistent with everything else
return (axes, maxProj, minProj)
#Delete the parts of the mesh below "plane". If fillHoles
#is true, plug up the holes that result from the cut
评论列表
文章目录