In this section we give a solution to the problem of generationg an object in BRep which approximates an sphere.
A first approximation could consist of a subdivision of the sphere in meridians and parallels, similarly to the Earth's globe, but a problem arises: too much edges converge at the poles, and it is in general a bad representation for existing modeling algorithms.
This makes us choose a 20 regular, triangle face icosahedron that we will refine iteratively. The algorithm goes as follows:
Icosahedron
Icosahedron is obtained generating, in first place, the vertices shown in the figure:
Vertex coordinates are obtained using the following formulae:
where 63.43 is the angle between meridian where we put the vertices
and the y axis (it can be proven that resulting triangles are equilateral) and 72 is the turn in respect to y axis in order to generate pentagon points (360 / 5 = 72). The are the vertices of upper pentagon and the
lower vertices. The final result is:
20 faces are generated with the following index combinations:
(1,2,3) (2,10,3) (10,11,3) (11,10,12)
(1,3,4) (3,11,4) (11,7,4) (7,11,12)
(1,4,5) (4,7,5) (7,8,5) (8,7,12)
(1,5,6) (5,8,6) (8,9,6) (9,8,12)
(1,6,2) (6,9,2) (9,10,2) (10,9,12)
Refinement
The algorithm consists of a subdivision of each triangular face in four faces as shown in the figure. Further iterations of this algorithm will approximate the sphere better.
Essentially, the middle point of each edge is calculated and "sub-faces" are generated. One should keep in mind that this is a sphere approximation, so this middle point must be "uppered" in order to be tangent to the approximated sphere. This can be achieved moving this middle point in a perpendicular direction in respect to the edge, and from the center of the sphere to this middle point.
Refinement algorithm goes as follows:
The picture behind shows the dome of the Dalí Museum, Figueres. In the picture one can appreciate black points, which indicate the starting points of the polyhedron: those shared by 5 faces (the rest are shared by 6 faces).