EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
EBGeometry_STL.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_STL_HPP
12#define EBGEOMETRY_STL_HPP
13
14// Std includes
15#include <cstddef>
16#include <memory>
17#include <string>
18#include <type_traits>
19#include <vector>
20
21// Our includes
22#include "EBGeometry_DCEL.hpp"
23#include "EBGeometry_Vec.hpp"
24
25namespace EBGeometry {
26
32template <typename T>
33class STL
34{
35 static_assert(std::is_floating_point_v<T>, "STL<T>: T must be a floating-point type");
36
37public:
42
47 STL(const std::string& a_id) noexcept;
48
54
60
66 STL&
68
74 STL&
76
81
86 [[nodiscard]] std::string&
88
93 [[nodiscard]] const std::string&
95
100 [[nodiscard]] std::vector<Vec3T<T>>&
102
107 [[nodiscard]] const std::vector<Vec3T<T>>&
109
114 [[nodiscard]] std::vector<std::vector<size_t>>&
116
121 [[nodiscard]] const std::vector<std::vector<size_t>>&
123
131 [[nodiscard]] std::shared_ptr<EBGeometry::DCEL::MeshT<T, Meta>>
133
138 std::string m_id;
139
143 std::vector<Vec3T<T>> m_vertexCoordinates;
144
148 std::vector<std::vector<size_t>> m_facets;
149};
150
151} // namespace EBGeometry
152
153#include "EBGeometry_STLImplem.hpp"
154
155#endif
Namespace documentation.
Declaration of 2D and 3D point/vector classes with templated precision. Used with DCEL tools.
Class for storing contents of STL files.
Definition EBGeometry_STL.hpp:34
STL() noexcept=default
Default constructor. Initializes empty member data holder.
std::vector< Vec3T< T > > m_vertexCoordinates
Vertex coordinates.
Definition EBGeometry_STL.hpp:143
std::vector< std::vector< size_t > > m_facets
Triangle facets.
Definition EBGeometry_STL.hpp:148
std::vector< std::vector< size_t > > & getFacets() noexcept
Get the triangle facet indices.
std::shared_ptr< EBGeometry::DCEL::MeshT< T, Meta > > convertToDCEL() const noexcept
Turn the STL mesh into a DCEL mesh.
std::vector< Vec3T< T > > & getVertexCoordinates() noexcept
Get the vertex coordinates.
std::string & getID() noexcept
Get the identifier for this object.
std::string m_id
STL object ID.
Definition EBGeometry_STL.hpp:138
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:225
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_AnalyticDistanceFunctions.hpp:31