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 <Poco/File.h>
10
11#include <functional>
12
13namespace Mantid::DataHandling {
14
15bool LoadStl::areEqualVertices(Kernel::V3D const &v1, Kernel::V3D const &v2) const {
16 const Kernel::V3D diff = v1 - v2;
17 const double nanoMetre = 1e-9;
18 return diff.norm() < nanoMetre; // This is 1 nanometre for a unit of a metre.
19}
20
22 m_vertices.resize(vertexSet.size());
23 for (auto const &mapValue : vertexSet) {
24 m_vertices[mapValue.second] = mapValue.first;
25 }
26}
27
28} // namespace Mantid::DataHandling
bool areEqualVertices(Kernel::V3D const &v1, Kernel::V3D const &v2) const
Definition: LoadStl.cpp:15
std::unordered_set< std::pair< Kernel::V3D, uint32_t >, HashV3DPair, V3DTrueComparator > vertexSet
Definition: LoadStl.h:62
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:263