import sys,os,collections,math sys.path.insert(0,os.path.dirname(__file__)) from inv import readply,jacobi root,pid=sys.argv[1],sys.argv[2] for side in('left','right'): V,F=readply(os.path.join(root,'pairs',pid,side+'.ply')) n=len(V); m=[sum(v[i] for v in V)/n for i in range(3)] Q=[(v[0]-m[0],v[1]-m[1],v[2]-m[2]) for v in V] C=[[sum(q[i]*q[j] for q in Q)/n for j in range(3)] for i in range(3)] ev,vec=jacobi(C) P=[tuple(sum(q[k]*vec[i][k] for k in range(3)) for i in range(3)) for q in Q] web=[p for p in P if abs(p[0])<15] # cross-section in (axis1, axis2) at web: bin axis2 (width) and axis3 (thickness) values h=collections.Counter(round(p[2]*2)/2 for p in web) w=collections.Counter(round(p[1]) for p in web) print(pid[:8],side,'web n',len(web),'axis3 levels',sorted(h.items())) print(' axis2',sorted(w.items()))