This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/geometry/GEO_mesh_merge_by_distance.hh
Campbell Barton c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00

42 lines
1.4 KiB
C++

/* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
#include <optional>
#include "BLI_index_mask.hh"
#include "BLI_span.hh"
struct Mesh;
/** \file
* \ingroup geo
*/
namespace blender::geometry {
/**
* Merge selected vertices into other selected vertices within the \a merge_distance. The merged
* indices favor speed over accuracy, since the results will depend on the order of the vertices.
*
* \returns #std::nullopt if the mesh should not be changed (no vertices are merged), in order to
* avoid copying the input. Otherwise returns the new mesh with merged geometry.
*/
std::optional<Mesh *> mesh_merge_by_distance_all(const Mesh &mesh,
IndexMask selection,
float merge_distance);
/**
* Merge selected vertices along edges to other selected vertices. Only vertices connected by edges
* are considered for merging.
*
* \returns #std::nullopt if the mesh should not be changed (no vertices are merged), in order to
* avoid copying the input. Otherwise returns the new mesh with merged geometry.
*/
std::optional<Mesh *> mesh_merge_by_distance_connected(const Mesh &mesh,
Span<bool> selection,
float merge_distance,
bool only_loose_edges);
} // namespace blender::geometry