I need to visualize the points of a spherical mesh on a squared plane (this question is different than this one, I believe). For instance, let us first generate points pts
on a unit sphere. (Original question used a function from MathWorld to generate these points. The updated version has the more efficient way RandomPoint[Sphere[], num]
).
Then, let us use the points generated to create a mesh (Delaunay Mesh in this case):
num = 1000;(*Desired number of points*)
pts = RandomPoint[Sphere[], num];
Dmesh = DelaunayMesh[pts];
Show[Dmesh, Graphics3D[{Red, PointSize[0.01], Point[pts]}]]
Gives:
Is it possible to visualize a squared 'planar' version of the mesh while minimizing distortion? Any approximation will suffice since I perform computations on the sphere (the square is only useful for visualization).
I've tried creating a planar graph, but I realized that many meshes produced in this way are not planar. Then I tried making a graph with a SpringElectricalEmbedding
layout (and others), but I cannot force these layouts to be 'squares':
(*Get vertex neighbors from the mesh*)
neighbors = MeshCells[Dmesh, 1][[All, 1]];
neighbors =
Table[neighbors[[a]][[1]] <-> neighbors[[a]][[2]], {a, 1,
Length[neighbors]}];
(*Create a graph layout that minimizes 'energy'*)
Graph[neighbors, GraphLayout -> "SpringElectricalEmbedding"]
The ideal solution would be something like:
PlanarSphereMesh[Dmesh]
Any hints towards this goal will be appreciated. To be clear, I don't require a 'planar graph' to be created, that was only an idea I had at first. Any method of visualization would suffice, as long as it preserves the vertex connectivity. Even more, if the 'boundaries' of the plane representation requires it, we could remove the edges at the boundaries, and only visualize the connections for 'inner' vertexes.
RandomPoint[Sphere[],num]
. $\endgroup$