Skip to content

Commit 2db9fd6

Browse files
committed
Refactored pipeline
1 parent 78c8905 commit 2db9fd6

File tree

113 files changed

+3659
-304075
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+3659
-304075
lines changed

.DS_Store

0 Bytes
Binary file not shown.

CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ if (PROJECT_IS_TOP_LEVEL)
1414
option(ENABLE_VISUALIZATION "Generate viewers for visualization" ON)
1515
option(CHECK_VALIDITY "Check validity pre and post conditions" ON)
1616
option(BUILD_CURVATURE_METRIC_TESTS "Build tests" ON)
17-
option(USE_SUITESPARSE "Use suite sparse methods for matrix inversion" OFF)
17+
option(USE_SUITESPARSE "Use suite sparse methods for matrix inversion" ON)
18+
option(RENDER_TEXTURE "Render results" ON)
1819

1920
# Set libigl options
2021
option(LIBIGL_PREDICATES "Use Predicates" ON)
21-
option(RENDER_TEXTURE "Render results" OFF)
2222
set ( SUITESPARSE_ENABLE_PROJECTS "suitesparse_config;cholmod;spqr" )
2323
endif()
2424

@@ -109,11 +109,11 @@ add_subdirectory(src)
109109

110110

111111
if(USE_SUITESPARSE)
112-
include(suitesparse)
113-
target_link_libraries(PennerOptimizationLib PRIVATE
114-
SuiteSparse::SuiteSparseConfig
115-
SuiteSparse::CHOLMOD
116-
)
112+
# include(suitesparse)
113+
# target_link_libraries(PennerOptimizationLib PRIVATE
114+
# SuiteSparse::SuiteSparseConfig
115+
# SuiteSparse::CHOLMOD
116+
# )
117117
endif()
118118

119119
# Build pybind optimization functions

README

Lines changed: 0 additions & 49 deletions
This file was deleted.

README.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
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+
![Contour pipeline](media/teaser.jpg)
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+
![Some example figures](media/examples.jpg)
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+
```

TODO

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)