Open3D (C++ API)
0.16.0
|
Functions | |
void | ComputeUVAtlas (TriangleMesh &mesh, const size_t width, const size_t height, const float gutter, const float max_stretch, float *max_stretch_out, size_t *num_charts_out) |
void 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 , |
||
float * | max_stretch_out = nullptr , |
||
size_t * | num_charts_out = nullptr |
||
) |
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. |