We provide pseudo-C++ code to generate a non-orthogonal 2D crossfield from a sparse set of constraints based on the BendFields energy. While not directly compilable, this source code should form a good basis for reproducing our work. To use the code you need to provide sparse constraints on the crossfield.
We provide four main classes. The first two classes implement the data structures to store the crossfield and the transition functions. The class HarmonicCrossField initializes the crossfield (Section 6, NON-ORTHOGONAL 2D CROSS FIELDS - Greedy mixed-integer optimization). Its output crossfield is taken as input by the BendField class (Section 6, NON-ORTHOGONAL 2D CROSS FIELDS - Nonlinear optimization).
Our code is based on the following libraries:
We plan to release an extended version of our source code which will include the estimation of surface normals from the 2D crossfield (Section 5.3 of our paper). Please visit the webpage of the project for updates.