# Optimal Cone Singularity Examples

This archive contains examples from the paper

> [_Optimal Cone Singularities for Conformal Flattening_][1]  
> Yousuf Soliman, Dejan Slepčev, Keenan Crane  
> **ACM Transactions on Graphics (2018)**

In particular, it contains a collection of (i) surface meshes (each with a UV parameterization), and (ii) the cone singularities used to generate this parameterization.  The parameterization is mathematically guaranteed to have the lowest possible area distortion among all conformal parameterizations **with the same (or smaller) total cone angle**.  See the note below (and [the paper][2]) for further details.

## Description of data

Each example in the directory `data/` includes:

* a triangle mesh, in [Wavefront OBJ format][3]
* a list of cone singularities, as a plain-text file

The `v` lines of the OBJ files encode the 3D vertex positions of the original mesh, and the `vt` lines encode the UV coordinates obtained by conformally flattening this mesh with the given cone singularities.  These examples were generated using the [Boundary First Flattening (BFF)][4] algorithm, but any conformal flattening algorithm that handles cone singularities should yield similar results.

The cone singularity files have the format

```
index1 angle1
index2 angle2
...
```

where `index` is a 1-based integer that refers to a vertex in the OBJ file, and `angle` is the cone angle, equal to 2π minus the sum of angles around the vertex in the UV plane (or equivalently, the discrete Gaussian curvature of the target surface).

## Optimality of examples

These examples are "optimal" parameterizations in a very precise sense: they have the least possible area distortion among all possible conformal flattenings of the given surface _with the same (or smaller) total cone angle._  Asking for the minimum among **all** possible cone configurations, with no bound on total angle, is meaningless: one could just keep adding more and more cones, to make the distortion smaller and smaller.  For a triangle mesh, the extreme example is putting a cone at every single vertex, with the cone angle set to the vertex angle defect.  In this case, the area distortion will be exactly zero—but the mesh will have been chopped up into a tree-like structure, making the parameterization somewhat useless.

Area distortion is quantified as the L2 norm of the log conformal scale factor.  A simple way to approximate this quantity is to compute, for each triangle `ijk` in the mesh, the log scale factor

```
u_ijk := log( sqrt(B_ijk/A_ijk) )
```

where `A_ijk` is the area of the triangle in 3D, and `B_ijk` is the area of the triangle in the UV plane.  The L2 norm of these scale factors is then a sum over all triangles `ijk`:

```
Σ_ijk A_ijk u_ijk^2
```

(Note that this simple approximation is slightly different than the one used in the paper, where the `u` values automatically fall out of the optimization.)

---

_(contact: kmcrane@cs.cmu.edu)_

[1]: http://www.cs.cmu.edu/~kmcrane/Projects/OptimalCones/
[2]: https://dl.acm.org/citation.cfm?id=3201367
[3]: https://en.wikipedia.org/wiki/Wavefront_.obj_file
[4]: https://geometrycollective.github.io/boundary-first-flattening/