| 14 | |
| 15 | namespace EdgeSplitterHelper { |
| 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 | |
| 21 | auto end_itr = std::next(begin_itr); |
| 22 | assert(end_itr != end_points.end()); |
| 23 | const auto& v1 = *begin_itr; |
| 24 | const auto& v2 = *end_itr; |
| 25 | VectorF mid = 0.5 * (v1 + v2); |
| 26 | Float half_length = length * 0.5; |
| 27 | auto mid_itr = end_points.insert(end_itr, mid); |
| 28 | |
| 29 | split(end_points, begin_itr, half_length, threshold); |
| 30 | split(end_points, mid_itr, half_length, threshold); |
| 31 | } |
| 32 | |
| 33 | size_t get_opposite_vertex_index(const Eigen::Ref<VectorI>& f, |
| 34 | size_t vi, size_t vj) { |
no test coverage detected