35#ifndef LIB2GEOM_SEEN_PATH_INTERSECTION_H
36#define LIB2GEOM_SEEN_PATH_INTERSECTION_H
55 std::vector<Rect> bounds_a =
bounds(a), bounds_b =
bounds(b);
56 std::vector<std::vector<unsigned> > ixs =
sweep_bounds(bounds_a, bounds_b);
57 for(
unsigned i = 0; i < a.
size(); i++) {
58 for(std::vector<unsigned>::iterator jp = ixs[i].begin(); jp != ixs[i].end(); ++jp) {
61 ret.insert(ret.end(), cc.begin(), cc.end());
68 Curve
const & B,
Interval const &Bd);
70 Curve
const & B,
Interval const &Bd);
92 return c.crossings(a, b);
97 return c.crossings(a, b);
102 return c.crossings(a, b);
Path - a sequence of contiguous curves.
pair< double, double > Point
Abstract continuous curve on a plane defined on [0,1].
Sequence of contiguous curves, aka spline.
size_type size() const
Natural size of the path.
Two-dimensional point that doubles as a vector.
Path and its polyline approximation.
Structure representing the intersection of two curves.
Various utility functions.
int winding(Path const &path, Point const &p)
Compute winding number of the path at the specified point.
Crossings curve_sweep(Path const &a, Path const &b)
Crossings pair_intersect(Curve const &A, Interval const &Ad, Curve const &B, Interval const &Bd)
std::vector< double > path_mono_splits(Path const &p)
Finds all the monotonic splits for a path.
SimpleCrosser DefaultCrosser
void offset_crossings(Crossings &cr, double a, double b)
bool path_direction(Path const &p)
This function should only be applied to simple paths (regions), as otherwise a boolean winding direct...
CrossingSet crossings_among(PathVector const &p)
bool contains(Path const &p, Point const &i, bool evenodd=true)
std::vector< Crossing > Crossings
Crossings crossings(Curve const &a, Curve const &b)
std::vector< std::vector< unsigned > > sweep_bounds(std::vector< Rect >, Dim2 dim=X)
Make a list of pairs of self intersections in a list of Rects.
std::vector< Crossings > CrossingSet
Crossings mono_intersect(Curve const &A, Interval const &Ad, Curve const &B, Interval const &Bd)
Crossings self_crossings(Path const &a)
virtual Crossings crossings(T const &a, T const &b)
Crossings crossings(Path const &a, Path const &b) override
CrossingSet crossings(PathVector const &a, PathVector const &b) override
Crossings crossings(Path const &a, Path const &b) override
Crossings crossings(Curve const &a, Curve const &b)
A simple wrapper around pair_intersect.
Sweepline intersection of groups of rectangles.