15{
16 if (lines.size() < 3)
17 return {};
18
21 for (uint32_t li = 0; li < lines.size()-1; ++li) {
22 const Line &l = lines[li];
24 for (const auto &[p, node_index] : intersections) {
25 if (node_index - 1 <= li)
26 continue;
27 if (const Line &l_ = lines[node_index];
28 l_.a == l.a ||
29 l_.a == l.b ||
30 l_.b == l.a ||
31 l_.b == l.b )
32
33 continue;
34
35
36 Vec2d intersection_point = p.cast<
double>();
37
38 result.push_back(
IntersectionLines{li,
static_cast<uint32_t
>(node_index), intersection_point});
39 }
40 }
41 return result;
42}
std::vector< std::pair< VectorType, size_t > > get_intersections_with_line(const std::vector< LineType > &lines, const TreeType &tree, const LineType &line)
Definition AABBTreeLines.hpp:276
AABBTreeIndirect::Tree< LineType::Dim, typename LineType::Scalar > build_aabb_tree_over_indexed_lines(const std::vector< LineType > &lines)
Definition AABBTreeLines.hpp:172
std::vector< IntersectionLines > IntersectionsLines
Definition IntersectionPoints.hpp:18
std::vector< IntersectionLine > IntersectionLines
Definition TriangleMeshSlicer.cpp:160
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > Vec2d
Definition Point.hpp:67