# How to measure how much an discrete geometric model deviates from a sphere

I have a set of vertices $V$ that resemble a sphere (acquired by 3d-scanning a sphere). Now I need a measure on how much its shape deviates from a sphere. The most simple measure I have is from fitting a sphere by the least-squares method and taking the differences between the fitted radius $r$ and the actual radii from the fitted center $c$.

But now I also want a measure on the more systematic kinds of error, such as stretching or skewing along axes and if there are bumps or dents in the surface.

I already considered the curvature for discrete geometry, but it is hard to tell which would be the ideal values, as there is no "perfect" discrete sphere (i. e. a sphere with $N$ evenly distributed points) I could compare it to. Also, according to Gauss-Bonnet, the total curvature would be the same for a sphere as for an egg.

What other options do I have to detect these kinds of deviations?

• You can use the 'Willmore energy': vrs.amsi.org.au/wp-content/uploads/sites/6/2014/09/… – Riccardo.Alestra Aug 29 '16 at 9:14
• Your question is no more about the deviation from a sphere, but the deviation from ???. I think that you should fill these questions marks in the first place. – Yves Daoust Aug 29 '16 at 9:42
• You are right, sorry. I removed that part again, as I'm primarily interested in measures for closed (deformed) spheres first. I can think about incomplete objects with holes later, as they are an exception. – Fabian Fritz Aug 29 '16 at 9:47
• You could use a least squares fitting to an ellipsoid, to find out if the three axes are equal or not. Another option is to calculate the signed difference to a sphere at each measured point, and create a map (meaning, similar to a geographic map, using e.g. colors) to view any systematic errors, as regions of similar errors. If there are sufficient number of samples, you can do low-pass filtering (spatially in 3D) to try to remove any measurement (or quantization etc.) noise, too. – Nominal Animal Aug 29 '16 at 12:13

I am not sure whether you are taking the convex hull of your points or you are following a specific combinatorial triangulation of your polyhedral surface, comping from a triangulation. I am going to assume that you have a polyhedral surface with the topology of the sphere with vertices the sample points $V$ you have calculated (if you don't, maybe just take the convex hull of $V$ and remove all points from $V$ which are not on the boundary of the convex hull, i.e. the ones that end up in the interior). Let us assume it is fully triangulated, i.e. each face is a triangle (otherwise you can subtriangulate each non-triangular face by adding a set of diagonals of that face with non-intersecting interior segments). Thus you get a geometric triangulation $(V,E,F)$ where $V$ vertices, $E$ is the set of edges and $F$ is the set of triangular faces. In addition to that, each triangle is oriented so that the counter clockwise direction on each triangle is positive when looked at from outside of the polyhedron.

There are various measures you can use to measure the deviation of the polyhedron from a polyhedron inscribed in a sphere. For instance you can use the discrete conformal (discrete Wilmore) energy. Let $e \, \in\, E \,$ be an edge of the polyhedron and let $\Delta_1$ and $\Delta_2 \, \in \, F$ be the two triangular faces that share $e$ as a common edge. Take the circle $c_1$ circumscribed around triangle $\Delta_1$ and $c_2$ circumscribed around $\Delta_2$. Both $c_1$ and $c_2$ are two geometric round circles in the three dimensional space. They are oriented positively, according to the orientation of the triangles. Then let $\beta(e)$ be the external intersection angle between the circumcircles $c_1$ and $c_2$ (this is the angle between the tangent vectors to the circumcircles $c_1$ and $c_2$ at anyone of the two intersection points of $c_1 \cap c_2$). For each vertex $v \in V$ let $E(v)$ be the set of all edges of the polyhedron that share $v$ as a common vertex (kind of like the ribs of an umbrella). Then define the local discrete conformal (discrete Willmore) energy $W(v)$ at $v$ as $$W(v) = \sum_{e \in E(v)} \, \beta(e) - 2\pi.$$
After that, define the discrete conformal (discrete Willmore) energy of the polyhedron as $$W = - \pi |V| + \sum_{v \in V}\, W(v) .$$ $|V|$ is the number of vertices of $V$.

Theorem. For each vertex $v$ of the polyhedron the local discrete conformal energy $W(v)$ is non-negative, i.e.
$$W(v) \geq 0$$ and $W(v) = 0$ if and only if the vertices of all faces of the polyhedron that share $v$ as a common vertex lie on the surface of a common sphere and form a convex umbrella-like configuration.
Theorem. The total discrete conformal energy $W$ is non-negative $$W \geq 0$$ and $W = 0$ if end only if the polyhedron is convex and all of its vertices lie on the surface of a common sphere.
You can also combine the discrete Conformal energy (local and global) with a discrete version of the mean curvature of each edge. For $e \in E$ let $l(e)$ be the length of the edge $e$ and let $\theta(e)$ be the dihedral angle between the adjacent triangles $\Delta_1$ and $\Delta_2$, measured inside the polyhedron. This is basically the angle between two unit vectors, pointing outwards, each orthogonal to one of the face $\Delta_1$ and $\Delta_2$ respectively. Then the local discrete mean curvature at $e$ is $$H(e) = l(e)\theta(e).$$ You can have a discrete mean curvature at $v$ $$M(v) = \sum_{e \in E(v)} \, M(e)$$ as well as the total mean curvature $$M=\sum_{e \in E} \, M(e).$$