Mantid
Loading...
Searching...
No Matches
LoadStl.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
8#include "MantidKernel/V3D.h"
9#include <functional>
10
11namespace Mantid::DataHandling {
12
13bool LoadStl::areEqualVertices(Kernel::V3D const &v1, Kernel::V3D const &v2) const {
14 const Kernel::V3D diff = v1 - v2;
15 const double nanoMetre = 1e-9;
16 return diff.norm() < nanoMetre; // This is 1 nanometre for a unit of a metre.
17}
18
20 m_vertices.resize(vertexSet.size());
21 for (auto const &mapValue : vertexSet) {
22 m_vertices[mapValue.second] = mapValue.first;
23 }
24}
25
26} // namespace Mantid::DataHandling
bool areEqualVertices(Kernel::V3D const &v1, Kernel::V3D const &v2) const
Definition LoadStl.cpp:13
std::unordered_set< std::pair< Kernel::V3D, uint32_t >, HashV3DPair, V3DTrueComparator > vertexSet
Definition LoadStl.h:63
std::vector< Kernel::V3D > m_vertices
Definition MeshFileIO.h:65
Class for 3D vectors.
Definition V3D.h:34
double norm() const noexcept
Definition V3D.h:269