Lagrange
select_facets_by_normal_similarity.h
1/*
2 * Copyright 2019 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/select_facets_by_normal_similarity.h>
16#endif
17#include <limits> // needed in options
18#include <optional> // needed in options
19
20namespace lagrange {
21
22
30
35{
37 double flood_error_limit = std::numeric_limits<double>::max();
38
49
51 std::string_view facet_normal_attribute_name = "@facet_normal";
52
55 std::optional<std::string_view> is_facet_selectable_attribute_name;
56
58 std::string_view output_attribute_name = "@is_selected";
59
61 enum class SearchType {
62 BFS = 0,
63 DFS = 1
64 };
65
68
71
72
73}; // SelectFaceByNormalSimilarityOptions
74
97template <typename Scalar, typename Index>
100 const Index seed_facet_id,
101 const SelectFacetsByNormalSimilarityOptions& options = {});
102
104
105} // namespace lagrange
uint32_t AttributeId
Identified to be used to access an attribute.
Definition: AttributeFwd.h:73
AttributeId select_facets_by_normal_similarity(SurfaceMesh< Scalar, Index > &mesh, const Index seed_facet_id, const SelectFacetsByNormalSimilarityOptions &options={})
Given a seed facet, selects facets around it based on the change in triangle normals.
Definition: select_facets_by_normal_similarity.cpp:27
Main namespace for Lagrange.
Definition: AABBIGL.h:30
Option struct for selecting facets based on normal similarity.
Definition: select_facets_by_normal_similarity.h:35
SearchType
select_facets_by_normal_similarity uses either BFS or DFS in its flooding search
Definition: select_facets_by_normal_similarity.h:61
std::string_view facet_normal_attribute_name
The attribute name for the facet normal.
Definition: select_facets_by_normal_similarity.h:51
SearchType search_type
The search type (BFS or DFS)
Definition: select_facets_by_normal_similarity.h:67
double flood_second_to_first_order_limit_ratio
There are two types of error limits when flood-search goes from one facet to its neighboring facet:
Definition: select_facets_by_normal_similarity.h:48
double flood_error_limit
Increasing this would select a larger region.
Definition: select_facets_by_normal_similarity.h:37
std::optional< std::string_view > is_facet_selectable_attribute_name
Users can specify whether a facet is selectable by an uint8 attribute.
Definition: select_facets_by_normal_similarity.h:55
int num_smooth_iterations
Smoothing boundary of selected region (reduce ears)
Definition: select_facets_by_normal_similarity.h:70
std::string_view output_attribute_name
The attribute name for the selection output.
Definition: select_facets_by_normal_similarity.h:58