# curve_helper.cpp File Reference

Curve Helper File. More...

`#include "curve_helper.h"`
`#include <algorithm>`
`#include <vector>`

## Defines

#define | ERR 1e-11

## Functions

Real | synfig::find_closest (const etl::bezier< Point > &curve, const Point &point, float step, Real *dout, float *tout)
int | synfig::intersect (const Point &p1, const Vector &v1, float &t1, const Point &p2, const Vector &v2, float &t2)
int | intersect (const Rect &r, const Point &p, const Vector &v)
int | synfig::intersect (const Rect &r, const Point &p)
int | intersect (const BezHull &bh, const Point &p, const Vector &v)
int | Clip (const Rect &r, const Point &p1, const Point &p2, Point *op1, Point *op2)
static void | clean_bez (const bezier< Point > &b, bezier< Point > &out)
static int | recurse_intersect (const CIntersect::SCurve &b, const Point &p1, int depthleft=10)
int | intersect (const bezier< Point > &b, const Point &p)
int | intersect_scurve (const CIntersect::SCurve &b, const Point &p)
int | synfig::intersect (const bezier< Point > &b, const Point &p)

## Variables

const Real | ERROR = 1e-11

## Detailed Description

Curve Helper File.

$Id$

## Define Documentation

#define ERR 1e-11

Referenced by Clip(), and synfig::intersect().

## Function Documentation

int intersect | ( | const Rect & | r,
|  | const Point & | p,
|  | const Vector & | v |
| ) |  |  |

References ERR.

Referenced by Warp::accelerated_render(), synfig::Layer_PasteCanvas::accelerated_render(), Rectangle::hit_check(), and synfig::Rect::operator &&().

int intersect | ( | const BezHull & | bh,
|  | const Point & | p,
|  | const Vector & | v |
| ) |  |  |

References ERR, synfig::BezHull::p, and synfig::BezHull::size.

int Clip | ( | const Rect & | r,
|  | const Point & | p1,
|  | const Point & | p2,
|  | Point * | op1,
|  | Point * | op2 |
| ) |  |  |

References ERR.

static void clean_bez | ( | const bezier< Point > & | b,
|  | bezier< Point > & | out |
| ) |  |  | `[static]`

Referenced by intersect(), and synfig::CIntersect::operator()().

static int recurse_intersect | ( | const CIntersect::SCurve & | b,
|  | const Point & | p1,
|  | int | depthleft = `10` |
| ) |  |  | `[static]`

References ERROR, and synfig::intersect().

int intersect | ( | const bezier< Point > & | b,
|  | const Point & | p |
| ) |  |  |

References synfig::Bound(), and clean_bez().

int intersect_scurve | ( | const CIntersect::SCurve & | b,
|  | const Point & | p |
| ) |  |  |

References synfig::Rect::expand(), and synfig::Rect::set_point().

Referenced by synfig::intersect().

## Variable Documentation

const Real ERROR = 1e-11

Referenced by recurse_intersect().