13 std::vector<Crossing> answer;
14 if (segments.
size() >= 2) {
15 for (
auto i0 = segments.
begin(); i0 != segments.
end() - 1; ++i0) {
16 for (
auto i1 = i0 + 1; i1 != segments.
end(); ++i1) {
17 if (
auto possiblePoint =
intersect(*i0, *i1)) {
18 answer.push_back({*i0, *i1, possiblePoint.value()});
constexpr T * begin() const
constexpr T * end() const
constexpr size_t size() const
std::optional< std::vector< Crossing > > brute_force_crossings(SkSpan< const Segment > segments)
std::optional< Point > intersect(const Segment &s0, const Segment &s1)