MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / split

Function split

tools/MeshUtils/LongEdgeRemoval.cpp:16–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14
15namespace LongEdgeRemovalHelper {
16 void split(std::list<VectorF>& end_points,
17 std::list<VectorF>::iterator begin_itr,
18 Float length, Float threshold) {
19 if (length <= threshold) return;
20 if (!std::isfinite(length)) return;
21
22 auto end_itr = std::next(begin_itr);
23 assert(end_itr != end_points.end());
24 const auto& v1 = *begin_itr;
25 const auto& v2 = *end_itr;
26 VectorF mid = 0.5 * (v1 + v2);
27 Float half_length = length * 0.5;
28 auto mid_itr = end_points.insert(end_itr, mid);
29
30 split(end_points, begin_itr, half_length, threshold);
31 split(end_points, mid_itr, half_length, threshold);
32 }
33}
34using namespace LongEdgeRemovalHelper;
35

Callers 1

split_long_edgesMethod · 0.70

Calls 3

nextFunction · 0.85
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected