This distribution contains code for constructing and registering conformal spherical parametrizations of water-tight, genus-zero surfaces. Specifically, it provides implementations for:

- Computing a conformal parametrization over the sphere
- Centering the parametrization with respect to Möbius inversions
- Tessellating the conformal parametrization to a regular equirectangular grid
- Performing fast spherical correlation to find the rotation/reflections that best aligning two centered parametrizations
- Using the registered parametrizations to compute dense correspondences from a source mesh to a target

**--in**<*input mesh*>- This string is the name of the file from which the mesh will be read.

The file is assumed to be in the PLY format.

- [
**--out**<*output triangle mesh*>] - This string is the name of the file to which the spherically parametrized mesh will be written.

The file is written in PLY format and will contain vertices with fields "x", "y", "z" (for the original vertex positions), "px", "py", "pz" (for the associated positions on the unit sphere), and "red", "green", "blue" (for the per-vertex colors). If the input contains colors, they will be copied to the output. Otherwise, colors are assigned using the surface normals. - [
**--outT**<*output tessellated triangle mesh*>] - This string is the name of the file to which the mesh obtained by tessellating against a regular equirectangular grid will be written.

The file is written in PLY format and will contain vertices with fields "x", "y", "z" (for the original vertex positions), "px", "py", "pz" (for the associated positions on the unit sphere), and "red", "green", "blue" (for the per-vertex colors). If the input contains colors, they will be copied to the output. Otherwise, colors are assigned using the surface normals. - [
**--outG**<*output spherical grid*>] - This string is the name of the file to which the spherical grid of conformal factors will be written.

If the file extension is ".sgrid", the grid will be written as a 2D array of values (in binary). If the file extension is ".ply", the grid will be visualized as a triangle mesh obtained by scaling points on the unit sphere in proportion to their value. - [
**--mesh**<*mesh type*>] - This integer values specifies the type of mesh used (and how the associated mass and stiffness matrices are defined).

A value of "1" indicates a triangle mesh with the standard cotangent Laplacian.

A value of "2" indicates a polygon mesh using the Discrete Laplacians on General Polygonal Meshes is used.

A value of "3" indicates that a polygon mesh is used, but the mass and stiffness matrices are defined over non-triangle polygons by adding the center, triangulating by connecting the edges of the polygon to the center, using the standard cotan. Laplacian, but adding the constraint that the value at the center has to be the average of the values at the polygon corners.

The default value for this parameter is 1. - [
**--fill**<*hole fill type*>] - This integer values specifies how holes should be handled.

A value of "0" indicates that holes should be left as is.

A value of "1" indicates that each hole should be filled by adding the center of the hole to the list of mesh vertices and adding the triangles defined by connecting the hole edges to the center vertex to the list of polygons.

A value of "2" indicates that each hole should be filled by using the minimal area triangulation of the hole boundary.

A value of "3" indicates that each hole should be filled by adding the polygon whose edges are made up of the hole boundary. (This is not supported when the**--mesh**type is set to 1.) The default value for this parameter is 0. - [
**--iters**<*number of CMCF iterations*>] - This integer values specifies the number of Conformalized Mean Curvature Flow iterations to be used to obtain the conformal spherical parametrization.

The default value for this parameter is 100. - [
**--stepSize**<*the temporal size of each CMCF step*>] - This floating point values specifies the units for the temporal discretization of the Conformalized Mean Curvature Flow.

The default value for this parameter is 0.1. - [
**--cutOff**<*Möbius centering cut-off*>] - This floating point value specifies the threshold for terminating the Möbius centering iterations.

The default value for this parameter is 10^(-10). - [
**--degree**<*spherical harmonics degree*>] - This integer value specifies the degrees of the spherical harmonics that should be centered out using explicit advection.

If this parameter is not specified, the code reverts to centering with respect to Möbius inversions.

Only degrees 1, 2, 3, and 4 are supported at this point. - [
**--aSteps**<*advection steps*>] - If a spherical harmonic degree is specified, this integer value specifies the number of advection steps to be performed within each centering step.

The default value for this parameter is 4. - [
**--aStepSize**<*advection step size*>] - If a spherical harmonic degree is specified, this floating point value specifies the size of each advection step.

The default value for this parameter is 0.25.

*If the resulting spherical parameterization exhibits triangle flips, it is likely that the advection step size should be reduced.* - [
**--res**<*equirectangular grid resolution*>] - This integer value specifies the resolution of the equirectangular grid used to tessellate the spherical parametrization.

The default value for this parameter is 256. - [
**--smooth**<*spherical diffusion time*>] - This floating point value specifies the temporal duration for the heat diffusion used to antialias the sampled spherical function.

The default value for this parameter is 0.0005. - [
**--c2i**<*center to inversion type*>] - This integer value specifies how the gradient descent value is to be interpreted as a center of inversion. A value of
**0**indicates that a trivial interpretation is to be used. A value of**1**indicates that a golden section search should be performed along the descent direction. A value of**2**indicates that the length of centering transformation should be rescaled using the metric for the Poincaré disk model.

The default value for this parameter is 2. - [
**--gssTolerance**<*golden section search tolerance*>] - This floating point value specifies the tolerance for the golden section search.

The default value for this parameter is 0.000001. - [
**--random**] - If enabled, this flag specifies that the vertices of the input mesh should be assigned random positions within the unit ball before performing the Conformalized Mean Curvature Flow. (But after extracting the stiffness matrix.)
- [
**--noCenter**] - If enabled, no Möbius centering is performed after computing the conformal spherical parametrization.
- [
**--collapse**] - If enabled, the triangles falling into a single equirectangular cell are collapsed into a single quad before extracting the spherical tessellation.
- [
**--ascii**] - If enabled, all PLY files are output in ASCII mode.
- [
**--verbose**] - If enabled, details regarding the running times of the different stages of processing are output.
- [
**--fullVerbose**] - If enabled, even more details regarding the running times of the different stages of processing are output.

**--in**<*input mesh*>- This string is the name of the file from which the parametrized triangle mesh will be read.

The file is assumed to be in the PLY format and should contain fields "x", "y", "z" (for the original vertex positions), and "px", "py", "pz" (for the associated positions on the unit sphere). - [
**--out**<*output triangle mesh*>] - This string is the name of the file to which the triangle mesh will be written.

The file is written in PLY format and will contain vertices with fields "x", "y", "z" (for the positions of the parameterization on the unit sphere). If the input mesh contains per-vertex colors, these will be preserved in the output.

**--in**<*input source/target*>- These pair of strings are the names of the source and target file from which the spherical parameterizations will be read.

The files are either both in the PLY format and should contain fields "x", "y", "z" (for the original vertex positions), and "px", "py", "pz" (for the associated positions on the unit sphere), or they should be the ".sgrid" files output by**SphereMap**. - [
**--out**<*output triangle mesh*>] - This string is the name of the file containing the source mesh with vertex positions on the target.

The file is written in PLY format.

[This output is only supported in the case that the input is in PLY format.] - [
**--res**<*equirectangular grid resolution*>] - This integer value specifies the resolution of the equirectangular grid used to tessellate the spherical parametrization.

The default value for this parameter is 256.

[This is only used in the case that the intput is in PLY format.] - [
**--smooth**<*spherical diffusion time*>] - This floating point value specifies the temporal duration for the heat diffusion used to antialias the sampled spherical function.

The default value for this parameter is 0.0005.

[This is only used in the case that the input is in PLY format.] - [
**--cType**<*correlation type*>] - This integer value specifies how to perform correlation. A value of
**1**indicates that correlation should only be performed over the orthogonal transformations with determinant 1. A value of**2**indicates that the correlation should only be performed over the orthogonal transformations with determinant -1. A value of**3**indicates that the correlation should be performed over all orthogonal transformations.

The default value for this parameter is 1. - [
**--correspondence**] - If enabled, the output mesh is defined by using the triangulation of the source and setting the vertex positions to the corresponding positions on the target. Otherwise, the parameteric coordinates of the source are rotated.

[This is only used in the case that the input is in PLY format.] - [
**--verbose**] - If enabled, details regarding the running times of the different stages of processing are output.

- The implementation of this code relies on the Eigen, SOFT, and FFTW libraries. The source for Eigen and SOFT are included and should compile under both Windows and Linux. For the FFTW, Windows .lib and .dll files can be found here.

- Added support for general polygonal meshes using Discrete Laplacians on General Polygonal Meshes via the
**--poly**flag. - Added support for genus-zero surfaces with boundaries by filling in the holes, via the
**--fill**flag. - Expanded support for polygon mesh types with mass/stiffness matrices obtained by adding the center, triangulating to the center, and constraining the system so that the value at the center is the average value at the polygon vertices.
- Added support for filling holes by adding the minimal area triangulation and add the polygonal hole to the polygon mesh.
- Minor changes to support compilation under GCC.

This work genersouly supported by NSF grant #1422325.

HOME