MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / getOrCreateVertexIndexT

Function getOrCreateVertexIndexT

src/gltf/GltfForwardTranslator.cpp:119–128  ·  view source on GitHub ↗

Finds the vertex Index from all Vertices of a planar Surface param : point3d param : allPoints param : tol returns : index of the Vertex

Source from the content-addressed store, hash-verified

117 // param : tol
118 // returns : index of the Vertex
119 size_t getOrCreateVertexIndexT(const Point3d& point3d, std::vector<Point3d>& allPoints, double tol = 0.001) {
120 size_t n = allPoints.size();
121 for (size_t i = 0; i < n; ++i) {
122 if (openstudio::getDistance(point3d, allPoints[i]) < tol) {
123 return i;
124 }
125 }
126 allPoints.push_back(point3d);
127 return (allPoints.size() - 1);
128 }
129
130 template <typename T>
131 std::vector<T> getObjectsAndSort(const model::Model& model) {

Callers 1

toGltfModelMethod · 0.85

Calls 3

getDistanceFunction · 0.85
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected