Mocto:={{1,0,1,-1},{0,1,1,1},{1,1,1,0},{-1,1,0,1}};
s:=1/Sqrt[2];

P:={{-0.5,0.5,0.5,-0.5},{0.5,0.5,-0.5,-0.5},{0,s,0,s},{s,0,s,0}};
Pinv:=Inverse[P];

Projepar:=0.5*{{1,0,s,-s},{0,1,s,s},{s,s,1,0},{-s,s,0,1}};
Projeperp:=0.5*{{1,0,-s,s},{0,1,-s,-s},{-s,-s,1,0},{s,-s,0,1}};

ProjeparIso:=0.5*{{1,0,s/2,-s/2},{0,1,s/2,s/2},{s,s,1/2,0},{-s,s,0,1/2}};

ProjeperpIso:=0.5*{{1,0,-s/2,s/2},{0,1,-s/2,-s/2},{-s,-s,1/2,0},{s,-s,0,1/2}};

Rot:={{s,s},{-s,s}};

Prod[x_,y_]:=x[[1]]*y[[2]]-x[[2]]*y[[1]];

Bar[a_,b_,c_,x_]:={Prod[b-x,c-x]/Prod[b-a,c-a],Prod[c-x,a-x]/Prod[b-a,c-a],Prod[a-x,b-x]/Prod[b-a,c-a]};
EnvConv[a_,b_,c_,x_]:=Module[{bar=Bar[a,b,c,x]},bar[[1]]≥0 && bar[[2]]≥0 && bar[[3]]≥0];

ArHypCube:={{0,0,0,0},{1,0,0,0},{0,1,0,0},{0,0,1,0},{1,1,0,0},{1,0,1,0},{0,1,1,0},{1,1,1,0},{0,0,0,1},{1,0,0,1},{0,1,0,1},{0,0,1,1},{1,1,0,1},{1,0,1,1},{0,1,1,1},{1,1,1,1}}

ArHypCubeEps:={};

For[j=1,j<17,j++,AppendTo[ArHypCubeEps,ArHypCube[[j]]+{0.0001,0.0001,0.0001,0.0001}]];

Polyg:={};
PolygEps:={};

For[l=1,l<17,l++,AppendTo[PolygEps,{(Pinv.(ArHypCubeEps[[l]]))[[3]],(Pinv.(ArHypCubeEps[[l]]))[[4]]}]];

ListPlot[PointsExt,AspectRatio->Automatic]

ListPlot[PtsExtEps,AspectRatio->Automatic]

RotPolygEps

PtsExtEps:={{0.00007071067811865475`,0.7070774918646663`},{0.7071774918646663`,0.7070774918646663`},{1.2071774918646663`,0.20707749186466629`},{1.2071774918646663`,-0.5000292893218813`},{0.7071774918646663`,-1.0000292893218814`},{0.00007071067811865475`,-1.0000292893218814`},{-0.49992928932188135`,-,RotPolygEps}0.5000292893218813`},{-0.49992928932188135`,0.20707749186466629`}};

PointsExt:={{0.`,0.7071067811865476`},{0.7071067811865476`,0.7071067811865476`},{1.2071067811865475`,0.20710678118654757`},{1.2071067811865475`,-0.5`},{0.7071067811865476`,-1.`},{0.`,-1.`},{-0.5`,-0.5`},{-0.5`,0.20710678118654757`},{0.`,0.7071067811865476`}};

InPoly[{q1_,q2_,q3_,q4_}]:=Module[{t,q={(Pinv.{q1,q2,q3,q4})[[3]],(Pinv.{q1,q2,q3,q4})[[4]]}},t=EnvConv[{0,0},PointsExt[[1]],PointsExt[[2]],q]||EnvConv[{0,0},PointsExt[[2]],PointsExt[[3]],q]||EnvConv[{0,0},PointsExt[[3]],PointsExt[[4]],q]||EnvConv[{0,0},PointsExt[[4]],PointsExt[[5]],q]||EnvConv[{0,0},PointsExt[[5]],PointsExt[[6]],q]||EnvConv[{0,0},PointsExt[[6]],PointsExt[[7]],q]||EnvConv[{0,0},PointsExt[[7]],PointsExt[[8]],q];t];

