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/subdivision/api.h>
16
17#include <lagrange/SurfaceMesh.h>
18
19#include <optional>
20
22
25
30{
32 std::optional<AttributeId> normal_attr;
33
35 std::optional<AttributeId> vertex_sharpness_attr;
36
38 std::optional<AttributeId> edge_sharpness_attr;
39};
40
45{
50 std::string_view normal_attribute_name;
51
55 std::optional<double> feature_angle_threshold;
56};
57
82template <typename Scalar, typename Index>
83LA_SUBDIVISION_API SharpnessResults
85
87
88} // namespace lagrange::subdivision
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:73
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:28
Subdivision surfaces.
Definition compute_sharpness.h:21
Input options for the compute_sharpness function.
Definition compute_sharpness.h:45
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:50
std::optional< double > feature_angle_threshold
Feature angle threshold (in radians) to detect sharp edges when computing autosmooth normals.
Definition compute_sharpness.h:55
Attribute ids returned by the compute_sharpness function.
Definition compute_sharpness.h:30
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:38
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:35
std::optional< AttributeId > normal_attr
Attribute id of the indexed normal attribute used to compute sharpness information.
Definition compute_sharpness.h:32