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/packing/api.h>
15
16#include <lagrange/SurfaceMesh.h>
17
18#include <string_view>
19
20namespace lagrange::packing {
21
26{
29 std::string_view uv_attribute_name = "";
30
33 std::string_view chart_attribute_name = "";
34
35#ifndef RECTANGLE_BIN_PACK_OSS
37 bool allow_rotation = true;
38#endif
39
43 bool normalize = true;
44
48 float margin = 1e-3f;
49};
50
57template <typename Scalar, typename Index>
58LA_PACKING_API void repack_uv_charts(
60 const RepackOptions& options = {});
61
62} // namespace lagrange::packing
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:73
RepackOptions allows one to customize packing options.
Definition repack_uv_charts.h:26
std::string_view chart_attribute_name
Name of the facet attribute that group facets into UV charts.
Definition repack_uv_charts.h:33
std::string_view uv_attribute_name
Name of the indexed attribute to use as UV coordinates.
Definition repack_uv_charts.h:29
bool allow_rotation
Whether to allow box to rotate by 90 degree when packing.
Definition repack_uv_charts.h:37
float margin
Minimum allowed distance between two boxes.
Definition repack_uv_charts.h:48
bool normalize
Whether the output should be normalized to fit into a unit box.
Definition repack_uv_charts.h:43