MCPcopy Create free account
hub / github.com/SimVascular/SimVascular / PyUtilComputePointsCenter

Function PyUtilComputePointsCenter

Code/Source/PythonAPI/PyUtils.cxx:207–223  ·  view source on GitHub ↗

--------------------------- PyUtilComputePointsCenter ---------------------------

Source from the content-addressed store, hash-verified

205//---------------------------
206//
207std::array<double,3>
208PyUtilComputePointsCenter(const std::vector<std::array<double,3>>& points)
209{
210 std::array<double,3> center{0.0,0.0,0.0};
211
212 for (auto& pt : points) {
213 center[0] += pt[0];
214 center[1] += pt[1];
215 center[2] += pt[2];
216 }
217
218 int n = points.size();
219 center[0] /= n;
220 center[1] /= n;
221 center[2] /= n;
222 return center;
223}
224
225//----------------------
226// PyUtilCheckPointData

Callers 3

PyPolygonGenerateDataFunction · 0.85
PyContourGenerateDataFunction · 0.85

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected