|
| 1 | +# Metric Optimization in Penner Coordinates |
| 2 | + |
| 3 | +<strong>Ryan Capouellez<sup>1</sup>, Denis Zorin<sup>1</sup></strong> |
| 4 | + |
| 5 | +<small><sup>1</sup>New York University</small> |
| 6 | + |
| 7 | +An implementation of [Metric Optimization in Penner Coordinates](https://dl.acm.org/doi/10.1145/3618394). |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +### Overview |
| 12 | + |
| 13 | +This method generates an approximately isometric parameterization of an input `obj` mesh with parametric cone angle constraints. Retriangulation is often necessary to satisfy these constraints, so the initial mesh is intrinsically refined to produce an output mesh with a compatible parameterization. |
| 14 | + |
| 15 | +## Installation |
| 16 | + |
| 17 | +To install this project on a Unix-based system, use the following standard CMake build procedure: |
| 18 | + |
| 19 | +```bash |
| 20 | +git clone https://github.com/rjc8237/penner-optimization.git |
| 21 | +cd penner-optimization |
| 22 | +mkdir build |
| 23 | +cd build |
| 24 | +cmake -DCMAKE_BUILD_TYPE=Release .. |
| 25 | +make -j 4 |
| 26 | +``` |
| 27 | + |
| 28 | +## Usage |
| 29 | + |
| 30 | +TODO Make binary folder |
| 31 | +The core parameterization method is `bin/optimize_metric`. This executable takes the following arguments: |
| 32 | + |
| 33 | +|flag | description| |
| 34 | +| --- | --- | |
| 35 | +|`mesh` | Mesh filepath| |
| 36 | +|`cones` | Target cone filepath| |
| 37 | +|`energy` | Energy to optimize| |
| 38 | +|`direction` | Direction to use for descent| |
| 39 | +|`--num_iter` | Maximum number of iterations| |
| 40 | +|`--output` | Output directory| |
| 41 | + |
| 42 | +Supported parameter values for `energy` and `direction` are listed by `bin/optimize_metric --help`. |
| 43 | + |
| 44 | +The input mesh must be a manifold surface with a single connected component. The cone file must be a list of newline separated target vertex cone angles satisfying the discrete Gauss-Bonnet condition. Such a cone prescription can be generated by TODO. The output is a refined mesh with a parameterization and a file of metric coordinate values. |
| 45 | + |
| 46 | +We also provide the executable `bin/optimize_shear` for generating parameterizations using explicit shear coordinate optimization (see paper for details). The executable arguments and output are the same, but the allowed directions are different. |
| 47 | + |
| 48 | +## Figure Reproduction |
| 49 | + |
| 50 | +Scripts to generate the figures of "Metric Optimization in Penner Coordinates" are included in `figures`. |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | +TODO |
| 55 | +The models (with parameterizations) and cameras used in [Algebraic Smooth Occluding Contours](http://ryanjcapouellez.com/papers/algebraic_smooth_occluding_contours.html) necessary for these scripts can be downloaded [here](http://ryanjcapouellez.com/papers/algebraic-contours-data.zip); they must be copied to `data/meshes` and `data/cameras` respectively. |
| 56 | + |
| 57 | +The figure bash scripts can be run independently or in batch with the command |
| 58 | +``` |
| 59 | +bash fig-all.sh |
| 60 | +``` |
| 61 | + |
| 62 | +Note that most bash scripts generate an output directory with a JSON file specifying parameters for the parameterization and rendering pipeline python script `scripts/pipeline.py`. Such JSON files can also be used for general batch parameterization and analysis. |
| 63 | + |
| 64 | +### Library |
| 65 | + |
| 66 | +Many parametrization and mapping-related problems in geometry processing can be viewed as metric optimization problems, i.e., computing a metric minimizing a functional and satisfying a set of constraints, such as flatness. |
| 67 | + |
| 68 | +Penner coordinates are global coordinates on the space of metrics on meshes with a fixed vertex set and topology, but varying connectivity, making it homeomorphic to the Euclidean space of dimension equal to the number of edges in the mesh, without any additional constraints imposed. |
| 69 | + |
| 70 | +Crucially for practical applications, a new mesh with standard Euclidean edge lengths corresponding to a metric determined by arbitrary Penner coordinates can be computed by an efficient algorithm. Moreover, the new mesh only differs from the original by a finite sequence of edge flips. Since the resulting edge lengths are analytic functions of the Penner coordinates, standard first-order optimization methods can be applied. |
| 71 | + |
| 72 | +To engender future work in this exciting direction, we provide a library `PennerOptimizationLib` containing: |
| 73 | + |
| 74 | +1. A representation of a mesh with Penner coordinates and cone angle constraints that supports: |
| 75 | + 1. the computation of the corresponding mesh with Euclidean log edge lengths and the Jacobian of the log edge lengths with respect to Penner coordinates |
| 76 | + 2. conformal projection to the cone angle constraints |
| 77 | +2. Various energy functionals and constrained optimization methods for meshes with Penner coordinates |
| 78 | +3. Layout and refinement methods to generate a parameterization for a mesh with arbitrary Penner coordinates such that the parameterization has the intrinsic metric prescribed by the coordinates. |
| 79 | + |
| 80 | +## Citation |
| 81 | + |
| 82 | +``` |
| 83 | +@article{capouellez:2023:penner, |
| 84 | +author = {Capouellez, Ryan and Zorin, Denis}, |
| 85 | +title = {Metric Optimization in Penner Coordinates}, |
| 86 | +year = {2023}, |
| 87 | +issue_date = {December 2023}, |
| 88 | +publisher = {Association for Computing Machinery}, |
| 89 | +address = {New York, NY, USA}, |
| 90 | +volume = {42}, |
| 91 | +number = {6}, |
| 92 | +issn = {0730-0301}, |
| 93 | +url = {https://doi.org/10.1145/3618394}, |
| 94 | +doi = {10.1145/3618394}, |
| 95 | +journal = {ACM Trans. Graph.}, |
| 96 | +month = {dec}, |
| 97 | +articleno = {234}, |
| 98 | +numpages = {19}, |
| 99 | +keywords = {cone metrics, conformal mapping, discrete metrics, intrinsic triangulation, parametrization, penner coordinates} |
| 100 | +} |
| 101 | +``` |
0 commit comments