InCarre1FEps[{q1_,q2_,q3_,q4_}]:=Module[{t,q={(Pinv.{q1,q2,q3,q4})[[3]],(Pinv.{q1,q2,q3,q4})[[4]]}},t=-1.0000292893218814`≤q[[2]]≤0.7070774918646663` && -0.49992928932188135`≤q[[1]]≤ 1.2071774918646663`;t];

InCarre2FEps[{q1_,q2_,q3_,q4_}]:=Module[{t,q=Rot.{(Pinv.{q1,q2,q3,q4})[[3]],(Pinv.{q1,q2,q3,q4})[[4]]}},t=-1.207177491864666`≤q[[2]]≤0.4999292893218814` && -0.7070774918646661`≤q[[1]]≤1.0000292893218814`;t];

InCarre1F[{q1_,q2_,q3_,q4_}]:=Module[{t,q={(Pinv.{q1,q2,q3,q4})[[3]],(Pinv.{q1,q2,q3,q4})[[4]]}},t=-1≤q[[2]]≤0.7071067811865476` && -0.5≤q[[1]]≤ 1.2071067811865475`;t];

InCarre2F[{q1_,q2_,q3_,q4_}]:=Module[{t,q=Rot.{(Pinv.{q1,q2,q3,q4})[[3]],(Pinv.{q1,q2,q3,q4})[[4]]}},t=-1.2071067811865475`≤q[[2]]≤0.5 && -0.7071067811865476`≤q[[1]]≤1.0;t];

InCarre1O[{q1_,q2_,q3_,q4_}]:=Module[{t,q={(Pinv.{q1,q2,q3,q4})[[3]],(Pinv.{q1,q2,q3,q4})[[4]]}},t=-1<q[[2]]<0.7071067811865476` && -0.5<q[[1]]<1.2071067811865475`;t];

InCarre2O[{q1_,q2_,q3_,q4_}]:=Module[{t,q=Rot.{(Pinv.{q1,q2,q3,q4})[[3]],(Pinv.{q1,q2,q3,q4})[[4]]}},t=-1.2071067811865475`<q[[2]]<0.5 && -0.7071067811865476`<q[[1]]<1.0;t];

InPoly2F[{q1_,q2_,q3_,q4_}]:=InCarre1F[{q1,q2,q3,q4}]&&InCarre2F[{q1,q2,q3,q4}];

InPoly2O[{q1_,q2_,q3_,q4_}]:=InCarre1O[{q1,q2,q3,q4}]&&InCarre2O[{q1,q2,q3,q4}];

InPolyEps[{q1_,q2_,q3_,q4_}]:=InCarre1FEps[{q1,q2,q3,q4}]&&InCarre2FEps[{q1,q2,q3,q4}];

PointsPerp[l_,m1_,m2_,m3_,m4_]:=Module[{ll=l},Do[If[InPoly[{q1,q2,q3,q4}],AppendTo[ll,{(Pinv.{q1,q2,q3,q4})[[3]],(Pinv.{q1,q2,q3,q4})[[4]]}]],{q1,0,m1},{q2,0,m2},{q3,0,m3},{q4,0,m4}];ll];

PointsPerp2F[l_,m1_,m2_,m3_,m4_]:=Module[{ll=l},Do[If[InPoly2F[{q1,q2,q3,q4}],AppendTo[ll,{(Pinv.{q1,q2,q3,q4})[[3]],(Pinv.{q1,q2,q3,q4})[[4]]}]],{q1,0,m1},{q2,0,m2},{q3,0,m3},{q4,0,m4}];ll];

PointsPerp2O[l_,m1_,m2_,m3_,m4_]:=Module[{ll=l},Do[If[InPoly2O[{q1,q2,q3,q4}],AppendTo[ll,{(Pinv.{q1,q2,q3,q4})[[3]],(Pinv.{q1,q2,q3,q4})[[4]]}]],{q1,0,m1},{q2,0,m2},{q3,0,m3},{q4,0,m4}];ll];

