Detecting topology in 3d space for polygons

223 Views Asked by At

Icosahedral symmetry of points on surface of sphere FinalResult VoronoiPoints

I have some points lying on the surface of a sphere with icosahedral symmetry. I have triangulated the surface of the sphere with hexagons and pentagons as shown in the first figure. As an example, please focus on the pentagon around point C. The centroids of the 5 triangles surrounding the point C have been calculated and have been labeled as 0, 1, 2, 3 and 4. Please note that I chose these labels for convenience sake based on visual information. In the code, this convenient sequence is not available and I cannot simply connect the points in this order and hope to get a pentagon as shown in Figure 3. Using the co-ordinates of points C, 0, 1, 2, 3 and 4, I need to find-out the sequence in which these points should be connected so that they form edges of a pentagon as shown in Figure 3.

I thought of following algorithm:

  1. Create a vector for each of points 0, 1, 2, 3 and 4 by connecting them with point C respectively.
  2. Let vector C0 be the reference. For all other vectors calculate angles $\theta_1$, $\theta_2$ etc. using dot and cross-products.
  3. Sort the points as per the angles and thus connect points starting from 0 to next higher $\theta$ value.

Question: Is there any better algorithm to get the edges of a polygon if I know the number and position of its points and the center?

The final result looks like shown in Figure 2.

Update: The points of the polygon do not necessarily lie in the same plane. So they have topology of a polygon but are distorted.