Lagrange
thicken_and_close_mesh.h
1/*
2 * Copyright 2021 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#ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS
15 #include <lagrange/legacy/thicken_and_close_mesh.h>
16#endif
17
18#include <lagrange/SurfaceMesh.h>
19
20#include <optional>
21#include <variant>
22
23namespace lagrange {
24
29{
33 std::variant<std::array<double, 3>, std::string_view> direction = "";
34
36 double offset_amount = 1.0;
37
44 std::optional<double> mirror_ratio;
45
47 size_t num_segments = 1;
48
50 std::vector<std::string> indexed_attributes;
51};
52
66template <typename Scalar, typename Index>
69 const ThickenAndCloseOptions& options = {});
70
71} // namespace lagrange
Main namespace for Lagrange.
Definition: AABBIGL.h:30
SurfaceMesh< Scalar, Index > thicken_and_close_mesh(SurfaceMesh< Scalar, Index > input_mesh, const ThickenAndCloseOptions &options={})
Thicken a mesh by offsetting it, and close the shape into a thick 3D solid.
Definition: thicken_and_close_mesh.cpp:270
Options for thicken_and_close_mesh.
Definition: thicken_and_close_mesh.h:29
std::variant< std::array< double, 3 >, std::string_view > direction
Offset direction.
Definition: thicken_and_close_mesh.h:33
size_t num_segments
Number of segments used to split edges joining a vertex and its offset.
Definition: thicken_and_close_mesh.h:47
double offset_amount
Offset amount along the specified direction.
Definition: thicken_and_close_mesh.h:36
std::optional< double > mirror_ratio
Optional mirroring applied to the offset vertices.
Definition: thicken_and_close_mesh.h:44
std::vector< std::string > indexed_attributes
List of indexed attributes to preserve (e.g. UVs). Values will be duplicated for offset vertices.
Definition: thicken_and_close_mesh.h:50