def boundingbox(nmtree): xmax = [-1.0e30, -1.0e30, -1.0e30] xmin = [1.0e30, 1.0e30, 1.0e30] for z in nmtree.NeuromechanicFile.Resources.Polygon: b = z.Origin.Parent.enum1_ if b > 0: # Make sure that the polygon isn't on the ground body fct, V = getMesh(z) if not V is None: for jj in range(V.shape[0]): x = nm.model_calclocaltoglobal(b, V[jj, 0:3].tolist()) xmax = [max(x[kk], xmax[kk]) for kk in range(3)] xmin = [min(x[kk], xmin[kk]) for kk in range(3)] return (xmax, xmin)
def pglobal(p): return np.array(nm.model_calclocaltoglobal(p.Parent.enum1_, p.x_.tolist()))