Lagrange
Loading...
Searching...
No Matches
generate_swept_surface.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/primitive/legacy/generate_swept_surface.h>
16#endif
17
18#include <lagrange/SurfaceMesh.h>
19#include <lagrange/primitive/PrimitiveOptions.h>
20#include <lagrange/primitive/SweepOptions.h>
21#include <lagrange/utils/span.h>
22
23#include <array>
24#include <string_view>
25
26namespace lagrange::primitive {
27
30
32{
35 std::string_view latitude_attribute_name = "@latitude";
36
39 std::string_view longitude_attribute_name = "@longitude";
40
44
47 float profile_angle_threshold = static_cast<float>(lagrange::internal::pi / 4);
48
51 float max_profile_length = 0.0f;
52};
53
64template <typename Scalar, typename Index>
66 span<const Scalar> profile,
67 const SweepOptions<Scalar>& sweep_setting,
68 const SweptSurfaceOptions& options = {});
69
71
72} // namespace lagrange::primitive
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:66
Configuration class for sweep operations on 3D geometry.
Definition SweepOptions.h:40
::nonstd::span< T, Extent > span
A bounds-safe view for sequences of objects.
Definition span.h:27
SurfaceMesh< Scalar, Index > generate_swept_surface(span< const Scalar > profile, const SweepOptions< Scalar > &sweep_setting, const SweptSurfaceOptions &options={})
Generate a swept surface from a profile curve and a sequence of transforms.
Definition generate_swept_surface.cpp:544
Common settings shared by all primitives.
Definition PrimitiveOptions.h:28
Definition generate_swept_surface.h:32
std::string_view longitude_attribute_name
The name of the output vertex attribute storing the longitude values.
Definition generate_swept_surface.h:39
bool use_u_as_profile_length
Whether to parameterize the profile length as the U coordinate in the UV mapping.
Definition generate_swept_surface.h:43
float max_profile_length
Split the profile curve into shorter segments for UV generation such that no segment exceeds this len...
Definition generate_swept_surface.h:51
std::string_view latitude_attribute_name
The name of the output vertex attribute storing the latitude values.
Definition generate_swept_surface.h:35
float profile_angle_threshold
The maximum allowed angle (in radians) between consecutive profile segments for it to be considered a...
Definition generate_swept_surface.h:47