Do[k=1;k≤nj,k++,(c=conn[[conj[[k]]]];
c=Take[c,P];
v=Table[Join[t[[c[[i]]]],{1}],{i,1,P}];
x2=t[[c[[2]],1]];
y2=t[[c[[2]],2]]; 
z2=t[[c[[2]],3]];
Q={{1,0,0,0},
{0,1,0,0},
{0,0,1,0},
{-x2,-y2,-z2,1}};
p=v.Q;
p=Table[Take[p[[i]],3],{i,1,P}];
T1=ArcTan[p[[1,3]]/p[[1,2]]];
U=p;
T=RotationMatrix[T1,{1,0,0}];
p=U.T;
T2=ArcTan[p[[1,2]]/p[[1,1]]];
U=p;
T=RotationMatrix[T2,{0,0,1}];
p=U.T;
T3=ArcTan[p[[3,3]]/p[[3,2]]];
U=p;
T=RotationMatrix[T3,{1,0,0}];
p=Chop[U.T];
nk=p;
nl=p;
nk[[1,3]]=rpo;
nl[[1,3]]=-rpi;
U=p;
U1=nk;
U2=nl;
T=RotationMatrix[-T3,{1,0,0}];
p=U.T;
nk=U1.T;
nl=U2.T;
U=p;
U1=nk;
U2=nl;
T=RotationMatrix[-T2,{0,0,1}];
p=U.T;
nk=U1.T;
nl=U2.T;
U=p;
U1=nk;
U2=nl;
T=RotationMatrix[-T1,{1,0,0}];
p=U.T;
nk=U1.T;
nl=U2.T;
Clear[v,v1,v2];
v  =Table[Join[p[[i]],{1}],{i,1,P}];
v1=Table[Join[nk[[i]],{1}],{i,1,P}];
v2=Table[Join[nl[[i]],{1}],{i,1,P}];
Q={{1,0,0,0},
{0,1,0,0},
{0,0,1,0},
{x2,y2,z2,1}};
p=v.Q;
nk=v1.Q;
nl=v2.Q;
p=Table[Take[p[[i]],3],{i,1,P}];
nk=Table[Take[nk[[i]],3],{i,1,P}];
nl=Table[Take[nl[[i]],3],{i,1,P}];
tpo[[k]]=nk;
tpu[[k]]=nl)];