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
48template <typename Scalar, typename Index>
51 const SurfaceMesh<Scalar, Index>& target,
52 const MeshDistancesOptions& options = {});
53
77template <typename Scalar, typename Index>
78LA_BVH_API Scalar compute_hausdorff(
79 const SurfaceMesh<Scalar, Index>& source,
80 const SurfaceMesh<Scalar, Index>& target);
81
103template <typename Scalar, typename Index>
104LA_BVH_API Scalar
106
108
109} // namespace lagrange::bvh
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:66
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:101
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:129
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:73
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