This code includes algorithms for computing volumetric (octahedral and odeco) frame fields, described in detail in our paper:
Palmer, D., Bommes, D., & Solomon, J. (2020). Algebraic Representations for Volumetric Frame Fields. ACM Transactions on Graphics (TOG), 39(2), 1-17.
- Manopt 5.0
- Mosek 9.0 (C++ Fusion API)
- Intel TBB
- MatPlotLib Colormaps
- (Optional) Eigen 3
First, remember to build and install the Mosek Fusion API as described here.
The following commands will compile all MEX files and add the code to the MATLAB path.
cd src/batchop
mexbuild /path/to/tbb/include
cd ../sdp
mexbuild /path/to/tbb/include /path/to/mosek/9.0
cd ../../ext/ray
mexbuild /path/to/eigen3 /path/to/tbb/include
cd ../..
installThe main commands for computing fields are MBO, OctaManopt,
and OdecoManopt.
Some tetrahedral meshes in Medit format
are included in the meshes directory for convenience.
To load a mesh, use
mesh = ImportMesh('meshes/rockerarm_91k.mesh'); % Medit formatWe also support meshes in Tetgen format:
mesh = ImportMesh('path/to/file.node'); % Tetgen .node/.ele formatThe following commands compute octahedral and odeco fields by MBO with random initialization:
qOcta = MBO(mesh, OctaMBO, [], 1, 0);
qOdeco = MBO(mesh, OdecoMBO, [], 1, 0);For modified MBO as described in our paper, set the diffusion time multiplier and exponent as follows:
qOcta = MBO(mesh, OctaMBO, [], 50, 3);
qOdeco = MBO(mesh, OdecoMBO, [], 50, 3);The following lines compute octahedral and odeco fields by RTR with specified initial fields. Drop the second argument for random initialization.
qOcta = OctaManopt(mesh, qOcta);
qOdeco = OdecoManopt(mesh, qOdeco);We have also included an implementation of the method of Ray et al. [2016]
in the ext/ray directory. To use it, invoke
qRay = Ray(mesh);To visualize an octahedral or odeco field, use VisualizeResult, which
plots the integral curves and singular structure, e.g.,
VisualizeResult(mesh, qOdeco);PlotInterpolatedFrames plots field-oriented cubes at specified sample
points:
PlotInterpolatedFrames(q, mesh.tetra, samples)where samples is a
We have included scripts for generating (MATLAB versions of) figures that appear in
the paper in the figures/ directory.
-
EnergyTestcompares energy divergence behavior of octahedral and odeco fields, as in Figure 12 in the paper. -
PrismFiguresgenerates a figure similar to Figure 1 in the paper, showing scaling behavior of an odeco field. -
ConvergenceComparisonsgenerates figures like Figures 5 and 6 in the paper:ConvergenceComparisons('../meshes', 'path/to/output/');
-
GenerateComparisonsgenerates a table like that in our supplemental document:GenerateComparisons('../meshes', 'path/to/output/');
-
To verify the exactness of SDP projection into the octahedral and odeco varieties, respectively, execute
OctaExactnessTest(n); OdecoExactnessTest(n);
for a sufficiently large value of
n.