diff options
Diffstat (limited to 'src/2geom/basic-intersection.h')
| -rw-r--r-- | src/2geom/basic-intersection.h | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/src/2geom/basic-intersection.h b/src/2geom/basic-intersection.h index 0090b0305..d464891f9 100644 --- a/src/2geom/basic-intersection.h +++ b/src/2geom/basic-intersection.h @@ -1,25 +1,47 @@ + + +#include <2geom/point.h> #include <2geom/sbasis.h> -#include <2geom/bezier-to-sbasis.h> -#include <2geom/sbasis-to-bezier.h> #include <2geom/d2.h> +#include <vector> +#include <utility> + + namespace Geom { -std::vector<std::pair<double, double> > -find_intersections( D2<SBasis> const & A, +std::vector<std::pair<double, double> > +find_intersections( D2<SBasis> const & A, D2<SBasis> const & B); -std::vector<std::pair<double, double> > +std::vector<std::pair<double, double> > find_self_intersections(D2<SBasis> const & A); // Bezier form -std::vector<std::pair<double, double> > -find_intersections( std::vector<Point> const & A, +std::vector<std::pair<double, double> > +find_intersections( std::vector<Point> const & A, std::vector<Point> const & B); -std::vector<std::pair<double, double> > +std::vector<std::pair<double, double> > find_self_intersections(std::vector<Point> const & A); + +/* + * find_intersection + * + * input: A, B - set of control points of two Bezier curve + * input: precision - required precision of computation + * output: xs - set of pairs of parameter values + * at which crossing happens + * + * This routine is based on the Bezier Clipping Algorithm, + * see: Sederberg - Computer Aided Geometric Design + */ +void find_intersections (std::vector< std::pair<double, double> > & xs, + std::vector<Point> const& A, + std::vector<Point> const& B, + double precision = 1e-5); + }; /* |
