|
Open3D (C++ API)
0.19.0
|
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) |
| 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:
| mesh | Input and output mesh. |
| width | The target width of the texture. The uv coordinates will still be in the range [0..1] but parameters like gutter use pixels as units. |
| height | The target height of the texture. |
| gutter | This is the space around the uv islands in pixels. |
| max_stretch | The maximum amount of stretching allowed. The parameter range is [0..1] with 0 meaning no stretch allowed. |
| max_stretch_out | Output parameter returning the actual maximum amount of stretch. |
| num_charts_out | Output parameter with the number of charts created. |
| parallel_partitions | The 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. |
| nthreads | The number of threads used when parallel_partitions is > 1. Set to 0 for automatic number of thread detection. |