Lagrange
Loading...
Searching...
No Matches
compute_local_feature_size.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#pragma once
13
14#include <lagrange/SurfaceMesh.h>
15#include <lagrange/raycasting/api.h>
16
17#include <limits>
18#include <string_view>
19
21
22class RayCaster;
23
28
44
49{
51 std::string_view output_attribute_name = "@lfs";
52
54 std::string_view vertex_normal_attribute_name = "";
55
58
62 float ray_offset = 1e-4f;
63
66 float default_lfs = std::numeric_limits<float>::infinity();
67
72 float medial_axis_tolerance = 1e-4f;
73};
74
107template <typename Scalar, typename Index>
110 const LocalFeatureSizeOptions& options = {},
111 const RayCaster* ray_caster = nullptr);
112
114
115} // namespace lagrange::raycasting
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:73
A ray caster built on top of Embree that operates directly on SurfaceMesh and SimpleScene objects.
Definition RayCaster.h:190
LA_RAYCASTING_API AttributeId compute_local_feature_size(SurfaceMesh< Scalar, Index > &mesh, const LocalFeatureSizeOptions &options={}, const RayCaster *ray_caster=nullptr)
Compute local feature size for each vertex of a mesh using medial axis approximation.
Definition compute_local_feature_size.cpp:118
RayDirectionMode
Ray direction mode for local feature size computation.
Definition compute_local_feature_size.h:32
@ Both
Cast rays in all directions (full sphere).
Definition compute_local_feature_size.h:42
@ Exterior
Cast rays to the exterior of the shape (hemisphere bounded by 1-ring normals, pointing outward).
Definition compute_local_feature_size.h:39
@ Interior
Cast rays into the interior of the shape (hemisphere bounded by 1-ring normals, pointing inward).
Definition compute_local_feature_size.h:35
uint32_t AttributeId
Identified to be used to access an attribute.
Definition AttributeFwd.h:73
Raycasting operations.
Definition compute_local_feature_size.h:20
Options for compute_local_feature_size().
Definition compute_local_feature_size.h:49
float ray_offset
Ray offset along the vertex normal to avoid self-intersection (relative to bounding box diagonal).
Definition compute_local_feature_size.h:62
float medial_axis_tolerance
Error tolerance for medial axis binary search convergence (relative to bounding box diagonal).
Definition compute_local_feature_size.h:72
float default_lfs
Default local feature size value used when raycasting fails to find valid hits.
Definition compute_local_feature_size.h:66
std::string_view vertex_normal_attribute_name
Input vertex normal attribute name. If empty, vertex normals will be computed internally.
Definition compute_local_feature_size.h:54
RayDirectionMode direction_mode
Ray direction mode (interior, exterior, or both).
Definition compute_local_feature_size.h:57
std::string_view output_attribute_name
Output attribute name for local feature size values.
Definition compute_local_feature_size.h:51