PointsPerpEps[l_,m1_,m2_,m3_,m4_]:=Module[{ll=l},Do[If[InPolyEps[{q1,q2,q3,q4}],AppendTo[ll,{(Pinv.{q1,q2,q3,q4})[[3]],(Pinv.{q1,q2,q3,q4})[[4]]}]],{q1,0,m1},{q2,0,m2},{q3,0,m3},{q4,0,m4}];ll];

ProjTout[l_,m1_,m2_,m3_,m4_]:=Module[{ll=l},Do[AppendTo[ll,{(Pinv.{q1,q2,q3,q4})[[3]],(Pinv.{q1,q2,q3,q4})[[4]]}],{q1,0,m1},{q2,0,m2},{q3,0,m3},{q4,0,m4}];ll];

GraphPlot[Table[PointsExt[[j]]->PointsExt[[j+1]],{j,1,7}]]

ListLinePlot[PointsExt,AspectRatio->Automatic]

ListPlot[{PointsExt,ProjTout[{},1,1,1,1]}]

Show[ListLinePlot[PointsExt],ListPlot[ProjTout[{},4,4,4,4]]]

Show[ListLinePlot[PointsExt],ListPlot[PointsPerp[{},4,4,4,4]]]

Show[ListLinePlot[PointsExt],ListPlot[PointsPerp2F[{},4,4,4,4]]]

Show[ListLinePlot[PointsExt],ListPlot[PointsPerp2O[{},4,4,4,4]]]

Show[ListLinePlot[PointsExt],ListPlot[PointsPerpEps[{},4,4,4,4]]]

PointsPar[l_,n1_,n2_,n3_,n4_,m1_,m2_,m3_,m4_]:=Module[{ll=l},Do[If[InPoly[{q1,q2,q3,q4}],AppendTo[ll,{(Pinv.{q1,q2,q3,q4})[[1]],(Pinv.{q1,q2,q3,q4})[[2]]}]],{q1,n1,m1},{q2,n2,m2},{q3,n3,m3},{q4,n4,m4}];ll];

PointsPar2F[l_,n1_,n2_,n3_,n4_,m1_,m2_,m3_,m4_]:=Module[{ll=l},Do[If[InPoly2F[{q1,q2,q3,q4}],AppendTo[ll,{(Pinv.{q1,q2,q3,q4})[[1]],(Pinv.{q1,q2,q3,q4})[[2]]}]],{q1,n1,m1},{q2,n2,m2},{q3,n3,m3},{q4,n4,m4}];ll];

PointsPar2O[l_,n1_,n2_,n3_,n4_,m1_,m2_,m3_,m4_]:=Module[{ll=l},Do[If[InPoly2O[{q1,q2,q3,q4}],AppendTo[ll,{(Pinv.{q1,q2,q3,q4})[[1]],(Pinv.{q1,q2,q3,q4})[[2]]}]],{q1,n1,m1},{q2,n2,m2},{q3,n3,m3},{q4,n4,m4}];ll];

AuxVois[l_,n1_,n2_,n3_,n4_,m1_,m2_,m3_,m4_]:=Module[{ll=l},Do[If[InPoly[{q1,q2,q3,q4}],AppendTo[ll,{q1,q2,q3,q4}]],{q1,n1,m1},{q2,n2,m2},{q3,n3,m3},{q4,n4,m4}];ll];

AuxVois2F[l_,n1_,n2_,n3_,n4_,m1_,m2_,m3_,m4_]:=Module[{ll=l},Do[If[InPoly2F[{q1,q2,q3,q4}],AppendTo[ll,{q1,q2,q3,q4}]],{q1,n1,m1},{q2,n2,m2},{q3,n3,m3},{q4,n4,m4}];ll];

AuxVois2O[l_,n1_,n2_,n3_,n4_,m1_,m2_,m3_,m4_]:=Module[{ll=l},Do[If[InPoly2O[{q1,q2,q3,q4}],AppendTo[ll,{q1,q2,q3,q4}]],{q1,n1,m1},{q2,n2,m2},{q3,n3,m3},{q4,n4,m4}];ll];

