Lagrange
Loading...
Searching...
No Matches
compute_mesh_distances.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/bvh/api.h>
16
17#include <string>
18
19namespace lagrange::bvh {
20
23
28{
30 std::string output_attribute_name = "@distance_to_mesh";
31};
32
50template <typename Scalar, typename Index>
53 const SurfaceMesh<Scalar, Index>& target,
54 const MeshDistancesOptions& options = {});
55
81template <typename Scalar, typename Index>
82LA_BVH_API Scalar compute_hausdorff(
83 const SurfaceMesh<Scalar, Index>& source,
84 const SurfaceMesh<Scalar, Index>& target);
85
109template <typename Scalar, typename Index>
110LA_BVH_API Scalar
112
114
115} // namespace lagrange::bvh
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:73
uint32_t AttributeId
Identified to be used to access an attribute.
Definition AttributeFwd.h:73
@ Scalar
Mesh attribute must have exactly 1 channel.
Definition AttributeFwd.h:56
LA_BVH_API Scalar compute_hausdorff(const SurfaceMesh< Scalar, Index > &source, const SurfaceMesh< Scalar, Index > &target)
Compute the symmetric Hausdorff distance between source and target.
Definition compute_mesh_distances.cpp:159
LA_BVH_API Scalar compute_chamfer(const SurfaceMesh< Scalar, Index > &source, const SurfaceMesh< Scalar, Index > &target)
Compute the Chamfer distance between source and target.
Definition compute_mesh_distances.cpp:189
LA_BVH_API AttributeId compute_mesh_distances(SurfaceMesh< Scalar, Index > &source, const SurfaceMesh< Scalar, Index > &target, const MeshDistancesOptions &options={})
Compute the distance from each vertex in source to the closest point on target, and store the result ...
Definition compute_mesh_distances.cpp:131
Options for compute_mesh_distances.
Definition compute_mesh_distances.h:28
std::string output_attribute_name
Name of the output per-vertex scalar attribute written to the source mesh.
Definition compute_mesh_distances.h:30