EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
EBGeometry_Soup.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Robert Marskar <robert.marskar@sintef.no>
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
11#ifndef EBGEOMETRY_SOUP_HPP
12#define EBGEOMETRY_SOUP_HPP
13
14// Std includes
15#include <cstddef>
16#include <string>
17#include <vector>
18
19// Our includes
20#include "EBGeometry_DCEL.hpp"
21#include "EBGeometry_Pool.hpp"
22#include "EBGeometry_Vec.hpp"
23
24namespace EBGeometry {
25
29namespace Soup {
39template <typename T>
40[[nodiscard]] inline static bool
41containsDegeneratePolygons(const std::vector<EBGeometry::Vec3T<T>>& a_vertices,
42 const std::vector<std::vector<size_t>>& a_facets);
43
55template <typename T>
56[[nodiscard]] inline static bool
57isValid(const std::vector<EBGeometry::Vec3T<T>>& a_vertices,
58 const std::vector<std::vector<size_t>>& a_facets,
59 std::string& a_reason);
60
71template <typename T>
72inline static std::vector<size_t>
73compress(std::vector<EBGeometry::Vec3T<T>>& a_vertices, std::vector<std::vector<size_t>>& a_facets);
74
85template <typename T>
86[[nodiscard]] inline static bool
87isZeroArea(const std::vector<EBGeometry::Vec3T<T>>& a_vertices, const std::vector<size_t>& a_facet) noexcept;
88
110template <typename T>
111inline static std::vector<size_t>
112removeDegeneratePolygons(const std::vector<EBGeometry::Vec3T<T>>& a_vertices,
113 std::vector<std::vector<size_t>>& a_facets);
114
123[[nodiscard]] inline static std::string
124findRepeatedVertex(const std::vector<std::vector<size_t>>& a_facets);
125
138[[nodiscard]] inline static std::string
139findTopologyDefect(const std::vector<std::vector<size_t>>& a_facets);
140
150template <typename T>
151[[nodiscard]] inline static std::string
152findFoldedFeature(const EBGeometry::DCEL::MeshT<T>& a_mesh);
153
170template <typename T>
171inline static void
172soupToDCEL(EBGeometry::DCEL::MeshT<T>& a_mesh,
173 Pool& a_pool,
174 const std::vector<EBGeometry::Vec3T<T>>& a_vertices,
175 const std::vector<std::vector<size_t>>& a_facets,
176 const std::string& a_id);
177
190template <typename T>
191inline static void
192reconcilePairEdgesDCEL(EBGeometry::DCEL::MeshT<T>& a_mesh);
193
194} // namespace Soup
195
196} // namespace EBGeometry
197
198#include "EBGeometry_SoupImplem.hpp"
199
200#endif
Namespace documentation.
Growable bump arena for the GPU memory foundation.
Declaration of 2D and 3D point/vector classes with templated precision, and free functions on them.
DCEL mesh class - stores a doubly-connected edge mesh.
Definition EBGeometry_DCEL_Mesh.hpp:100
Growable bump arena over a MemoryResource.
Definition EBGeometry_Pool.hpp:183
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:258
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_Affine.hpp:26