Here's an example of the process for a triangle embedded in 4D projected to 2D:
vv = {{0, 0, 2, 1}, {1, 3, 4, 1}, {0, -1, 2, 2}};
polyspan = Transpose[Transpose@Most[#] - Last[#] &@vv];
ns = NullSpace[polyspan];
proj = NullSpace[N@ns]
v2 = vv.Transpose@proj
(*
{{0.301572, 0.713143, 0.603143, 0.191571}, (* proj. matrix *)
{0.119657, -0.477775, 0.239314, 0.836745}}
{{1.39786, 1.31537}, {5.04515, 0.480333}, {0.876285, 2.62989}} (* proj. vertices *)
*)
Check angles:
VectorAngle @@@ Subsets[Subtract @@@ Subsets[N@v2, {2}], {2}]
(* {2.17359, 2.89059, 0.717003} *)
VectorAngle @@@ Subsets[Subtract @@@ Subsets[N@vv, {2}], {2}]
(* {2.17359, 2.89059, 0.717003} *)
Check distances:
EuclideanDistance @@@ Subsets[Subtract @@@ Subsets[N@v2, {2}], {2}]
(* {4.69042, 8.3666, 3.74166} *)
EuclideanDistance @@@ Subsets[Subtract @@@ Subsets[N@vv, {2}], {2}]
(* {4.69042, 8.3666, 3.74166} *)
MeshCellNormals
might help. $\endgroup$proj = NullSpace[N@listofnormals]
will give you the projection matrix. Note it's important that the input be (approximate)Real
numbers. If they're integers or other exact numeric quantities, then the rows ofproj
won't be orthonormal in general.. $\endgroup$