diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-09-01 19:29:30 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-09-01 19:29:30 +0000 |
| commit | 0509575421dcc13079ea20f68592bc2fe05d8e52 (patch) | |
| tree | 9d8993bc4a3431e16024f12390fd2fd9bda46243 /src/2geom/basic-intersection.h | |
| parent | yet another update of ru.po (diff) | |
| download | inkscape-0509575421dcc13079ea20f68592bc2fe05d8e52.tar.gz inkscape-0509575421dcc13079ea20f68592bc2fe05d8e52.zip | |
update 2geom (rev. 1569)
(bzr r6748)
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); + }; /* |