AuxVoisEps[l_,n1_,n2_,n3_,n4_,m1_,m2_,m3_,m4_]:=Module[{ll=l},Do[If[InPolyEps[{q1,q2,q3,q4}],AppendTo[ll,{q1,q2,q3,q4}]],{q1,n1,m1},{q2,n2,m2},{q3,n3,m3},{q4,n4,m4}];ll];

AuxVoisEpsRestreint[l_,n1_,n2_,n3_,n4_,m1_,m2_,m3_,m4_]:=Module[{ll=l},Do[If[InPolyEps[{q1,q2,q3,q4}&& Norm[{(Pinv.{q1,q2,q3,q4})[[1]],(Pinv.{q1,q2,q3,q4})[[2]]}]≤5],AppendTo[ll,{q1,q2,q3,q4}]],{q1,n1,m1},{q2,n2,m2},{q3,n3,m3},{q4,n4,m4}];ll];

AuxVoisEpsRestreint2[l_,n1_,n2_,n3_,n4_,m1_,m2_,m3_,m4_]:=Module[{ll=l},Do[If[InPolyEps[{q1,q2,q3,q4}&& Abs[(Pinv.{q1,q2,q3,q4})[[1]]]≤5&&Abs[(Pinv.{q1,q2,q3,q4})[[2]]]≤5],AppendTo[ll,{q1,q2,q3,q4}]],{q1,n1,m1},{q2,n2,m2},{q3,n3,m3},{q4,n4,m4}];ll];

Voisins[res_,l_]:=Module[{n=Length[l],d, r=res},Do[{d=Norm[l[[j]]-l[[jj]]];If[d==1 && j<jj,AppendTo[r,{{(Pinv.(l[[j]]))[[1]],(Pinv.(l[[j]]))[[2]]},{(Pinv.(l[[jj]]))[[1]],(Pinv.(l[[jj]]))[[2]]}}]]},{j,1,n}, {jj,1,n}];r];

VoisinsIso[res_,l_]:=Module[{n=Length[l],d, r=res},Do[{d=Norm[l[[j]]-l[[jj]]];If[d==1 && j<jj,AppendTo[r,{{(Pinv.(ProjeparIso.((l[[j]]))))[[1]],(Pinv.(ProjeparIso.(l[[j]])))[[2]]},{(Pinv.(ProjeparIso.((l[[jj]]))))[[1]],(Pinv.(ProjeparIso.((l[[jj]]))))[[2]]}}]]},{j,1,n}, {jj,1,n}];r];

vois:=AuxVois2O[{},-3,-3,-3,-3,4,4,4,4];

v2:=AuxVois2O[{},-1,-1,-1,-1,3,3,3,3];

v3:=AuxVois2F[{},-1,-1,-1,-1,3,3,3,3];

v4:=AuxVois2O[{},-2,-2,-2,-2,4,4,4,4];

v5:=AuxVois2O[{},-5,-5,-5,-5,10,10,10,10];

v6:=AuxVois2F[{},-5,-5,-5,-5,10,10,10,10];

v7:=AuxVois[{},-5,-5,-5,-5,10,10,10,10];

v8:=AuxVoisEps[{},-5,-5,-5,-5,10,10,10,10];

v9:=AuxVoisEpsRestreint[{},-5,-5,-5,-5,10,10,10,10];

v10:=AuxVoisEpsRestreint2[{},-5,-5,-5,-5,10,10,10,10];

v11:=AuxVoisEpsRestreint2[{},-1,-1,-1,-1,3,3,3,3];

l2:=Voisins[{},v2];

ListLinePlot[Voisins[{},v8],AspectRatio->Automatic]

ListLinePlot[Voisins[{},v9],AspectRatio->Automatic]

ListLinePlot[Voisins[{},v10],AspectRatio->Automatic]

ListLinePlot[VoisinsIso[{},v11],AspectRatio->Automatic]