Open3D (C++ API)  0.18.0
Functions
open3d::t::geometry::kernel::uvunwrapping Namespace Reference

Functions

std::tuple< float, int, int > ComputeUVAtlas (TriangleMesh &mesh, const size_t width, const size_t height, const float gutter, const float max_stretch, int parallel_partitions, int nthreads)
 

Function Documentation

◆ ComputeUVAtlas()

std::tuple< float, int, int > open3d::t::geometry::kernel::uvunwrapping::ComputeUVAtlas ( TriangleMesh mesh,
const size_t  width = 512,
const size_t  height = 512,
const float  gutter = 1.0f,
const float  max_stretch = 1.f/6,
int  parallel_partitions = 1,
int  nthreads = 0 
)

Creates an UV atlas and adds it as triangle attr 'texture_uvs' to the mesh.

Input meshes must be manifold for this method to work.

The algorithm is based on:

  • Zhou et al, "Iso-charts: Stretch-driven Mesh Parameterization using Spectral Analysis", Eurographics Symposium on Geometry Processing (2004)
  • Sander et al. "Signal-Specialized Parametrization" Europgraphics 2002
Parameters
meshInput and output mesh.
widthThe target width of the texture. The uv coordinates will still be in the range [0..1] but parameters like gutter use pixels as units.
heightThe target height of the texture.
gutterThis is the space around the uv islands in pixels.
max_stretchThe maximum amount of stretching allowed. The parameter range is [0..1] with 0 meaning no stretch allowed.
max_stretch_outOutput parameter returning the actual maximum amount of stretch.
num_charts_outOutput parameter with the number of charts created.
parallel_partitionsThe approximate number of partitions created before computing the UV atlas for parallelizing the computation. Parallelization can be enabled with values > 1. Note that parallelization increases the number of UV islands and can lead to results with lower quality.
nthreadsThe number of threads used when parallel_partitions is > 1. Set to 0 for automatic number of thread detection.
Returns
Tuple with (max stretch, num_charts, num_partitions) storing the actual amount of stretch, the number of created charts, and the number of parallel partitions created.