Lagrange
Loading...
Searching...
No Matches
repack_uv_charts.h
1/*
2 * Copyright 2025 Adobe. All rights reserved.
3 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License. You may obtain a copy
5 * of the License at http://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Unless required by applicable law or agreed to in writing, software distributed under
8 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9 * OF ANY KIND, either express or implied. See the License for the specific language
10 * governing permissions and limitations under the License.
11 */
12#pragma once
13
14#include <lagrange/SurfaceMesh.h>
15
16#include <string_view>
17
18namespace lagrange::packing {
19
24{
27 std::string_view uv_attribute_name = "";
28
31 std::string_view chart_attribute_name = "";
32
33#ifndef RECTANGLE_BIN_PACK_OSS
35 bool allow_rotation = true;
36#endif
37
39 bool normalize = true;
40
42 float margin = 1e-3f;
43};
44
51template <typename Scalar, typename Index>
52void repack_uv_charts(SurfaceMesh<Scalar, Index>& mesh, const RepackOptions& options = {});
53
54} // namespace lagrange::packing
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:66
RepackOptions allows one to customize packing options.
Definition repack_uv_charts.h:24
std::string_view chart_attribute_name
Name of the facet attribute that group facets into UV charts.
Definition repack_uv_charts.h:31
std::string_view uv_attribute_name
Name of the indexed attribute to use as UV coordinates.
Definition repack_uv_charts.h:27
bool allow_rotation
Whether to allow box to rotate by 90 degree when packing.
Definition repack_uv_charts.h:35
float margin
Minimum allowed distance between two boxes normalized within [0, 1] domain.
Definition repack_uv_charts.h:42
bool normalize
Should the output be normalized to fit into a unit box.
Definition repack_uv_charts.h:39