Lagrange
Loading...
Searching...
No Matches
compute_sharpness.h
1/*
2 * Copyright 2026 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
13#pragma once
14
15#include <lagrange/SurfaceMesh.h>
16
17#include <optional>
18
20
23
28{
30 std::optional<AttributeId> normal_attr;
31
33 std::optional<AttributeId> vertex_sharpness_attr;
34
36 std::optional<AttributeId> edge_sharpness_attr;
37};
38
43{
48 std::string_view normal_attribute_name;
49
53 std::optional<double> feature_angle_threshold;
54};
55
80template <typename Scalar, typename Index>
83 const SharpnessOptions& options = {});
84
86
87} // namespace lagrange::subdivision
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:66
SharpnessResults compute_sharpness(SurfaceMesh< Scalar, Index > &mesh, const SharpnessOptions &options={})
Compute subdivision options to handle sharp edges and vertices based on existing mesh attributes.
Definition compute_sharpness.cpp:27
Subdivision surfaces.
Definition compute_sharpness.h:19
Input options for the compute_sharpness function.
Definition compute_sharpness.h:43
std::string_view normal_attribute_name
If provided, name of the normal attribute to use as indexed normals to define sharp edges.
Definition compute_sharpness.h:48
std::optional< double > feature_angle_threshold
Feature angle threshold (in radians) to detect sharp edges when computing autosmooth normals.
Definition compute_sharpness.h:53
Attribute ids returned by the compute_sharpness function.
Definition compute_sharpness.h:28
std::optional< AttributeId > edge_sharpness_attr
Attribute id to use for edge sharpness in the subdivide_mesh function (has float type).
Definition compute_sharpness.h:36
std::optional< AttributeId > vertex_sharpness_attr
Attribute id to use for vertex sharpness in the subdivide_mesh function (has float type).
Definition compute_sharpness.h:33
std::optional< AttributeId > normal_attr
Attribute id of the indexed normal attribute used to compute sharpness information.
Definition compute_sharpness.h:30