Inkscape
Vector Graphics Editor
|
Various utility functions. More...
Namespaces | |
namespace | BezierFitter |
namespace | detail |
namespace | Interpolate |
namespace | NL |
namespace | PathInternal |
namespace | SL |
Classes | |
struct | AddableConcept |
class | Affine |
3x3 matrix representing an affine transformation. More... | |
class | Angle |
Wrapper for angular values. More... | |
class | AngleInterval |
Directed angular interval. More... | |
struct | Aspect |
Structure that specifies placement of within a viewport. More... | |
class | Bezier |
Polynomial in Bernstein-Bezier basis. More... | |
class | BezierCurve |
Two-dimensional Bezier curve of arbitrary order. More... | |
class | BezierCurveN |
Bezier curve with compile-time specified order. More... | |
class | BezierCurveN< 0 > |
class | BinomialCoefficient |
Class for calculating and accessing a row of Pascal's triangle. More... | |
class | CairoPathSink |
Output paths to a Cairo drawing context. More... | |
class | Circle |
Set of all points at a fixed distance from the center. More... | |
class | CLIPPER_CLASS |
class | ContinuityError |
class | ConvexHull |
Convex hull based on the Andrew's monotone chain algorithm. More... | |
struct | CoordTraits |
Traits class used with coordinate types. More... | |
struct | CoordTraits< Coord > |
struct | CoordTraits< IntCoord > |
struct | CoordTraits< WrappedPyObject > |
struct | Crosser |
struct | Crossing |
struct | CrossingOrder |
struct | CrossingTraits |
struct | CrossingTraits< Path > |
class | Curve |
Abstract continuous curve on a plane defined on [0,1]. More... | |
class | D2 |
Adaptor that creates 2D functions from 1D ones. More... | |
struct | D2Traits |
class | Eigen |
Given a matrix (ignoring the translation) this returns the eigen values and vectors. More... | |
class | Ellipse |
Set of points with a constant sum of distances from two foci. More... | |
class | EllipticalArc |
Elliptical arc curve. More... | |
struct | EmptyClass |
struct | EqualityComparableConcept |
class | Exception |
Base exception class, all 2geom exceptions should be derived from this one. More... | |
struct | FragmentConcept |
class | GenericInterval |
A range of numbers which is never empty. More... | |
class | GenericOptInterval |
A range of numbers that can be empty. More... | |
class | GenericOptRect |
Axis-aligned generic rectangle that can be empty. More... | |
class | GenericRect |
Axis aligned, non-empty, generic rectangle. More... | |
struct | GetAxis |
Axis extraction functor. More... | |
class | HatOf |
class | HShear |
Horizontal shearing. More... | |
class | InfinitelyManySolutions |
class | InfiniteSolutions |
class | Intersection |
Intersection between two shapes. More... | |
class | Interval |
Range of real numbers that is never empty. More... | |
class | IntPoint |
Two-dimensional point with integer coordinates. More... | |
class | InvariantsViolation |
class | Line |
Infinite line on a plane. More... | |
class | Linear |
Function that interpolates linearly between two values. More... | |
class | Linear2d |
class | LinearN |
class | LinearN< 0 > |
class | LinearOf |
class | LogicalError |
struct | MonoCrosser |
class | MultiDegree |
MultiDegree: More... | |
struct | MultipliableNoncommutative |
Noncommutative multiplication helper. More... | |
struct | MultiplicableConcept |
struct | NearConcept |
class | NotImplemented |
class | NotInvertible |
struct | NullIterator |
Null output iterator Use this if you want to discard a result returned through an output iterator. More... | |
struct | OffsetableConcept |
class | OptInterval |
Range of real numbers that can be empty. More... | |
class | OptRect |
Axis-aligned rectangle that can be empty. More... | |
class | Parallelogram |
Paralellogram, representing a linear transformation of a rectangle. More... | |
class | Path |
Sequence of contiguous curves, aka spline. More... | |
class | PathBuilder |
Store paths to a PathVector. More... | |
struct | PathExtrema |
Stores information about the extremum points on a path, with respect to one of the coordinate axes. More... | |
class | PathIntersectionGraph |
Intermediate data for computing Boolean operations on paths. More... | |
class | PathInterval |
Contiguous subset of the path's parameter domain. More... | |
class | PathIteratorSink |
Store paths to an output iterator. More... | |
class | PathSink |
Callback interface for processing path data. More... | |
struct | PathTime |
Generalized time value in the path. More... | |
class | PathVector |
Sequence of subpaths. More... | |
struct | PathVectorTime |
Generalized time value in the path vector. More... | |
class | pedantic_vector |
class | Piecewise |
Function defined as discrete pieces. More... | |
class | PlanarGraph |
Planar graph - a graph geometrically embedded in the plane. More... | |
class | Point |
Two-dimensional point that doubles as a vector. More... | |
class | Poly |
Polynomial in canonical (monomial) basis. More... | |
class | RangeError |
class | RatQuad |
class | Ray |
Straight ray from a specific point to infinity. More... | |
class | Rect |
Axis aligned, non-empty rectangle. More... | |
class | RedBlack |
class | RedBlackTree |
struct | ResultTraits |
struct | ResultTraits< double > |
struct | ResultTraits< Point > |
class | Rotate |
Rotation around the origin. More... | |
class | RTree |
class | RTreeNode |
class | RTreeRecord_Leaf |
class | RTreeRecord_NonLeaf |
class | SBasis |
Polynomial in symmetric power basis. More... | |
class | SBasis2d |
class | SBasisCurve |
Symmetric power basis curve. More... | |
class | SBasisN |
Polynomials of n variables, written in SBasis form. More... | |
class | SBasisN< 0 > |
class | SBasisOf |
struct | ScalableConcept |
class | Scale |
Scaling from the origin. More... | |
struct | ShapeConcept |
struct | ShapeTraits |
struct | ShapeTraits< Circle > |
struct | ShapeTraits< Path > |
struct | ShapeTraits< PathVector > |
class | ShearBase |
Common base for shearing transforms. More... | |
struct | SimpleCrosser |
struct | SmashIntersection |
class | SVGPathGenerator |
struct | SVGPathParseError |
class | SVGPathParser |
Read SVG path data and feed it to a PathSink. More... | |
class | SVGPathWriter |
Serialize paths to SVG path data strings. More... | |
class | Sweeper |
Generic sweepline algorithm. More... | |
class | SweepVector |
struct | TransformConcept |
Type requirements for transforms. More... | |
class | TransformOperations |
Base template for transforms. More... | |
class | Translate |
Translation by a vector. More... | |
class | TriOf |
class | VShear |
Vertical shearing. More... | |
class | WrappedPyObject |
class | xAx |
class | Zoom |
Combination of a translation and uniform scale. More... | |
Concepts | |
concept | EdgeLabelConcept |
Enumerations | |
enum | Dim2 { X = 0 , Y = 1 } |
2D axis enumeration (X or Y). More... | |
enum | enum_add_to_group { ADD_TO_GROUP_A = 0 , ADD_TO_GROUP_B } |
enum | enum_split_strategy { QUADRATIC_SPIT = 0 , LINEAR_COST , TOTAL_STRATEGIES } |
enum | Align { ALIGN_NONE , ALIGN_XMIN_YMIN , ALIGN_XMID_YMIN , ALIGN_XMAX_YMIN , ALIGN_XMIN_YMID , ALIGN_XMID_YMID , ALIGN_XMAX_YMID , ALIGN_XMIN_YMAX , ALIGN_XMID_YMAX , ALIGN_XMAX_YMAX } |
Values for the <align> parameter of preserveAspectRatio. More... | |
enum | Expansion { EXPANSION_MEET , EXPANSION_SLICE } |
Values for the <meetOrSlice> parameter of preserveAspectRatio. More... | |
enum | Errors : ErrorCode { GEOM_ERR_INTERSECGRAPH } |
enum | IntersectorKind { intersects = 0 , parallel , coincident , no_intersection } |
enum | NodeType { NODE_NONE , NODE_CUSP , NODE_SMOOTH , NODE_SYMM } |
What kind of node is this? This is the value for the node->type field. More... | |
Functions | |
Affine | from_basis (Point const &x_basis, Point const &y_basis, Point const &offset) |
Creates a Affine given an axis and origin point. | |
Affine | elliptic_quadratic_form (Affine const &m) |
Affine | identity () |
Create an identity matrix. | |
bool | are_near (Affine const &a1, Affine const &a2, Coord eps=EPSILON) |
Angle | distance (Angle const &a, Angle const &b) |
void | find_intersections (std::vector< std::pair< double, double > > &xs, D2< Bezier > const &A, D2< Bezier > const &B, double precision=EPSILON) |
void | find_intersections (std::vector< std::pair< double, double > > &xs, D2< SBasis > const &A, D2< SBasis > const &B, double precision=EPSILON) |
void | find_intersections (std::vector< std::pair< double, double > > &xs, std::vector< Point > const &A, std::vector< Point > const &B, double precision=EPSILON) |
void | find_self_intersections (std::vector< std::pair< double, double > > &xs, D2< SBasis > const &A, double precision=EPSILON) |
void | find_self_intersections (std::vector< std::pair< double, double > > &xs, D2< Bezier > const &A, double precision=EPSILON) |
void | find_intersections_bezier_clipping (std::vector< std::pair< double, double > > &xs, std::vector< Point > const &A, std::vector< Point > const &B, double precision=EPSILON) |
void | subdivide (D2< Bezier > const &a, D2< Bezier > const &b, std::vector< std::pair< double, double > > const &xs, std::vector< D2< Bezier > > &av, std::vector< D2< Bezier > > &bv) |
void | find_collinear_normal (std::vector< std::pair< double, double > > &xs, std::vector< Point > const &A, std::vector< Point > const &B, double precision=EPSILON) |
void | polish_intersections (std::vector< std::pair< double, double > > &xs, D2< SBasis > const &A, D2< SBasis > const &B) |
double | hausdorfl (D2< SBasis > &A, D2< SBasis > const &B, double m_precision, double *a_t=NULL, double *b_t=NULL) |
Compute the Hausdorf distance from A to B only. | |
double | hausdorf (D2< SBasis > &A, D2< SBasis > const &B, double m_precision, double *a_t=NULL, double *b_t=NULL) |
Compute the symmetric Hausdorf distance. | |
bool | non_collinear_segments_intersect (const Point &A, const Point &B, const Point &C, const Point &D) |
Check if two line segments intersect. | |
Point | middle_point (LineSegment const &_segment) |
Coord | length (LineSegment const &seg) |
Coord | bezier_length (std::vector< Point > const &points, Coord tolerance) |
Compute the length of a bezier curve given by a vector of its control points. | |
Coord | bezier_length (Point a0, Point a1, Point a2, Coord tolerance) |
Compute the length of a quadratic bezier curve given by its control points. | |
Coord | bezier_length (Point a0, Point a1, Point a2, Point a3, Coord tolerance) |
Compute the length of a cubic bezier curve given by its control points. | |
SBasis | bezier_to_sbasis (Coord const *handles, unsigned order) |
template<typename T > | |
D2< SBasis > | handles_to_sbasis (T const &handles, unsigned order) |
Point | bezier_pt (unsigned const degree, Point const V[], double const t) |
Evaluate a Bezier curve at parameter value t. | |
int | bezier_fit_cubic (Point bezier[], Point const data[], int len, double error) |
int | bezier_fit_cubic_r (Point bezier[], Point const data[], int const len, double const error, unsigned const max_beziers) |
Fit a multi-segment Bezier curve to a set of digitized points, with possible weedout of identical points and NaNs. | |
int | bezier_fit_cubic_full (Point bezier[], int split_points[], Point const data[], int const len, Point const &tHat1, Point const &tHat2, double const error, unsigned const max_beziers) |
Fit a multi-segment Bezier curve to a set of digitized points, without possible weedout of identical points and NaNs. | |
Point | darray_left_tangent (Point const d[], unsigned const len) |
Estimate the (forward) tangent at point d[first + 0.5]. | |
Point | darray_left_tangent (Point const d[], unsigned const len, double const tolerance_sq) |
Estimate the (forward) tangent at point d[0]. | |
Point | darray_right_tangent (Point const d[], unsigned const len, double const tolerance_sq) |
Estimates the (backward) tangent at d[last]. | |
template<typename iterator > | |
static void | cubic_bezier_poly_coeff (iterator b, Point *pc) |
template<typename T > | |
T | bernstein_value_at (double t, T const *c_, unsigned n) |
Compute the value of a Bernstein-Bezier polynomial. | |
template<typename T > | |
T | casteljau_subdivision (double t, T const *v, T *left, T *right, unsigned order) |
Perform Casteljau subdivision of a Bezier polynomial. | |
void | bezier_to_sbasis (SBasis &sb, Bezier const &bz) |
Changes the basis of p to be sbasis. | |
Bezier | operator* (Bezier const &f, Bezier const &g) |
Bezier | multiply (Bezier const &f, Bezier const &g) |
Bezier | reverse (const Bezier &a) |
Bezier | portion (const Bezier &a, double from, double to) |
std::vector< Point > | bezier_points (const D2< Bezier > &a) |
Bezier | derivative (Bezier const &a) |
Bezier | integral (Bezier const &a) |
OptInterval | bounds_fast (Bezier const &b) |
OptInterval | bounds_exact (Bezier const &b) |
OptInterval | bounds_local (Bezier const &b, OptInterval const &i) |
void | bezier_expand_to_image (Interval &range, Coord x0, Coord x1, Coord x2) |
Expand an interval to the image of a Bézier-Bernstein polynomial, assuming it already contains the initial point x0. | |
void | bezier_expand_to_image (Interval &range, Coord x0, Coord x1, Coord x2, Coord x3) |
std::ostream & | operator<< (std::ostream &os, const Bezier &b) |
template<typename T > | |
constexpr void | binomial_increment_n (T &b, int n, int k) |
Given a multiple of binomial(n, k), modify it to the same multiple of binomial(n + 1, k). | |
template<typename T > | |
constexpr void | binomial_decrement_n (T &b, int n, int k) |
Given a multiple of binomial(n, k), modify it to the same multiple of binomial(n - 1, k). | |
template<typename T > | |
constexpr void | binomial_increment_k (T &b, int n, int k) |
Given a multiple of binomial(n, k), modify it to the same multiple of binomial(n, k + 1). | |
template<typename T > | |
constexpr void | binomial_decrement_k (T &b, int n, int k) |
Given a multiple of binomial(n, k), modify it to the same multiple of binomial(n, k - 1). | |
template<typename T > | |
constexpr T | choose (unsigned n, unsigned k) |
Calculate the (n, k)th binomial coefficient. | |
bool | are_near (Circle const &a, Circle const &b, Coord eps=EPSILON) |
std::ostream & | operator<< (std::ostream &out, Circle const &c) |
template<typename T > | |
T | portion (const T &t, const Interval &i) |
std::vector< Point > | intersect (const xAx &C1, const xAx &C2) |
bool | clip (std::vector< RatQuad > &rq, const xAx &cs, const Rect &R) |
std::ostream & | operator<< (std::ostream &out_file, const xAx &x) |
std::ostream & | operator<< (std::ostream &out, Geom::ConvexHull const &hull) |
Output operator for convex hulls. | |
constexpr Dim2 | other_dimension (Dim2 d) |
Get the other (perpendicular) dimension. | |
constexpr Coord | infinity () |
Get a value representing infinity. | |
bool | are_near (Coord a, Coord b, double eps=EPSILON) |
Nearness predicate for values. | |
bool | rel_error_bound (Coord a, Coord b, double eps=EPSILON) |
constexpr Coord | lerp (Coord t, Coord a, Coord b) |
Numerically stable linear interpolation. | |
template<typename C > | |
std::vector< Rect > | bounds (C const &a) |
std::vector< Rect > | bounds (Path const &a) |
void | sort_crossings (Crossings &cr, unsigned ix) |
void | merge_crossings (Crossings &a, Crossings &b, unsigned i) |
void | offset_crossings (Crossings &cr, double a, double b) |
Crossings | reverse_ta (Crossings const &cr, std::vector< double > max) |
Crossings | reverse_tb (Crossings const &cr, unsigned split, std::vector< double > max) |
CrossingSet | reverse_ta (CrossingSet const &cr, unsigned split, std::vector< double > max) |
CrossingSet | reverse_tb (CrossingSet const &cr, unsigned split, std::vector< double > max) |
void | clean (Crossings &cr_a, Crossings &cr_b) |
void | delete_duplicates (Crossings &crs) |
Coord | nearest_time (Point const &p, Curve const &c) |
Curve * | new_clone (Curve const &c) |
template<typename T > | |
D2< T > | reverse (const D2< T > &a) |
template<typename T > | |
D2< T > | portion (const D2< T > &a, Coord f, Coord t) |
template<typename T > | |
D2< T > | portion (const D2< T > &a, Interval i) |
template<typename T > | |
bool | operator== (D2< T > const &a, D2< T > const &b) |
template<typename T > | |
bool | operator!= (D2< T > const &a, D2< T > const &b) |
template<typename T > | |
bool | are_near (D2< T > const &a, D2< T > const &b, double tol) |
template<typename T > | |
D2< T > | operator+ (D2< T > const &a, D2< T > const &b) |
template<typename T > | |
D2< T > | operator- (D2< T > const &a, D2< T > const &b) |
template<typename T > | |
D2< T > | operator+= (D2< T > &a, D2< T > const &b) |
template<typename T > | |
D2< T > | operator-= (D2< T > &a, D2< T > const &b) |
template<typename T > | |
D2< T > | operator- (D2< T > const &a) |
template<typename T > | |
D2< T > | operator* (D2< T > const &a, Point const &b) |
template<typename T > | |
D2< T > | operator/ (D2< T > const &a, Point const &b) |
template<typename T > | |
D2< T > | operator*= (D2< T > &a, Point const &b) |
template<typename T > | |
D2< T > | operator/= (D2< T > &a, Point const &b) |
template<typename T > | |
D2< T > | operator* (D2< T > const &a, double b) |
template<typename T > | |
D2< T > | operator*= (D2< T > &a, double b) |
template<typename T > | |
D2< T > | operator/ (D2< T > const &a, double b) |
template<typename T > | |
D2< T > | operator/= (D2< T > &a, double b) |
template<typename T > | |
D2< T > | operator* (D2< T > const &v, Affine const &m) |
template<typename T > | |
D2< T > | operator* (D2< T > const &a, T const &b) |
template<typename T > | |
D2< T > | operator+ (D2< T > const &a, Point b) |
template<typename T > | |
D2< T > | operator- (D2< T > const &a, Point b) |
template<typename T > | |
D2< T > | operator+= (D2< T > &a, Point b) |
template<typename T > | |
D2< T > | operator-= (D2< T > &a, Point b) |
template<typename T > | |
T | dot (D2< T > const &a, D2< T > const &b) |
template<typename T > | |
D2< T > | rot90 (D2< T > const &a) |
template<typename T > | |
D2< T > | compose (D2< T > const &a, T const &b) |
template<typename T > | |
D2< T > | compose_each (D2< T > const &a, D2< T > const &b) |
template<typename T > | |
D2< T > | compose_each (T const &a, D2< T > const &b) |
template<typename T > | |
D2< T > | derivative (D2< T > const &a) |
template<typename T > | |
D2< T > | integral (D2< T > const &a) |
template<typename T > | |
std::ostream & | operator<< (std::ostream &out_file, const Geom::D2< T > &in_d2) |
A function to print out the Point. | |
template<typename T > | |
OptRect | bounds_fast (const D2< T > &a) |
template<typename T > | |
OptRect | bounds_exact (const D2< T > &a) |
template<typename T > | |
OptRect | bounds_local (const D2< T > &a, const OptInterval &t) |
D2< SBasis > | compose (D2< SBasis > const &a, SBasis const &b) |
SBasis | L2 (D2< SBasis > const &a, unsigned k) |
double | L2 (D2< double > const &a) |
D2< SBasis > | multiply (Linear const &a, D2< SBasis > const &b) |
D2< SBasis > | operator* (Linear const &a, D2< SBasis > const &b) |
D2< SBasis > | multiply (SBasis const &a, D2< SBasis > const &b) |
D2< SBasis > | operator* (SBasis const &a, D2< SBasis > const &b) |
D2< SBasis > | truncate (D2< SBasis > const &a, unsigned terms) |
unsigned | sbasis_size (D2< SBasis > const &a) |
double | tail_error (D2< SBasis > const &a, unsigned tail) |
Piecewise< D2< SBasis > > | sectionize (D2< Piecewise< SBasis > > const &a) |
D2< Piecewise< SBasis > > | make_cuts_independent (Piecewise< D2< SBasis > > const &a) |
Piecewise< D2< SBasis > > | rot90 (Piecewise< D2< SBasis > > const &a) |
Piecewise< SBasis > | dot (Piecewise< D2< SBasis > > const &a, Piecewise< D2< SBasis > > const &b) |
Piecewise< SBasis > | dot (Piecewise< D2< SBasis > > const &a, Point const &b) |
Piecewise< SBasis > | cross (Piecewise< D2< SBasis > > const &a, Piecewise< D2< SBasis > > const &b) |
Piecewise< D2< SBasis > > | operator* (Piecewise< D2< SBasis > > const &a, Affine const &m) |
Piecewise< D2< SBasis > > | force_continuity (Piecewise< D2< SBasis > > const &f, double tol=0, bool closed=false) |
std::vector< Piecewise< D2< SBasis > > > | fuse_nearby_ends (std::vector< Piecewise< D2< SBasis > > > const &f, double tol=0) |
std::vector< Geom::Piecewise< Geom::D2< Geom::SBasis > > > | split_at_discontinuities (Geom::Piecewise< Geom::D2< Geom::SBasis > > const &pwsbin, double tol=.0001) |
Point | unitTangentAt (D2< SBasis > const &a, Coord t, unsigned n=3) |
OptRect | bounds_fast (D2< SBasis > const &s, unsigned order=0) |
OptRect | bounds_local (D2< SBasis > const &s, OptInterval i, unsigned order=0) |
std::vector< Interval > | level_set (D2< SBasis > const &f, Rect region) |
std::vector< Interval > | level_set (D2< SBasis > const &f, Point p, double tol) |
std::vector< std::vector< Interval > > | level_sets (D2< SBasis > const &f, std::vector< Rect > regions) |
std::vector< std::vector< Interval > > | level_sets (D2< SBasis > const &f, std::vector< Point > pts, double tol) |
template<typename C > | |
std::ostream & | operator<< (std::ostream &out, GenericInterval< C > const &I) |
template<typename C > | |
std::ostream & | operator<< (std::ostream &out, GenericOptInterval< C > const &I) |
template<typename C > | |
std::ostream & | operator<< (std::ostream &out, GenericRect< C > const &r) |
template<typename C > | |
std::ostream & | operator<< (std::ostream &out, GenericOptRect< C > const &r) |
std::optional< Geom::LineSegment > | rect_line_intersect (Geom::Rect &r, Geom::LineSegment ls) |
Determine whether & where an (infinite) line intersects a rectangle. | |
int | centroid (std::vector< Geom::Point > const &p, Geom::Point ¢roid, double &area) |
polyCentroid: Calculates the centroid (xCentroid, yCentroid) and area of a polygon, given its vertices (x[0], y[0]) ... (x[n-1], y[n-1]). | |
OptIntRect | operator& (IntRect const &a, IntRect const &b) |
OptIntRect | intersect (IntRect const &a, IntRect const &b) |
OptIntRect | intersect (OptIntRect const &a, OptIntRect const &b) |
IntRect | unify (IntRect const &a, IntRect const &b) |
OptIntRect | unify (OptIntRect const &a, OptIntRect const &b) |
std::ostream & | operator<< (std::ostream &os, PathIntersectionGraph const &pig) |
Format the PathIntersectionGraph for output. | |
template<typename A , typename B > | |
std::vector< Intersection< A, B > > | transpose (std::vector< Intersection< B, A > > const &in) |
template<typename T > | |
void | transpose_in_place (std::vector< Intersection< T, T > > &xs) |
Interval | unify (Interval const &a, Interval const &b) |
OptInterval | intersect (Interval const &a, Interval const &b) |
void | filter_line_segment_intersections (std::vector< ShapeIntersection > &xs, bool a=false, bool b=true) |
Removes intersections outside of the unit interval. | |
void | filter_ray_intersections (std::vector< ShapeIntersection > &xs, bool a=false, bool b=true) |
bool | are_near (Point const &p, Line const &line, double eps=EPSILON) |
bool | are_parallel (Line const &l1, Line const &l2, double eps=EPSILON) |
double | angle_between (Line const &l1, Line const &l2) |
double | distance (Point const &p, LineSegment const &seg) |
bool | are_near (Point const &p, LineSegment const &seg, double eps=EPSILON) |
Line | make_orthogonal_line (Point const &p, Line const &line) |
Line | make_parallel_line (Point const &p, Line const &line) |
Line | make_bisector_line (LineSegment const &_segment) |
Line | make_angle_bisector_line (Point const &A, Point const &O, Point const &B) |
Point | projection (Point const &p, Line const &line) |
LineSegment | projection (LineSegment const &seg, Line const &line) |
std::optional< LineSegment > | clip (Line const &l, Rect const &r) |
OptCrossing | intersection (Ray const &r1, Line const &l2) |
OptCrossing | intersection (Line const &l1, Ray const &r2) |
OptCrossing | intersection (LineSegment const &ls1, Line const &l2) |
OptCrossing | intersection (Line const &l1, LineSegment const &ls2) |
OptCrossing | intersection (LineSegment const &ls1, Ray const &r2) |
OptCrossing | intersection (Ray const &r1, LineSegment const &ls2) |
OptCrossing | intersection (Line const &l1, Line const &l2) |
OptCrossing | intersection (Ray const &r1, Ray const &r2) |
OptCrossing | intersection (LineSegment const &ls1, LineSegment const &ls2) |
Linear | reverse (Linear const &a) |
Linear | portion (Linear const &a, Coord from, Coord to) |
template<class T > | |
int | sgn (const T &x) |
Sign function - indicates the sign of a numeric type. | |
template<class T > | |
T | sqr (const T &x) |
template<class T > | |
T | cube (const T &x) |
template<class T > | |
const T & | between (const T &min, const T &max, const T &x) |
Between function - returns true if a number x is within a range: (min < x) && (max > x). | |
double | decimal_round (double x, int p) |
Returns x rounded to the nearest multiple of \(10^{p}\). | |
void | sincos (double angle, double &sin_, double &cos_) |
Simultaneously compute a sine and a cosine of the same angle. | |
template<size_t N> | |
int | rescale_homogenous (std::array< double, N > &values) |
Scale the doubles in the passed array to make them "reasonably large". | |
double | nearest_time (Point const &p, Point const &A, Point const &v) |
Coord | nearest_time (Point const &p, D2< Bezier > const &bez, Coord from=0, Coord to=1) |
double | nearest_time (Point const &p, D2< SBasis > const &c, D2< SBasis > const &deriv, double from=0, double to=1) |
double | nearest_time (Point const &p, D2< SBasis > const &c, double from=0, double to=1) |
std::vector< double > | all_nearest_times (Point const &p, D2< SBasis > const &c, D2< SBasis > const &dc, double from=0, double to=1) |
std::vector< double > | all_nearest_times (Point const &p, D2< SBasis > const &c, double from=0, double to=1) |
double | nearest_time (Point const &p, Piecewise< D2< SBasis > > const &c, double from, double to) |
double | nearest_time (Point const &p, Piecewise< D2< SBasis > > const &c) |
std::vector< double > | all_nearest_times (Point const &p, Piecewise< D2< SBasis > > const &c, double from, double to) |
std::vector< double > | all_nearest_times (Point const &p, Piecewise< D2< SBasis > > const &c) |
SBasis | chebyshev_approximant (double(*f)(double, void *), int order, Interval in, void *p=0) |
SBasis | chebyshev_approximant_interpolating (double(*f)(double, void *), int order, Interval in, void *p=0) |
SBasis | chebyshev (unsigned n) |
std::vector< SmashIntersection > | smash_intersect (D2< SBasis > const &a, D2< SBasis > const &b, double tol) |
std::vector< SmashIntersection > | monotonic_smash_intersect (D2< SBasis > const &a, D2< SBasis > const &b, double tol) |
std::vector< Interval > | monotonicSplit (D2< SBasis > const &p) |
template<typename T > | |
T | lerp (double t, T a, T b) |
template<typename T > | |
LinearOf< T > | reverse (LinearOf< T > const &a) |
template<typename T > | |
LinearOf< T > | operator+ (LinearOf< T > const &a, LinearOf< T > const &b) |
template<typename T > | |
LinearOf< T > | operator- (LinearOf< T > const &a, LinearOf< T > const &b) |
template<typename T > | |
LinearOf< T > & | operator+= (LinearOf< T > &a, LinearOf< T > const &b) |
template<typename T > | |
LinearOf< T > & | operator-= (LinearOf< T > &a, LinearOf< T > const &b) |
template<typename T > | |
LinearOf< T > | operator+ (LinearOf< T > const &a, double b) |
template<typename T > | |
LinearOf< T > | operator- (LinearOf< T > const &a, double b) |
template<typename T > | |
LinearOf< T > & | operator+= (LinearOf< T > &a, double b) |
template<typename T > | |
LinearOf< T > & | operator-= (LinearOf< T > &a, double b) |
template<typename T > | |
bool | operator== (LinearOf< T > const &a, LinearOf< T > const &b) |
template<typename T > | |
bool | operator!= (LinearOf< T > const &a, LinearOf< T > const &b) |
template<typename T > | |
LinearOf< T > | operator- (LinearOf< T > const &a) |
template<typename T > | |
LinearOf< T > | operator* (LinearOf< T > const &a, double b) |
template<typename T > | |
LinearOf< T > | operator/ (LinearOf< T > const &a, double b) |
template<typename T > | |
LinearOf< T > | operator*= (LinearOf< T > &a, double b) |
template<typename T > | |
LinearOf< T > | operator/= (LinearOf< T > &a, double b) |
double | lerpppp (double t, double a, double b) |
Linear | toLinear (LinearN< 1 > f) |
template<unsigned n> | |
LinearN< n > | operator+ (LinearN< n > const &a, LinearN< n > const &b) |
template<unsigned n> | |
LinearN< n > | operator- (LinearN< n > const &a, LinearN< n > const &b) |
template<unsigned n> | |
LinearN< n > & | operator+= (LinearN< n > &a, LinearN< n > const &b) |
template<unsigned n> | |
LinearN< n > & | operator-= (LinearN< n > &a, LinearN< n > const &b) |
template<unsigned n> | |
LinearN< n > | operator+ (LinearN< n > const &a, double b) |
template<unsigned n> | |
LinearN< n > | operator- (LinearN< n > const &a, double b) |
template<unsigned n> | |
LinearN< n > & | operator+= (LinearN< n > &a, double b) |
template<unsigned n> | |
LinearN< n > & | operator-= (LinearN< n > &a, double b) |
template<unsigned n> | |
bool | operator== (LinearN< n > const &a, LinearN< n > const &b) |
template<unsigned n> | |
bool | operator!= (LinearN< n > const &a, LinearN< n > const &b) |
template<unsigned n> | |
LinearN< n > | operator- (LinearN< n > const &a) |
template<unsigned n> | |
LinearN< n > | operator* (LinearN< n > const &a, double b) |
template<unsigned n> | |
LinearN< n > | operator/ (LinearN< n > const &a, double b) |
template<unsigned n> | |
LinearN< n > | operator*= (LinearN< n > &a, double b) |
template<unsigned n> | |
LinearN< n > | operator/= (LinearN< n > &a, double b) |
template<unsigned n> | |
void | setToVariable (LinearN< n > &x, unsigned k) |
template<unsigned n> | |
std::ostream & | operator<< (std::ostream &out_file, const LinearN< n > &bo) |
OptInterval | bounds_exact (SBasis const &a) |
OptInterval | bounds_fast (SBasis const &a, int order=0) |
OptInterval | bounds_local (SBasis const &a, const OptInterval &t, int order=0) |
std::vector< double > | roots (SBasis const &s) |
std::vector< std::vector< double > > | multi_roots (SBasis const &f, std::vector< double > const &levels, double htol=1e-7, double vtol=1e-7, double a=0, double b=1) |
template<typename T > | |
SBasisOf< T > | reverse (SBasisOf< T > const &a) |
template<typename T > | |
SBasisOf< T > | operator- (const SBasisOf< T > &p) |
template<typename T > | |
SBasisOf< T > | operator* (SBasisOf< T > const &a, double k) |
template<typename T > | |
SBasisOf< T > | operator* (double k, SBasisOf< T > const &a) |
template<typename T > | |
SBasisOf< T > | operator/ (SBasisOf< T > const &a, double k) |
template<typename T > | |
SBasisOf< T > & | operator*= (SBasisOf< T > &a, double b) |
template<typename T > | |
SBasisOf< T > & | operator/= (SBasisOf< T > &a, double b) |
template<typename T > | |
SBasisOf< T > | operator+ (const SBasisOf< T > &a, const SBasisOf< T > &b) |
template<typename T > | |
SBasisOf< T > | operator- (const SBasisOf< T > &a, const SBasisOf< T > &b) |
template<typename T > | |
SBasisOf< T > & | operator+= (SBasisOf< T > &a, const SBasisOf< T > &b) |
template<typename T > | |
SBasisOf< T > & | operator-= (SBasisOf< T > &a, const SBasisOf< T > &b) |
template<typename T > | |
SBasisOf< T > | operator+ (const SBasisOf< T > &a, LinearOf< T > const &b) |
template<typename T > | |
SBasisOf< T > | operator- (const SBasisOf< T > &a, LinearOf< T > const &b) |
template<typename T > | |
SBasisOf< T > & | operator+= (SBasisOf< T > &a, const LinearOf< T > &b) |
template<typename T > | |
SBasisOf< T > & | operator-= (SBasisOf< T > &a, const LinearOf< T > &b) |
template<typename T > | |
SBasisOf< T > | operator+ (const SBasisOf< T > &a, T b) |
template<typename T > | |
SBasisOf< T > | operator- (const SBasisOf< T > &a, T b) |
template<typename T > | |
SBasisOf< T > & | operator+= (SBasisOf< T > &a, T b) |
template<typename T > | |
SBasisOf< T > & | operator-= (SBasisOf< T > &a, T b) |
template<typename T > | |
SBasisOf< T > | shift (SBasisOf< T > const &a, int sh) |
template<typename T > | |
SBasisOf< T > | shift (LinearOf< T > const &a, int sh) |
template<typename T > | |
SBasisOf< T > | truncate (SBasisOf< T > const &a, unsigned terms) |
template<typename T > | |
SBasisOf< T > | multiply_add (SBasisOf< T > const &a, SBasisOf< T > const &b, SBasisOf< T > c) |
template<typename T > | |
SBasisOf< T > | multiply (SBasisOf< T > const &a, SBasisOf< T > const &b) |
template<typename T > | |
SBasisOf< T > | integral (SBasisOf< T > const &c) |
template<typename T > | |
SBasisOf< T > | derivative (SBasisOf< T > const &a) |
template<typename T > | |
SBasisOf< T > | operator* (SBasisOf< T > const &a, SBasisOf< T > const &b) |
template<typename T > | |
SBasisOf< T > & | operator*= (SBasisOf< T > &a, SBasisOf< T > const &b) |
template<typename T > | |
SBasisOf< T > | compose (SBasisOf< T > const &a, SBasisOf< T > const &b) |
template<typename T > | |
SBasisOf< T > | compose (SBasisOf< T > const &a, SBasisOf< T > const &b, unsigned k) |
template<typename T > | |
SBasisOf< T > | compose (LinearOf< T > const &a, SBasisOf< T > const &b) |
template<typename T > | |
SBasisOf< T > | compose (SBasisOf< T > const &a, LinearOf< T > const &b) |
template<typename T > | |
SBasisOf< T > | compose (LinearOf< T > const &a, LinearOf< T > const &b) |
template<typename T > | |
SBasisOf< T > | portion (const SBasisOf< T > &t, double from, double to) |
template<typename T > | |
std::ostream & | operator<< (std::ostream &out_file, const LinearOf< T > &bo) |
template<typename T > | |
std::ostream & | operator<< (std::ostream &out_file, const SBasisOf< T > &p) |
template<unsigned n> | |
MultiDegree< n > | max (MultiDegree< n > const &p, MultiDegree< n > const &q) |
Returns the maximal degree appearing in the two arguments for each variables. | |
template<unsigned n> | |
MultiDegree< n > | operator+ (MultiDegree< n > const &p, MultiDegree< n > const &q) |
template<unsigned n> | |
MultiDegree< n > | operator+= (MultiDegree< n > const &p, MultiDegree< n > const &q) |
template<unsigned n> | |
bool | operator<= (MultiDegree< n > const &p, MultiDegree< n > const &q) |
MultiDegree comparison. | |
SBasis | toSBasis (SBasisN< 1 > f) |
template<unsigned n> | |
SBasisN< n > | operator- (const SBasisN< n > &p) |
Returns a function which reverses the domain of a. | |
template<unsigned n> | |
SBasisN< n > | operator* (SBasisN< n > const &a, double c) |
template<unsigned n> | |
SBasisN< n > | operator* (double k, SBasisN< n > const &a) |
template<unsigned n> | |
SBasisN< n > | operator/ (SBasisN< n > const &a, double k) |
template<unsigned n> | |
SBasisN< n > & | operator*= (SBasisN< n > &a, double c) |
template<unsigned n> | |
SBasisN< n > & | operator/= (SBasisN< n > &a, double b) |
template<unsigned n> | |
SBasisN< n > | operator+ (const SBasisN< n > &a, const SBasisN< n > &b) |
template<unsigned n> | |
SBasisN< n > | operator- (const SBasisN< n > &a, const SBasisN< n > &b) |
template<unsigned n> | |
SBasisN< n > & | operator+= (SBasisN< n > &a, const SBasisN< n > &b) |
template<unsigned n> | |
SBasisN< n > & | operator-= (SBasisN< n > &a, const SBasisN< n > &b) |
template<unsigned n> | |
SBasisN< n > | operator+ (const SBasisN< n > &a, LinearN< n > const &b) |
template<unsigned n> | |
SBasisN< n > | operator- (const SBasisN< n > &a, LinearN< n > const &b) |
template<unsigned n> | |
SBasisN< n > & | operator+= (SBasisN< n > &a, const LinearN< n > &b) |
template<unsigned n> | |
SBasisN< n > & | operator-= (SBasisN< n > &a, const LinearN< n > &b) |
template<unsigned n> | |
SBasisN< n > | operator+ (const SBasisN< n > &a, double b) |
template<unsigned n> | |
SBasisN< n > | operator- (const SBasisN< n > &a, double b) |
template<unsigned n> | |
SBasisN< n > & | operator+= (SBasisN< n > &a, double b) |
template<unsigned n> | |
SBasisN< n > & | operator-= (SBasisN< n > &a, double b) |
template<unsigned n> | |
SBasisN< n > | shift (SBasisN< n > const &a, MultiDegree< n > sh) |
template<unsigned n> | |
SBasisN< n > | shift (LinearN< n > const &a, MultiDegree< n > sh) |
template<unsigned n> | |
SBasisN< n > | shift (LinearN< n > const &a, unsigned sh, unsigned var) |
template<unsigned n> | |
SBasisN< n > | truncate (SBasisN< n > const &a, unsigned first_size) |
template<unsigned n> | |
SBasisN< n > | multiply (SBasisN< n > const &a, SBasisN< n > const &b) |
template<unsigned n> | |
SBasisN< n > | operator* (SBasisN< n > const &a, SBasisN< n > const &b) |
template<unsigned n> | |
SBasisN< n > & | operator*= (SBasisN< n > &a, SBasisN< n > const &b) |
template<unsigned m, unsigned n> | |
SBasisN< m > | compose (LinearN< n > const &f, std::vector< SBasisN< m > > const &t, unsigned fixed=0, unsigned flags=0) |
template<unsigned m, unsigned n> | |
SBasisN< m > | compose (SBasisN< n > const &f, std::vector< SBasisN< m > > const &t, unsigned const k=0, unsigned const idx=0) |
template<unsigned n> | |
std::ostream & | operator<< (std::ostream &out_file, const MultiDegree< n > &d) |
template<unsigned n> | |
std::ostream & | operator<< (std::ostream &out_file, const SBasisN< n > &p) |
template<unsigned n> | |
SBasisN< n > | multiply_add (SBasisN< n > const &a, SBasisN< n > const &b, SBasisN< n > c) |
template<unsigned n> | |
SBasisN< n > | integral (SBasisN< n > const &c) |
template<unsigned n> | |
SBasisN< n > | derivative (SBasisN< n > const &a) |
template<unsigned n> | |
SBasisN< n > | sqrt (SBasisN< n > const &a, int k) |
template<unsigned n> | |
SBasisN< n > | reciprocal (LinearN< n > const &a, int k) |
template<unsigned n> | |
SBasisN< n > | divide (SBasisN< n > const &a, SBasisN< n > const &b, int k) |
template<unsigned n> | |
unsigned | valuation (SBasisN< n > const &a, double tol=0) |
Returns the degree of the first non zero coefficient. | |
template<unsigned n> | |
SBasisN< n > | compose (SBasisN< n > const &a, SBasisN< n > const &b) |
template<unsigned n> | |
SBasisN< n > | compose (SBasisN< n > const &a, SBasisN< n > const &b, unsigned k) |
template<unsigned n> | |
SBasisN< n > | inverse (SBasisN< n > a, int k) |
template<unsigned n> | |
SBasisN< n > | compose_inverse (SBasisN< n > const &f, SBasisN< n > const &g, unsigned order=2, double tol=1e-3) |
template<unsigned n> | |
SBasisN< n > | portion (const SBasisN< n > &t, double from, double to) |
Returns the sbasis on domain [0,1] that was t on [from, to]. | |
template<unsigned n> | |
SBasisN< n > | sin (LinearN< n > bo, int k) |
template<unsigned n> | |
SBasisN< n > | cos (LinearN< n > bo, int k) |
template<unsigned n> | |
std::vector< double > | roots (SBasisN< n > const &s) |
template<unsigned n> | |
std::vector< std::vector< double > > | multi_roots (SBasisN< n > const &f, std::vector< double > const &levels, double htol=1e-7, double vtol=1e-7, double a=0, double b=1) |
int | winding (Path const &path, Point const &p) |
Compute winding number of the path at the specified point. | |
bool | path_direction (Path const &p) |
This function should only be applied to simple paths (regions), as otherwise a boolean winding direction is undefined. | |
bool | contains (Path const &p, Point const &i, bool evenodd=true) |
template<typename T > | |
Crossings | curve_sweep (Path const &a, Path const &b) |
Crossings | pair_intersect (Curve const &A, Interval const &Ad, Curve const &B, Interval const &Bd) |
Crossings | mono_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. | |
CrossingSet | crossings_among (PathVector const &p) |
Crossings | self_crossings (Path const &a) |
Crossings | crossings (Curve const &a, Curve const &b) |
Crossings | crossings (Path const &a, Path const &b) |
CrossingSet | crossings (PathVector const &a, PathVector const &b) |
std::ostream & | operator<< (std::ostream &os, PathTime const &pos) |
Piecewise< D2< SBasis > > | paths_to_pw (PathVector const &paths) |
Coord | nearest_time (Point const &p, Path const &c) |
bool | are_near (Path const &a, Path const &b, Coord precision=EPSILON) |
PathIntersection | parting_point (Path const &first, Path const &second, Coord precision=EPSILON) |
Find the first point where two paths diverge away from one another. | |
std::ostream & | operator<< (std::ostream &out, Path const &path) |
std::ostream & | operator<< (std::ostream &os, PathVectorTime const &pvt) |
OptRect | bounds_fast (PathVector const &pv) |
OptRect | bounds_exact (PathVector const &pv) |
std::ostream & | operator<< (std::ostream &out, PathVector const &pv) |
template<typename T > | |
Piecewise< T > | operator- (Piecewise< T > const &a, typename T::output_type b) |
template<typename T > | |
Piecewise< T > & | operator+= (Piecewise< T > &a, typename T::output_type b) |
template<typename T > | |
Piecewise< T > & | operator-= (Piecewise< T > &a, typename T::output_type b) |
template<typename T > | |
Piecewise< T > & | operator*= (Piecewise< T > &a, double b) |
template<typename T > | |
Piecewise< T > & | operator/= (Piecewise< T > &a, double b) |
template<typename T > | |
Piecewise< T > & | operator+= (Piecewise< T > &a, Piecewise< T > const &b) |
template<typename T > | |
Piecewise< T > & | operator-= (Piecewise< T > &a, Piecewise< T > const &b) |
Piecewise< SBasis > | divide (Piecewise< SBasis > const &a, Piecewise< SBasis > const &b, unsigned k) |
Piecewise< SBasis > | divide (Piecewise< SBasis > const &a, Piecewise< SBasis > const &b, double tol, unsigned k, double zero=1.e-3) |
Piecewise< SBasis > | divide (SBasis const &a, Piecewise< SBasis > const &b, double tol, unsigned k, double zero=1.e-3) |
Piecewise< SBasis > | divide (Piecewise< SBasis > const &a, SBasis const &b, double tol, unsigned k, double zero=1.e-3) |
Piecewise< SBasis > | divide (SBasis const &a, SBasis const &b, double tol, unsigned k, double zero=1.e-3) |
std::map< double, unsigned > | compose_pullback (std::vector< double > const &cuts, SBasis const &g) |
int | compose_findSegIdx (std::map< double, unsigned >::iterator const &cut, std::map< double, unsigned >::iterator const &next, std::vector< double > const &levels, SBasis const &g) |
std::vector< double > | roots (Piecewise< SBasis > const &f) |
std::vector< std::vector< double > > | multi_roots (Piecewise< SBasis > const &f, std::vector< double > const &values) |
std::vector< Interval > | level_set (Piecewise< SBasis > const &f, Interval const &level, double tol=1e-5) |
std::vector< Interval > | level_set (Piecewise< SBasis > const &f, double v, double vtol, double tol=1e-5) |
bool | are_near_rel (Point const &a, Point const &b, double eps=EPSILON) |
Test whether the relative distance between two points is less than some threshold. | |
Point | unit_vector (Point const &a) |
Coord | L1 (Point const &p) |
Coord | LInfty (Point const &p) |
bool | is_zero (Point const &p) |
bool | is_unit_vector (Point const &p, Coord eps=EPSILON) |
double | atan2 (Point const &p) |
double | angle_between (Point const &a, Point const &b) |
Point | abs (Point const &b) |
Point | constrain_angle (Point const &A, Point const &B, unsigned n=4, Point const &dir={1, 0}) |
Poly | operator* (double a, Poly const &b) |
Poly | integral (Poly const &p) |
Poly | derivative (Poly const &p) |
Poly | divide_out_root (Poly const &p, double x) |
Poly | compose (Poly const &a, Poly const &b) |
Poly | divide (Poly const &a, Poly const &b, Poly &r) |
Poly | gcd (Poly const &a, Poly const &b, const double tol=1e-10) |
std::vector< std::complex< double > > | solve (const Poly &p) |
std::vector< double > | solve_reals (const Poly &p) |
double | polish_root (Poly const &p, double guess, double tol) |
std::vector< Coord > | solve_quadratic (Coord a, Coord b, Coord c) |
Analytically solve quadratic equation. | |
std::vector< Coord > | solve_cubic (Coord a, Coord b, Coord c, Coord d) |
Analytically solve cubic equation. | |
std::vector< Coord > | solve_quartic (Coord a, Coord b, Coord c, Coord d, Coord e) |
Analytically solve quartic equation. | |
std::ostream & | operator<< (std::ostream &out_file, const Poly &in_poly) |
double | distance (Point const &_point, Ray const &_ray) |
bool | are_near (Point const &_point, Ray const &_ray, double eps=EPSILON) |
bool | are_same (Ray const &r1, Ray const &r2, double eps=EPSILON) |
double | angle_between (Ray const &r1, Ray const &r2, bool cw=true) |
Ray | make_angle_bisector_ray (Ray const &r1, Ray const &r2, bool cw=true) |
Returns the angle bisector for the two given rays. | |
Point | align_factors (Align align) |
Convert an align specification to coordinate fractions. | |
Coord | distanceSq (Point const &p, Rect const &rect) |
Coord | distance (Point const &p, Rect const &rect) |
Coord | distanceSq (Point const &p, OptRect const &rect) |
Minimum square of distance to rectangle, or infinity if empty. | |
Coord | distance (Point const &p, OptRect const &rect) |
Minimum distance to rectangle, or infinity if empty. | |
OptRect | operator& (Rect const &a, Rect const &b) |
OptRect | intersect (Rect const &a, Rect const &b) |
OptRect | intersect (OptRect const &a, OptRect const &b) |
Rect | unify (Rect const &a, Rect const &b) |
OptRect | unify (OptRect const &a, OptRect const &b) |
Rect | union_list (std::vector< Rect > const &r) |
Union a list of rectangles. | |
Linear | extract_u (Linear2d const &a, double u) |
Linear | extract_v (Linear2d const &a, double v) |
Linear2d | operator- (Linear2d const &a) |
Linear2d | operator+ (Linear2d const &a, Linear2d const &b) |
Linear2d | operator- (Linear2d const &a, Linear2d const &b) |
Linear2d & | operator+= (Linear2d &a, Linear2d const &b) |
Linear2d & | operator-= (Linear2d &a, Linear2d const &b) |
Linear2d & | operator*= (Linear2d &a, double b) |
bool | operator== (Linear2d const &a, Linear2d const &b) |
bool | operator!= (Linear2d const &a, Linear2d const &b) |
Linear2d | operator* (double const a, Linear2d const &b) |
SBasis2d | operator- (const SBasis2d &p) |
SBasis2d | operator+ (const SBasis2d &a, const SBasis2d &b) |
SBasis2d | operator- (const SBasis2d &a, const SBasis2d &b) |
SBasis2d & | operator+= (SBasis2d &a, const Linear2d &b) |
SBasis2d & | operator-= (SBasis2d &a, const Linear2d &b) |
SBasis2d & | operator+= (SBasis2d &a, double b) |
SBasis2d & | operator-= (SBasis2d &a, double b) |
SBasis2d & | operator*= (SBasis2d &a, double b) |
SBasis2d & | operator/= (SBasis2d &a, double b) |
SBasis2d | operator* (double k, SBasis2d const &a) |
SBasis2d | operator* (SBasis2d const &a, SBasis2d const &b) |
SBasis2d | shift (SBasis2d const &a, int sh) |
SBasis2d | shift (Linear2d const &a, int sh) |
SBasis2d | truncate (SBasis2d const &a, unsigned terms) |
SBasis2d | multiply (SBasis2d const &a, SBasis2d const &b) |
SBasis2d | integral (SBasis2d const &c) |
SBasis2d | partial_derivative (SBasis2d const &a, int dim) |
SBasis2d | sqrt (SBasis2d const &a, int k) |
SBasis2d | reciprocal (Linear2d const &a, int k) |
SBasis2d | divide (SBasis2d const &a, SBasis2d const &b, int k) |
SBasis2d | compose (SBasis2d const &a, SBasis2d const &b) |
SBasis2d | compose (SBasis2d const &a, SBasis2d const &b, unsigned k) |
SBasis2d | inverse (SBasis2d const &a, int k) |
SBasis | extract_u (SBasis2d const &a, double u) |
SBasis | extract_v (SBasis2d const &a, double v) |
SBasis | compose (Linear2d const &a, D2< SBasis > const &p) |
SBasis | compose (SBasis2d const &fg, D2< SBasis > const &p) |
D2< SBasis > | compose_each (D2< SBasis2d > const &fg, D2< SBasis > const &p) |
std::ostream & | operator<< (std::ostream &out_file, const Linear2d &bo) |
std::ostream & | operator<< (std::ostream &out_file, const SBasis2d &p) |
D2< SBasis > | sb2dsolve (SBasis2d const &f, Geom::Point const &A, Geom::Point const &B, unsigned degmax) |
Finds a path which traces the 0 contour of f, traversing from A to B as a single d2<sbasis>. | |
D2< SBasis > | sb2d_cubic_solve (SBasis2d const &f, Geom::Point const &A, Geom::Point const &B) |
Finds a path which traces the 0 contour of f, traversing from A to B as a single cubic d2<sbasis>. | |
Piecewise< D2< SBasis > > | cutAtRoots (Piecewise< D2< SBasis > > const &M, double tol=1e-4) |
Piecewise< SBasis > | atan2 (D2< SBasis > const &vect, double tol=.01, unsigned order=3) |
Piecewise< SBasis > | atan2 (Piecewise< D2< SBasis > >const &vect, double tol=.01, unsigned order=3) |
D2< Piecewise< SBasis > > | tan2 (SBasis const &angle, double tol=.01, unsigned order=3) |
D2< Piecewise< SBasis > > | tan2 (Piecewise< SBasis > const &angle, double tol=.01, unsigned order=3) |
Piecewise< D2< SBasis > > | unitVector (D2< SBasis > const &vect, double tol=.01, unsigned order=3) |
Piecewise< D2< SBasis > > | unitVector (Piecewise< D2< SBasis > > const &vect, double tol=.01, unsigned order=3) |
Piecewise< SBasis > | curvature (D2< SBasis > const &M, double tol=.01) |
Piecewise< SBasis > | curvature (Piecewise< D2< SBasis > > const &M, double tol=.01) |
Piecewise< SBasis > | arcLengthSb (D2< SBasis > const &M, double tol=.01) |
Piecewise< SBasis > | arcLengthSb (Piecewise< D2< SBasis > > const &M, double tol=.01) |
double | length (D2< SBasis > const &M, double tol=.01) |
double | length (Piecewise< D2< SBasis > > const &M, double tol=.01) |
void | length_integrating (D2< SBasis > const &B, double &result, double &abs_error, double tol) |
Piecewise< D2< SBasis > > | arc_length_parametrization (D2< SBasis > const &M, unsigned order=3, double tol=.01) |
Piecewise< D2< SBasis > > | arc_length_parametrization (Piecewise< D2< SBasis > > const &M, unsigned order=3, double tol=.01) |
unsigned | centroid (Piecewise< D2< SBasis > > const &p, Point ¢roid, double &area) |
std::vector< D2< SBasis > > | cubics_fitting_curvature (Point const &M0, Point const &M1, Point const &dM0, Point const &dM1, double d2M0xdM0, double d2M1xdM1, int insist_on_speed_signs=1, double epsilon=1e-5) |
std::vector< D2< SBasis > > | cubics_fitting_curvature (Point const &M0, Point const &M1, Point const &dM0, Point const &dM1, Point const &d2M0, Point const &d2M1, int insist_on_speed_signs=1, double epsilon=1e-5) |
std::vector< D2< SBasis > > | cubics_with_prescribed_curvature (Point const &M0, Point const &M1, Point const &dM0, Point const &dM1, double k0, double k1, int insist_on_speed_signs=1, double error=1e-5) |
std::vector< double > | find_tangents (Point P, D2< SBasis > const &A) |
std::vector< double > | find_tangents_by_vector (Point V, D2< SBasis > const &A) |
std::vector< double > | find_normals (Point P, D2< SBasis > const &A) |
std::vector< double > | find_normals_by_vector (Point V, D2< SBasis > const &A) |
Piecewise< SBasis > | abs (SBasis const &f) |
Return the absolute value of a function pointwise. | |
Piecewise< SBasis > | abs (Piecewise< SBasis > const &f) |
Return the absolute value of a function pointwise. | |
Piecewise< SBasis > | max (SBasis const &f, SBasis const &g) |
Return the greater of the two functions pointwise. | |
Piecewise< SBasis > | max (Piecewise< SBasis > const &f, SBasis const &g) |
Return the greater of the two functions pointwise. | |
Piecewise< SBasis > | max (SBasis const &f, Piecewise< SBasis > const &g) |
Return the greater of the two functions pointwise. | |
Piecewise< SBasis > | max (Piecewise< SBasis > const &f, Piecewise< SBasis > const &g) |
Return the greater of the two functions pointwise. | |
Piecewise< SBasis > | min (SBasis const &f, SBasis const &g) |
Return the more negative of the two functions pointwise. | |
Piecewise< SBasis > | min (Piecewise< SBasis > const &f, SBasis const &g) |
Return the more negative of the two functions pointwise. | |
Piecewise< SBasis > | min (SBasis const &f, Piecewise< SBasis > const &g) |
Return the more negative of the two functions pointwise. | |
Piecewise< SBasis > | min (Piecewise< SBasis > const &f, Piecewise< SBasis > const &g) |
Return the more negative of the two functions pointwise. | |
Piecewise< SBasis > | signSb (SBasis const &f) |
Return the sign of the two functions pointwise. | |
Piecewise< SBasis > | signSb (Piecewise< SBasis > const &f) |
Return the sign of the two functions pointwise. | |
Piecewise< SBasis > | sqrt (SBasis const &f, double tol, int order) |
Compute the sqrt of a function. | |
Piecewise< SBasis > | sqrt (Piecewise< SBasis > const &f, double tol, int order) |
Compute the sqrt of a function. | |
Piecewise< SBasis > | cos (SBasis const &f, double tol, int order) |
Compute the cosine of a function. | |
Piecewise< SBasis > | cos (Piecewise< SBasis > const &f, double tol, int order) |
Compute the cosine of a function. | |
Piecewise< SBasis > | sin (SBasis const &f, double tol, int order) |
Compute the sine of a function. | |
Piecewise< SBasis > | sin (Piecewise< SBasis > const &f, double tol, int order) |
Compute the sine of a function. | |
Piecewise< SBasis > | log (SBasis const &f, double tol=1e-3, int order=3) |
Piecewise< SBasis > | log (Piecewise< SBasis >const &f, double tol=1e-3, int order=3) |
Piecewise< SBasis > | reciprocalOnDomain (Interval range, double tol=1e-3) |
Piecewise< SBasis > | reciprocal (SBasis const &f, double tol=1e-3, int order=3) |
Piecewise< SBasis > | reciprocal (Piecewise< SBasis >const &f, double tol=1e-3, int order=3) |
Piecewise< SBasis > | interpolate (std::vector< double > times, std::vector< double > values, unsigned smoothness) |
Returns a Piecewise SBasis with prescribed values at prescribed times. | |
SBasis | poly_to_sbasis (Poly const &p) |
Changes the basis of p to be sbasis. | |
Poly | sbasis_to_poly (SBasis const &sb) |
Changes the basis of p to be monomial. | |
void | sbasis_to_bezier (Bezier &bz, SBasis const &sb, size_t sz) |
Changes the basis of p to be bernstein. | |
void | sbasis_to_bezier (D2< Bezier > &bz, D2< SBasis > const &sb, size_t sz=0) |
void | sbasis_to_bezier (std::vector< Point > &bz, D2< SBasis > const &sb, size_t sz) |
Changes the basis of p to be Bernstein. | |
void | sbasis_to_cubic_bezier (std::vector< Point > &bz, D2< SBasis > const &sb) |
Changes the basis of p to be Bernstein. | |
void | bezier_to_sbasis (D2< SBasis > &sb, std::vector< Point > const &bz) |
Changes the basis of d2 p to be sbasis. | |
void | build_from_sbasis (Geom::PathBuilder &pb, D2< SBasis > const &B, double tol, bool only_cubicbeziers) |
Make a path from a d2 sbasis. | |
Bezier | sbasis_to_bezier (SBasis const &B, unsigned q=0) |
SBasis | bezier_to_sbasis (Bezier const &B) |
std::vector< Geom::Point > | sbasis_to_bezier (D2< SBasis > const &B, unsigned q=0) |
PathVector | path_from_piecewise (Geom::Piecewise< Geom::D2< Geom::SBasis > > const &B, double tol, bool only_cubicbeziers) |
Make a path from a d2 sbasis. | |
Path | path_from_sbasis (D2< SBasis > const &B, double tol, bool only_cubicbeziers) |
Make a path from a d2 sbasis. | |
Path | cubicbezierpath_from_sbasis (D2< SBasis > const &B, double tol) |
SBasis | operator- (const SBasis &p) |
SBasis | operator* (SBasis const &a, double k) |
Compute the pointwise product of a and b (Exact) | |
SBasis | operator* (double k, SBasis const &a) |
SBasis | operator/ (SBasis const &a, double k) |
SBasis & | operator*= (SBasis &a, double b) |
Compute the pointwise product of a and b and store the value in a (Exact) | |
SBasis & | operator/= (SBasis &a, double b) |
SBasis | operator+ (const SBasis &a, const SBasis &b) |
Compute the pointwise sum of a and b (Exact) | |
SBasis | operator- (const SBasis &a, const SBasis &b) |
Compute the pointwise difference of a and b (Exact) | |
SBasis & | operator+= (SBasis &a, const SBasis &b) |
Compute the pointwise sum of a and b and store in a (Exact) | |
SBasis & | operator-= (SBasis &a, const SBasis &b) |
Compute the pointwise difference of a and b and store in a (Exact) | |
SBasis | operator+ (const SBasis &a, double b) |
SBasis | operator- (const SBasis &a, double b) |
SBasis & | operator+= (SBasis &a, double b) |
SBasis & | operator-= (SBasis &a, double b) |
SBasis | shift (SBasis const &a, int sh) |
multiply a by x^sh in place (Exact) | |
SBasis | shift (Linear const &a, int sh) |
multiply a by x^sh (Exact) | |
SBasis | truncate (SBasis const &a, unsigned terms) |
SBasis | multiply (SBasis const &a, SBasis const &b) |
Compute the pointwise product of a and b (Exact) | |
SBasis | multiply_add (SBasis const &a, SBasis const &b, SBasis c) |
Compute the pointwise product of a and b adding c (Exact) | |
SBasis | integral (SBasis const &c) |
Compute the integral of a (Exact) | |
SBasis | derivative (SBasis const &a) |
Compute the derivative of a (Exact) | |
SBasis | sqrt (SBasis const &a, int k) |
Compute the sqrt of a. | |
SBasis | reciprocal (Linear const &a, int k) |
Compute the recpirocal of a. | |
SBasis | divide (SBasis const &a, SBasis const &b, int k) |
Compute a / b to k terms. | |
SBasis | operator* (SBasis const &a, SBasis const &b) |
SBasis & | operator*= (SBasis &a, SBasis const &b) |
SBasis | compose (SBasis const &a, SBasis const &b) |
Compute a composed with b. | |
SBasis | compose (SBasis const &a, SBasis const &b, unsigned k) |
Compute a composed with b to k terms. | |
SBasis | inverse (SBasis a, int k) |
find the function a^-1 such that a^-1 composed with a to k terms is the identity function | |
SBasis | compose_inverse (SBasis const &f, SBasis const &g, unsigned order, double zero) |
compute fog^-1. | |
SBasis | portion (const SBasis &t, Interval const &ivl) |
std::ostream & | operator<< (std::ostream &out_file, const Linear &bo) |
std::ostream & | operator<< (std::ostream &out_file, const SBasis &p) |
SBasis | sin (Linear b, int k) |
Compute the sine of a to k terms. | |
SBasis | cos (Linear bo, int k) |
Compute the cosine of a. | |
std::vector< double > | roots (SBasis const &s, Interval const inside) |
std::vector< Interval > | level_set (SBasis const &f, double level, double vtol=1e-5, double a=0., double b=1., double tol=1e-5) |
Solve f(t) = v +/- tolerance. | |
std::vector< Interval > | level_set (SBasis const &f, Interval const &level, double a=0., double b=1., double tol=1e-5) |
Solve f(t)\in I=[u,v], which defines a collection of intervals (J_k). | |
std::vector< std::vector< Interval > > | level_sets (SBasis const &f, std::vector< double > const &levels, double a=0., double b=1., double vtol=1e-5, double tol=1e-5) |
'Solve' f(t) = v +/- tolerance for several values of v at once. | |
std::vector< std::vector< Interval > > | level_sets (SBasis const &f, std::vector< Interval > const &levels, double a=0., double b=1., double tol=1e-5) |
'Solve' f(t)\in I=[u,v] for several intervals I at once. | |
unsigned | crossing_count (Geom::Point const *V, unsigned degree) |
void | find_parametric_bezier_roots (Geom::Point const *w, unsigned degree, std::vector< double > &solutions, unsigned depth) |
unsigned | crossing_count (double const *V, unsigned degree, double left_t, double right_t) |
void | find_bernstein_roots (double const *w, unsigned degree, std::vector< double > &solutions, unsigned depth, double left_t=0, double right_t=1, bool use_secant=true) |
void | parse_svg_path (char const *str, PathSink &sink) |
Feed SVG path data to the specified sink. | |
void | parse_svg_path (std::string const &str, PathSink &sink) |
Feed SVG path data to the specified sink. | |
void | parse_svg_path_file (FILE *fi, PathSink &sink) |
Feed SVG path data from a C stream to the specified sink. | |
PathVector | parse_svg_path (char const *str) |
Create path vector from SVG path data stored in a C string. | |
PathVector | read_svgd_f (FILE *fi) |
Create path vector from a C stream with SVG path data. | |
PathVector | read_svgd (char const *filename) |
Create path vector from SVG path data stored in a file. | |
std::string | write_svg_path (PathVector const &pv, int prec=-1, bool optimize=false, bool shorthands=true) |
std::vector< std::vector< unsigned > > | sweep_bounds (std::vector< Rect > rs, Dim2 d) |
Make a list of pairs of self intersections in a list of Rects. | |
std::vector< std::vector< unsigned > > | sweep_bounds (std::vector< Rect > a, std::vector< Rect > b, Dim2 d) |
Make a list of pairs of red-blue intersections between two lists of Rects. | |
template<typename T > | |
T | pow (T const &t, int n) |
Integer exponentiation for transforms. | |
bool | are_near (Translate const &a, Translate const &b, Coord eps=EPSILON) |
bool | are_near (Scale const &a, Scale const &b, Coord eps=EPSILON) |
bool | are_near (Rotate const &a, Rotate const &b, Coord eps=EPSILON) |
bool | are_near (HShear const &a, HShear const &b, Coord eps=EPSILON) |
bool | are_near (VShear const &a, VShear const &b, Coord eps=EPSILON) |
bool | are_near (Zoom const &a, Zoom const &b, Coord eps=EPSILON) |
Affine | reflection (Point const &vector, Point const &origin) |
Reflects objects about line. | |
void | binomial_coefficients (std::vector< size_t > &bc, std::size_t n) |
template<typename Iter , typename Container > | |
Iter | cyclic_next (Iter i, Container &c) |
Get the next iterator in the container with wrap-around. | |
template<typename Iter , typename Container > | |
Iter | cyclic_prior (Iter i, Container &c) |
Get the previous iterator in the container with wrap-around. | |
void | split (vector< Point > const &p, double t, vector< Point > &left, vector< Point > &right) |
static int | intersect_polish_f (const gsl_vector *x, void *params, gsl_vector *f) |
static double | EpsilonBy (double value, int eps) |
static void | intersect_polish_root (D2< SBasis > const &A, double &s, D2< SBasis > const &B, double &t) |
template<unsigned degree> | |
static std::vector< CurveIntersection > | bezier_line_intersections (BezierCurveN< degree > const &curve, Line const &line) |
Find intersections of a low-degree Bézier curve with a line segment. | |
static void | bezier_expand_to_image (Rect &range, Point const &x0, Point const &x1, Point const &x2) |
static void | bezier_expand_to_image (Rect &range, Point const &x0, Point const &x1, Point const &x2, Point const &x3) |
static Coord | bezier_length_internal (std::vector< Point > &v1, Coord tolerance, int level) |
static Coord | bezier_length_internal (Point a0, Point a1, Point a2, Coord tolerance, int level) |
static Coord | bezier_length_internal (Point a0, Point a1, Point a2, Point a3, Coord tolerance, int level) |
static void | generate_bezier (Point bezier[], Point const data[], double const u[], unsigned const len, Point const &tHat1, Point const &tHat2, double const tolerance_sq) |
Fill in bezier[] based on the given data and tangent requirements, using a least-squares fit. | |
static void | estimate_lengths (Point bezier[], Point const data[], double const u[], unsigned len, Point const &tHat1, Point const &tHat2) |
static void | estimate_bi (Point b[4], unsigned ei, Point const data[], double const u[], unsigned len) |
static void | reparameterize (Point const d[], unsigned const len, double u[], Point const bezCurve[]) |
Given set of points and their parameterization, try to find a better assignment of parameter values for the points. | |
static double | NewtonRaphsonRootFind (Point const Q[], Point const &P, double const u) |
Use Newton-Raphson iteration to find better root. | |
static Point | darray_center_tangent (Point const d[], unsigned const center, unsigned const len) |
Estimates the (backward) tangent at d[center], by averaging the two segments connected to d[center] (and then normalizing the result). | |
static Point | darray_right_tangent (Point const d[], unsigned const len) |
Estimates the (backward) tangent at d[last - 0.5]. | |
static unsigned | copy_without_nans_or_adjacent_duplicates (Point const src[], unsigned src_len, Point dest[]) |
Copy points from src to dest, filter out points containing NaN and adjacent points with equal x and y. | |
static void | chord_length_parameterize (Point const d[], double u[], unsigned const len) |
Assign parameter values to digitized points using relative distances between points. | |
static double | compute_max_error_ratio (Point const d[], double const u[], unsigned const len, Point const bezCurve[], double const tolerance, unsigned *const splitPoint) |
Find the maximum squared distance of digitized points to fitted curve, and (if this maximum error is non-zero) set *splitPoint to the corresponding index. | |
static double | compute_hook (Point const &a, Point const &b, double const u, Point const bezCurve[], double const tolerance) |
Whereas compute_max_error_ratio() checks for itself that each data point is near some point on the curve, this function checks that each point on the curve is near some data point (or near some point on the polyline defined by the data points, or something like that: we allow for a "reasonable curviness" from such a polyline). | |
int | bezier_fit_cubic (Point *bezier, Point const *data, int len, double error) |
Fit a single-segment Bezier curve to a set of digitized points. | |
static double | lensq (Point const p) |
void | concept_checks () |
double | signed_triangle_area (Point const &p1, Point const &p2, Point const &p3) |
LineSegment | intersection (Line l, Rect r) |
static double | det (Point a, Point b) |
template<typename T > | |
static T | det (T a, T b, T c, T d) |
template<typename T > | |
static T | det (T M[2][2]) |
template<typename T > | |
static T | det3 (T M[3][3]) |
static double | boxprod (Point a, Point b, Point c) |
template<typename T > | |
std::string | stringify (T x) |
std::vector< Point > | decompose_degenerate (xAx const &C1, xAx const &C2, xAx const &xC0) |
double | xAx_descr (xAx const &C) |
std::optional< Point > | solve (double A[2][2], double b[2]) |
bool | at_infinity (Point const &p) |
static bool | is_clockwise_turn (Point const &a, Point const &b, Point const &c) |
template<typename Iter , typename Lex > | |
bool | below_x_monotonic_polyline (Point const &p, Iter first, Iter last, Lex lex) |
double | SignedTriangleArea (Point p0, Point p1, Point p2) |
int | mod (int i, int l) |
int | sgn (double x) |
bool | same_side (Point L[2], Point xs[4]) |
std::vector< pair< int, int > > | bridges (ConvexHull a, ConvexHull b) |
find bridging pairs between two convex hulls. | |
unsigned | find_bottom_right (ConvexHull const &a) |
ConvexHull | sweepline_intersection (ConvexHull const &a, ConvexHull const &b) |
ConvexHull | intersection (ConvexHull, ConvexHull) |
template<typename T > | |
T | idx_to_pair (pair< T, T > p, int idx) |
ConvexHull | merge (ConvexHull a, ConvexHull b) |
ConvexHull | graham_merge (ConvexHull a, ConvexHull b) |
ConvexHull | andrew_merge (ConvexHull a, ConvexHull b) |
std::string | format_coord_shortest (Coord x) |
std::string | format_coord_nice (Coord x) |
Coord | parse_coord (std::string const &s) |
double | wrap_dist (double from, double to, double size, bool rev) |
static void | set_first_point (Piecewise< D2< SBasis > > &f, Point const &a) |
static void | set_last_point (Piecewise< D2< SBasis > > &f, Point const &a) |
static std::vector< Interval > | intersect (std::vector< Interval > const &a, std::vector< Interval > const &b) |
static std::array< Coord, 2 > | axis_time_to_angles (Coord t, bool vertical) |
Convert curve time on the major axis to the corresponding angle parameters on a degenerate ellipse collapsed onto that axis. | |
static std::vector< ShapeIntersection > | double_axis_intersections (std::vector< ShapeIntersection > &&axis_intersections, bool vertical) |
For each intersection of some shape with the major axis of an ellipse, produce one or two intersections of a degenerate ellipse (collapsed onto that axis) with the same shape. | |
bool | are_near (Ellipse const &a, Ellipse const &b, Coord precision) |
std::ostream & | operator<< (std::ostream &out, Ellipse const &e) |
bool | arc_from_sbasis (EllipticalArc &ea, D2< SBasis > const &in, double tolerance, unsigned num_samples) |
std::ostream & | operator<< (std::ostream &out, EllipticalArc const &ea) |
IntersectorKind | line_intersection (Geom::Point const &n0, double const d0, Geom::Point const &n1, double const d1, Geom::Point &result) |
Finds the intersection of the two (infinite) lines defined by the points p such that dot(n0, p) == d0 and dot(n1, p) == d1. | |
int | intersector_ccw (const Geom::Point &p0, const Geom::Point &p1, const Geom::Point &p2) |
bool | line_segment_intersectp (Geom::Point const &p00, Geom::Point const &p01, Geom::Point const &p10, Geom::Point const &p11) |
Determine whether the line segment from p00 to p01 intersects the infinite line passing through p10 and p11. | |
bool | segment_intersectp (Geom::Point const &p00, Geom::Point const &p01, Geom::Point const &p10, Geom::Point const &p11) |
Determine whether two line segments intersect. | |
IntersectorKind | line_segment_intersect (Geom::Point const &p00, Geom::Point const &p01, Geom::Point const &p10, Geom::Point const &p11, Geom::Point &result) |
Determine whether & where a line segments intersects an (infinite) line. | |
IntersectorKind | segment_intersect (Geom::Point const &p00, Geom::Point const &p01, Geom::Point const &p10, Geom::Point const &p11, Geom::Point &result) |
Determine whether & where two line segments intersect. | |
IntersectorKind | line_twopoint_intersect (Geom::Point const &p00, Geom::Point const &p01, Geom::Point const &p10, Geom::Point const &p11, Geom::Point &result) |
Determine whether & where two line segments intersect. | |
static bool | is_less (Point const &A, Point const &B) |
static void | eliminate_duplicates_p (std::vector< Point > &pts) |
std::vector< Geom::Point > | rect_line_intersect (Geom::Point const &c0, Geom::Point const &c1, Geom::Point const &p0, Geom::Point const &p1) |
Determine whether & where an (infinite) line intersects a rectangle. | |
std::optional< LineSegment > | rect_line_intersect (Geom::Rect &r, Geom::Line l) |
Line | make_angle_bisector_line (Line const &l1, Line const &l2) |
SBasis | cheb (unsigned n) |
SBasis | cheb_series (unsigned n, double *cheb_coeff) |
SBasis | clenshaw_series (unsigned m, double *cheb_coeff) |
double | f_interp (double x, void *p) |
static void | computeLinfinityNeighborhood (D2< SBasis > const &f, double tol, D2< Piecewise< SBasis > > &topside, D2< Piecewise< SBasis > > &botside) |
static void | computeLinfinityNeighborhood (Piecewise< SBasis > const &f, double tol, Piecewise< SBasis > &top, Piecewise< SBasis > &bot) |
static void | prolongateByConstants (Piecewise< SBasis > &f, double paddle_width) |
static bool | compareIntersectionsTimesX (SmashIntersection const &inter1, SmashIntersection const &inter2) |
static void | cleanup_and_fuse (std::vector< SmashIntersection > &inters) |
static std::vector< Interval > | intersect (std::vector< Interval > const &a, std::vector< Interval > const &b) |
static float | sign (double number) |
Returns +1 for positive numbers, -1 for negative numbers, and 0 otherwise. | |
static float | find_direction_of_travel (Path const &path, PathTime const &time, Dim2 d) |
Determine whether the d-coordinate increases or decreases at the given path time. | |
template<typename T > | |
void | append (T &a, T const &b) |
A little sugar for appending a list to another. | |
bool | linear_intersect (Point const &A0, Point const &A1, Point const &B0, Point const &B1, double &tA, double &tB, double &det) |
Finds the intersection between the lines defined by A0 & A1, and B0 & B1. | |
static double | EpsilonOf (double value) |
static int | intersect_polish_f (const gsl_vector *x, void *params, gsl_vector *f) |
static void | intersect_polish_root (Curve const &A, double &s, Curve const &B, double &t) |
void | pair_intersect (Curve const &A, double Al, double Ah, Curve const &B, double Bl, double Bh, Crossings &ret, unsigned depth=0) |
This uses the local bounds functions of curves to generically intersect two. | |
void | mono_intersect (Curve const &A, double Al, double Ah, Curve const &B, double Bl, double Bh, Crossings &ret, double tol=0.1, unsigned depth=0) |
void | mono_pair (Path const &A, double Al, double Ah, Path const &B, double Bl, double Bh, Crossings &ret, double, unsigned depth=0) |
Takes two paths and time ranges on them, with the invariant that the paths are monotonic on the range. | |
std::vector< double > | curve_mono_splits (Curve const &d) |
This returns the times when the x or y derivative is 0 in the curve. | |
std::vector< double > | offset_doubles (std::vector< double > const &x, double offs) |
Convenience function to add a value to each entry in a vector of doubles. | |
std::vector< std::vector< double > > | paths_mono_splits (PathVector const &ps) |
Applies path_mono_splits to multiple paths, and returns the results such that time-set i corresponds to Path i. | |
std::vector< std::vector< Rect > > | split_bounds (PathVector const &p, std::vector< std::vector< double > > splits) |
Processes the bounds for a list of paths and a list of splits on them, yielding a list of rects for each. | |
Crossings | curve_self_crossings (Curve const &a) |
void | flip_crossings (Crossings &crs) |
template<typename iter > | |
iter | inc (iter const &x, unsigned n) |
Piecewise< SBasis > | pw_compose_inverse (SBasis const &f, SBasis const &g, unsigned order, double zero) |
std::ostream & | operator<< (std::ostream &out, Geom::Point const &p) |
static void | find_intersections_bezier_recursive (std::vector< std::pair< double, double > > &xs, OldBezier a, OldBezier b) |
void | find_intersections_bezier_recursive (std::vector< std::pair< double, double > > &xs, vector< Geom::Point > const &A, vector< Geom::Point > const &B, double) |
bool | intersect_BB (OldBezier a, OldBezier b) |
void | recursively_intersect (OldBezier a, double t0, double t1, int deptha, OldBezier b, double u0, double u1, int depthb, std::vector< std::pair< double, double > > ¶meters) |
double | log4 (double x) |
double | Lmax (Point p) |
unsigned | wangs_theorem (OldBezier) |
static Piecewise< SBasis > | sqrt_internal (SBasis const &f, double tol, int order) |
void | truncateResult (Piecewise< SBasis > &f, int order) |
SBasis | portion (const SBasis &t, double from, double to) |
void | find_bernstein_roots (std::vector< double > &solutions, Geom::Bezier const &bz, double left_t, double right_t) |
static unsigned | control_poly_flat_enough (Geom::Point const *V, unsigned degree) |
static double | compute_x_intercept (Geom::Point const *V, unsigned degree) |
static bool | is_digit (char c) |
std::vector< std::vector< unsigned > > | fake_cull (unsigned a, unsigned b) |
void | check_transforms () |
template<typename Curve01T , typename CurveT > | |
Piecewise< SBasis > | distance (Curve01T const &A, CurveT const &B, unsigned int pieces=40, double adaptive_limit=1e-5, double accuracy=1e-3) |
template<typename CurveT > | |
Piecewise< SBasis > | distance (Piecewise< D2< SBasis > > const &A, CurveT const &B, unsigned int pieces=40, double adaptive_limit=1e-5, double accuracy=1e-3) |
template<typename CurveT > | |
Piecewise< SBasis > | distance (Path const &A, CurveT const &B, unsigned int pieces=40, double adaptive_limit=1e-5, double accuracy=1e-3) |
template<typename Curve01T , typename CurveT > | |
unsigned int | dist_test (Piecewise< SBasis > const &pwc, Curve01T const &A, CurveT const &B, double step) |
bool | make_elliptical_arc (EllipticalArc &ea, Point const ¢re, Point const &initial, Point const &final, Point const &inner) |
void | subdiv_sbasis (SBasis const &s, std::vector< double > &roots, double left, double right) |
TEST (AffineTest, Equality) | |
TEST (AffineTest, Classification) | |
TEST (AffineTest, Inversion) | |
TEST (AffineTest, CoordinateAccess) | |
TEST (AffineTest, Nearness) | |
TEST (AffineTest, Multiplication) | |
TEST (CoordTest, StringRoundtripShortest) | |
TEST (CoordTest, StringRoundtripNice) | |
template<typename IntervalType , typename OptIntervalType > | |
constexpr bool | equality_test () |
TEST (IntervalTest, EqualityTest) | |
template<typename IntervalType > | |
constexpr bool | structured_binding_test () |
TEST (IntervalTest, StructuredBindingTest) | |
TEST (IntervalTest, Hash) | |
auto | aligned_bbox (std::vector< Point > const &pts, Affine const &affine=identity()) |
double | approx_min (std::vector< Point > const &pts) |
auto | randpts () |
TEST (MinBBoxTest, Empty) | |
TEST (MinBBoxTest, SinglePoint) | |
TEST (MinBBoxTest, Randomised) | |
NL::Vector | V3 (double a, double b, double c) |
TEST_F (VectorTest, VectorStringRepresentation) | |
TEST_F (VectorTest, VectorConstructFromAnother) | |
TEST_F (VectorTest, OperatorEqualIsDefined) | |
TEST_F (VectorTest, OperatorNotEqualIsntDefined) | |
TEST_F (VectorTest, VectorAssignment) | |
TEST_F (VectorTest, AssignedVectorMustBeSameSize) | |
TEST_F (VectorTest, VectorScalesInplace) | |
TEST_F (VectorTest, VectorTranslatesInplace) | |
TEST_F (VectorTest, ScaleAndTranslateUsesFluentSyntax) | |
TEST_F (VectorTest, AddAssignment) | |
TEST_F (VectorTest, SubtractAssignment) | |
TEST_F (VectorTest, SwappingElements) | |
TEST_F (VectorTest, Reverse) | |
TEST (Vector, IsPositive) | |
TEST_F (VectorTest, IsZero) | |
TEST_F (VectorTest, IsNonNegative) | |
TEST (Vector, Max) | |
TEST (Vector, MaxIndex) | |
TEST (Vector, Min) | |
TEST (Vector, MinIndex) | |
TEST_F (VectorTest, SetAll) | |
TEST_F (VectorTest, SetBasis) | |
TEST (Vector, SwappingVectors) | |
TEST_F (VectorViewTest, ViewCountOnly) | |
TEST_F (VectorViewTest, SkipSomeInitialElements) | |
TEST_F (VectorViewTest, SparseViewConstruction) | |
TEST_F (VectorViewTest, ConstructFromAnotherView) | |
TEST_F (VectorViewTest, PartialSourceModification) | |
TEST_F (VectorViewTest, ViewScalesInplace) | |
TEST_F (VectorViewTest, ViewScaleAndTranslateUsesFluentSyntax) | |
TEST_F (VectorViewTest, AssignmentFromVectorAvailableForViews) | |
TEST_F (VectorViewTest, AssignmentFromVectorMustBeSameSize) | |
TEST_F (VectorViewTest, AssignmentFromViewAvailableForViews) | |
TEST_F (VectorViewTest, AssignmentFromViewMustBeSameSize) | |
TEST_F (VectorViewTest, AddAssignAvailableForViews) | |
TEST_F (VectorViewTest, SubtractAssignAvailableForViews) | |
TEST_F (VectorViewTest, SwappingFromSameSourceVectorDoesNotModifySource) | |
TEST_F (VectorViewTest, SwappingFromSameSourceVectorModifiesViews) | |
TEST_F (VectorViewTest, SwappingDifferentLengthViewFails) | |
TEST (PointTest, Normalize) | |
TEST (PointTest, ScalarOps) | |
TEST (PointTest, Rounding) | |
TEST (PointTest, Near) | |
TEST (PointTest, Multiplicative) | |
TEST (PointTest, PointCtors) | |
TEST (PointTest, IntPointCtors) | |
TEST (PointTest, Hash) | |
TEST (RectTest, Upconversion) | |
TEST (RectTest, Rounding) | |
TEST (RectTest, ExpansionInPlace) | |
TEST (RectTest, Expanded) | |
TEST (RectTest, ShrinkingInPlace) | |
TEST (RectTest, Shrunk) | |
TYPED_TEST_CASE (GenericRectTest, CoordTypes) | |
TYPED_TEST (GenericRectTest, EqualityTest) | |
TYPED_TEST (GenericRectTest, Intersects) | |
TYPED_TEST (GenericRectTest, JonCruzRect) | |
JonCruz failure: (10, 20)-(55,30) and (45,20)-(100,30) should intersect. | |
TYPED_TEST (GenericRectTest, Intersection) | |
TYPED_TEST (GenericRectTest, Contains) | |
TYPED_TEST (GenericRectTest, Union) | |
TYPED_TEST (GenericRectTest, Area) | |
TYPED_TEST (GenericRectTest, Emptiness) | |
TYPED_TEST (GenericRectTest, Dimensions) | |
TYPED_TEST (GenericRectTest, Modification) | |
TYPED_TEST (GenericRectTest, OptRectDereference) | |
TYPED_TEST (GenericRectTest, Offset) | |
TYPED_TEST (GenericRectTest, NearestEdgePoint) | |
NodeType | get_nodetype (Curve const &c_incoming, Curve const &c_outgoing) |
static Point | intersection_point (Point origin_a, Point vector_a, Point origin_b, Point vector_b) |
static Circle | touching_circle (D2< SBasis > const &curve, double t, double tol=0.01) |
Find circle that touches inside of the curve, with radius matching the curvature, at time value t . | |
static double | area (Geom::Point a, Geom::Point b, Geom::Point c) |
static Circle | touching_circle (CubicBezier const &curve, bool start) |
static std::optional< Point > | intersection_point (Point const &origin_a, Point const &vector_a, Point const &origin_b, Point const &vector_b) |
Find the point where two straight lines cross. | |
static Geom::CubicBezier | sbasis_to_cubicbezier (Geom::D2< Geom::SBasis > const &sbasis_in) |
static Ellipse | find_ellipse (Point P, Point Q, Point O) |
document this! very quick: this finds the ellipse with minimum eccentricity passing through point P and Q, with tangent PO at P and QO at Q http://mathforum.org/kb/message.jspa?messageID=7471596&tstart=0 | |
static Circle | touching_circle (D2< SBasis > const &curve, double t, double tol=0.01) |
Find circle that touches inside of the curve, with radius matching the curvature, at time value t . | |
Variables | |
constexpr Coord | EPSILON = 1e-6 |
Default "acceptably small" value. | |
static Point const | unconstrained_tangent (0, 0) |
const unsigned | MAXDEPTH = 64 |
const double | BEPSILON = ldexp(1.0,-MAXDEPTH-1) |
unsigned | total_steps |
unsigned | total_subs |
static const char | _svg_path_actions [] |
static const short | _svg_path_key_offsets [] |
static const char | _svg_path_trans_keys [] |
static const char | _svg_path_single_lengths [] |
static const char | _svg_path_range_lengths [] |
static const short | _svg_path_index_offsets [] |
static const short | _svg_path_indicies [] |
static const short | _svg_path_trans_targs [] |
static const char | _svg_path_trans_actions [] |
static const char | _svg_path_eof_actions [] |
static const int | svg_path_start = 234 |
static const int | svg_path_first_final = 234 |
static const int | svg_path_en_main = 234 |
xAx | degen |
Various utility functions.
@TODO Move this to 2geom?
Copyright 2008 Marco Cecchetti <mrcekets at gmail.com> Copyright 2007 Johan Engelen goeje.nosp@m.ndaa.nosp@m.gh@zo.nosp@m.nnet.nosp@m..nl Copyright 2006 Michael G. Sloan mgslo.nosp@m.an@g.nosp@m.mail..nosp@m.com
This library is free software; you can redistribute it and/or modify it either under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation (the "LGPL") or, at your option, under the terms of the Mozilla Public License Version 1.1 (the "MPL"). If you do not alter this notice, a recipient may use your version of this file under either the MPL or the LGPL.
You should have received a copy of the LGPL along with this library in the file COPYING-LGPL-2.1; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA You should have received a copy of the MPL along with this library in the file COPYING-MPL-1.1
The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the LGPL or the MPL for the specific language governing rights and limitations.
typedef ::testing::Types<Coord, IntCoord> Geom::CoordTypes |
Definition at line 40 of file rect-test.cpp.
typedef std::vector<Crossing> Geom::Crossings |
Definition at line 126 of file crossing.h.
typedef std::vector<Crossings> Geom::CrossingSet |
Definition at line 128 of file crossing.h.
typedef Intersection Geom::CurveIntersection |
typedef SimpleCrosser Geom::DefaultCrosser |
Definition at line 83 of file path-intersection.h.
using Geom::ErrorCode = typedef int |
typedef GenericRect< IntCoord > Geom::IntRect |
typedef Geom::LinearOf<double> Geom::Linear |
Definition at line 71 of file linear-of.h.
typedef std::optional<Crossing> Geom::OptCrossing |
Definition at line 64 of file crossing.h.
typedef GenericOptRect< IntCoord > Geom::OptIntRect |
typedef Intersection<PathTime> Geom::PathIntersection |
Definition at line 89 of file pathvector.h.
Alias to save typing.
Definition at line 90 of file pathvector.h.
Definition at line 201 of file wrapped-pyobject.h.
Definition at line 202 of file wrapped-pyobject.h.
typedef GenericOptRect<WrappedPyObject> Geom::PyOptRect |
Definition at line 205 of file wrapped-pyobject.h.
typedef D2<WrappedPyObject> Geom::PyPoint |
Definition at line 207 of file wrapped-pyobject.h.
typedef GenericRect<WrappedPyObject> Geom::PyRect |
Definition at line 204 of file wrapped-pyobject.h.
typedef Geom::SBasisOf<double> Geom::SBasis |
Definition at line 54 of file sbasis-of.h.
typedef Intersection Geom::ShapeIntersection |
Definition at line 132 of file intersection.h.
typedef std::back_insert_iterator<PathVector> Geom::SubpathInserter |
Definition at line 222 of file path-sink.h.
enum Geom::Align |
Values for the <align> parameter of preserveAspectRatio.
See: http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute
Enumerator | |
---|---|
ALIGN_NONE | |
ALIGN_XMIN_YMIN | |
ALIGN_XMID_YMIN | |
ALIGN_XMAX_YMIN | |
ALIGN_XMIN_YMID | |
ALIGN_XMID_YMID | |
ALIGN_XMAX_YMID | |
ALIGN_XMIN_YMAX | |
ALIGN_XMID_YMAX | |
ALIGN_XMAX_YMAX |
enum Geom::Errors : ErrorCode |
enum Geom::Expansion |
Values for the <meetOrSlice> parameter of preserveAspectRatio.
See: http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute
Enumerator | |
---|---|
EXPANSION_MEET | |
EXPANSION_SLICE |
enum Geom::NodeType |
What kind of node is this? This is the value for the node->type field.
NodeType indicates the degree of continuity required for the node. I think that the corresponding integer indicates which derivate is connected. (Thus 2 means that the node is continuous to the second derivative, i.e. has matching endpoints and tangents)
Definition at line 29 of file geom-nodetype.h.
Return the absolute value of a function pointwise.
f | function |
Definition at line 57 of file sbasis-math.cpp.
References roots(), Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::size().
Return the absolute value of a function pointwise.
f | function |
Definition at line 51 of file sbasis-math.cpp.
References abs().
Convert an align specification to coordinate fractions.
Definition at line 37 of file rect.cpp.
References ALIGN_XMAX_YMAX, ALIGN_XMAX_YMID, ALIGN_XMAX_YMIN, ALIGN_XMID_YMAX, ALIGN_XMID_YMID, ALIGN_XMID_YMIN, ALIGN_XMIN_YMAX, ALIGN_XMIN_YMID, ALIGN_XMIN_YMIN, X, and Y.
Referenced by Geom::Rect::transformTo().
Definition at line 10 of file min-bbox-test.cpp.
References Geom::GenericOptRect< C >::expandTo().
Referenced by approx_min(), and TEST().
std::vector< double > Geom::all_nearest_times | ( | Point const & | p, |
D2< SBasis > const & | c, | ||
D2< SBasis > const & | dc, | ||
double | from = 0 , |
||
double | to = 1 |
||
) |
Definition at line 142 of file nearest-time.cpp.
References c, dot(), result, and roots().
Referenced by all_nearest_times(), all_nearest_times(), all_nearest_times(), Geom::Curve::allNearestTimes(), and Geom::SBasisCurve::allNearestTimes().
|
inline |
Definition at line 95 of file nearest-time.h.
References all_nearest_times(), c, and derivative().
|
inline |
Definition at line 124 of file nearest-time.h.
References all_nearest_times(), and c.
std::vector< double > Geom::all_nearest_times | ( | Point const & | p, |
Piecewise< D2< SBasis > > const & | c, | ||
double | from, | ||
double | to | ||
) |
Definition at line 242 of file nearest-time.cpp.
References all_nearest_times(), bounds_fast(), c, and distanceSq().
ConvexHull Geom::andrew_merge | ( | ConvexHull | a, |
ConvexHull | b | ||
) |
if we modified graham scan to work top to bottom as proposed in lect754.pdf we could replace the angle sort with a simple merge sort type algorithm. furthermore, we could do the graham scan online, avoiding a bunch of memory copies. That would probably be linear. – njh
Definition at line 707 of file convex-hull.cpp.
References Geom::ConvexHull::begin(), Geom::ConvexHull::end(), and result.
Definition at line 456 of file line.h.
References angle_between(), and Geom::Line::vector().
Referenced by Inkscape::UI::Handle::_getDragTip(), Geom::EllipticalArc::_updateCenterAndAngles(), angle_between(), angle_between(), angle_between_ray_def(), bridges(), Geom::Point::constrain_angle(), SnapManager::constrainedAngularSnap(), Inkscape::LivePathEffect::LPECopyRotate::doBeforeEffect(), Inkscape::LivePathEffect::LPEAngleBisector::doEffect_path(), Inkscape::LivePathEffect::LPEFilletChamfer::doEffect_path(), Inkscape::LivePathEffect::LPETextLabel::doEffect_pwd2(), Inkscape::UI::Handle::dragged(), Inkscape::UI::Node::dragged(), Inkscape::LivePathEffect::getAngle(), Inkscape::UI::Node::grabbed(), Inkscape::LivePathEffect::FilletChamferKnotHolderEntity::knot_get(), make_angle_bisector_line(), make_angle_bisector_ray(), make_elliptical_arc(), Inkscape::UI::Tools::set_pos_and_anchor(), Inkscape::LivePathEffect::TextParam::setPosAndAnchor(), Geom::Line::transformTo(), and wrap_point().
Definition at line 145 of file ray.h.
References angle_between(), and Geom::Ray::vector().
void Geom::append | ( | T & | a, |
T const & | b | ||
) |
A little sugar for appending a list to another.
Definition at line 65 of file path-intersection.cpp.
Referenced by curve_mono_splits(), curve_self_crossings(), edges(), path_mono_splits(), and self_crossings().
double Geom::approx_min | ( | std::vector< Point > const & | pts | ) |
Definition at line 20 of file min-bbox-test.cpp.
References aligned_bbox(), area(), min(), and N.
Referenced by TEST().
|
related |
Definition at line 323 of file elliptical-arc-from-sbasis.cpp.
Referenced by Geom::EllipticalArc::arc_from_sbasis().
|
related |
Referenced by Geom::Piecewise< T >::arc_length_parametrization(), Inkscape::LivePathEffect::LPEInterpolate::calculate_trajectory(), Inkscape::LivePathEffect::LPECurveStitch::doEffect_path(), Inkscape::LivePathEffect::LPEEmbroderyStitch::doEffect_path(), Inkscape::LivePathEffect::LPEBendPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPEEnvelope::doEffect_pwd2(), Inkscape::LivePathEffect::LPEPatternAlongPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPERecursiveSkeleton::doEffect_pwd2(), doEffect_pwd2(), Inkscape::LivePathEffect::TextParam::setPosAndAnchor(), and Inkscape::LivePathEffect::stretch_along().
|
related |
Referenced by Geom::Piecewise< T >::arc_length_parametrization(), Geom::Piecewise< T >::arcLengthSb(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::LPERuler::doEffect_pwd2(), Inkscape::LivePathEffect::LPESketch::doEffect_pwd2(), length(), length(), recursive_curvature_fitter(), single_curvature_fitter(), SPCurve::stretch_endpoints(), timeAtArcLength(), and Inkscape::LivePathEffect::LPEDashedStroke::timeAtLength().
|
related |
Referenced by SPText::_adjustFontsizeRecursive(), Inkscape::UI::PathManipulator::_bsplineHandlePosition(), Inkscape::UI::PathManipulator::_bsplineHandleReposition(), Inkscape::UI::Tools::PenTool::_bsplineSpiroBuild(), Inkscape::UI::Tools::PenTool::_bsplineSpiroMotion(), Geom::SVGPathParser::_closePath(), Geom::PlanarGraph< EdgeLabel >::_compareAndReglue(), Geom::PlanarGraph< EdgeLabel >::_ensureVertexAt(), Inkscape::UI::Tools::PenTool::_finishSegment(), Inkscape::UI::Tools::PencilTool::_interpolate(), SPGenericEllipse::_isSlice(), Inkscape::UI::Tools::EraserTool::_isStraightSegment(), Inkscape::UI::ControlPointSelection::_keyboardScale(), Geom::PlanarGraph< EdgeLabel >::_reglueTeardrop(), Geom::PlanarGraph< EdgeLabel >::_regularizeVertex(), Inkscape::CanvasItemGridAxonom::_render(), Inkscape::CanvasItemGuideLine::_render(), Inkscape::CanvasItemRect::_render(), Inkscape::CanvasItemGridAxonom::_update(), Inkscape::UI::TransformHandleSet::_updateVisibility(), Inkscape::UI::add_or_replace_if_extremum(), SPItem::adjust_stroke(), Geom::EllipticalArc::allNearestTimes(), SPViewBox::apply_viewbox(), Geom::Piecewise< T >::arc_length_parametrization(), Inkscape::LivePathEffect::are_colinear(), Geom::Affine::are_near(), are_near(), are_near(), Geom::Ellipse::are_near(), are_near(), are_near(), are_near(), are_near(), Inkscape::Util::are_near(), are_near(), are_near(), are_near(), are_near(), are_near(), Geom::Line::are_orthogonal(), are_parallel(), Geom::Line::are_same(), are_same(), bbox_on_rect_clip(), Inkscape::SubItem::build_mosaic(), cells(), Geom::xAx::centre(), Geom::CLIPPER_CLASS::clip(), Geom::Piecewise< T >::compose(), Geom::NearConcept< T >::constraints(), Geom::TransformConcept< T >::constraints(), count_path_degenerations(), SPGuide::createSPGuide(), Geom::SVGPathWriter::curveTo(), delete_duplicates(), dist_test(), Inkscape::do_offset(), Inkscape::LivePathEffect::LPECopyRotate::doBeforeEffect(), Inkscape::LivePathEffect::LPEMeasureSegments::doBeforeEffect(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doBeforeEffect(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::doBeforeEffect(), Inkscape::LivePathEffect::LPESlice::doBeforeEffect(), Inkscape::LivePathEffect::LPETaperStroke::doBeforeEffect(), Inkscape::LivePathEffect::LPEBSpline::doBSplineFromWidget(), Inkscape::LivePathEffect::LPEAttachPath::doEffect(), Inkscape::LivePathEffect::LPEFillBetweenMany::doEffect(), Inkscape::LivePathEffect::LPEFillBetweenStrokes::doEffect(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::doEffect(), Inkscape::LivePathEffect::LPERoughen::doEffect(), Inkscape::LivePathEffect::LPECopyRotate::doEffect_path(), Inkscape::LivePathEffect::LPECurveStitch::doEffect_path(), Inkscape::LivePathEffect::LPEDashedStroke::doEffect_path(), Inkscape::LivePathEffect::LPEFilletChamfer::doEffect_path(), Inkscape::LivePathEffect::LPEGears::doEffect_path(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doEffect_path(), Inkscape::LivePathEffect::LPEOffset::doEffect_path(), Inkscape::LivePathEffect::LPEExtrude::doEffect_pwd2(), Inkscape::LivePathEffect::LPEPatternAlongPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPEFilletChamfer::doOnApply(), Inkscape::LivePathEffect::LPETransform2Pts::doOnApply(), Inkscape::PaperSize::findPaperSize(), Inkscape::Util::UnitTable::findUnit(), Inkscape::LivePathEffect::LPEShowHandles::generateHelperPath(), Inkscape::LivePathEffect::LPESimplify::generateHelperPathAndSmooth(), get_nodetype(), get_scale_transform_for_uniform_stroke(), get_scale_transform_for_variable_stroke(), Inkscape::LivePathEffect::getNodes(), grid_item_sort(), SnapManager::guideFreeSnap(), Inkscape::UI::PathManipulator::insertNodeAtExtremum(), Geom::CLIPPER_CLASS::intersect(), intersection(), intersection(), Geom::detail::intersection_impl(), Geom::detail::intersection_impl(), Geom::detail::intersection_impl(), intersection_point(), intersection_point(), IntersectionsValid(), Geom::detail::bezier_clipping::is_constant(), is_straight_curve(), Geom::Point::is_unit_vector(), Geom::Linear::isConstant(), Geom::Bezier::isConstant(), SPDesktop::DesktopAffine::isFlipped(), Geom::BezierCurve::isNear(), Geom::EllipticalArc::isNear(), Inkscape::LivePathEffect::Effect::isNodePointSelected(), Geom::Parallelogram::isSheared(), Geom::Linear::isZero(), Geom::Bezier::isZero(), Geom::detail::bezier_clipping::iterate< intersection_point_tag >(), Inkscape::LivePathEffect::FilletChamferKnotHolderEntity::knot_get(), Inkscape::LivePathEffect::FilletChamferKnotHolderEntity::knot_set(), linear_intersect(), Geom::SVGPathWriter::lineTo(), make_angle_bisector_ray(), make_elliptical_arc(), Inkscape::Extension::Internal::TemplateBase::match_template_size(), Inkscape::Rubberband::move(), Inkscape::UI::Handle::move(), SPGuide::moveto(), Inkscape::Extension::Internal::Wmf::myMetaFileProc(), Geom::EllipticalArc::nearestTime(), object_distribute(), ObjectNear(), ObjectNotNear(), Inkscape::UI::Widget::RegisteredScalarUnit::on_value_changed(), Inkscape::outline_join(), parting_point(), path_from_piecewise(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), pathv_similar(), pathv_to_cubicbezier(), Inkscape::Extension::Internal::PrintEmf::pathv_to_rect(), Inkscape::Extension::Internal::PrintEmf::pathv_to_simple_polygon(), Geom::detail::bezier_clipping::pick_orientation_line(), Geom::detail::bezier_clipping::pick_orientation_line(), Inkscape::DrawingCache::prepare(), Geom::SVGPathWriter::quadTo(), PathVectorNodeSatellites::recalculateForNewPathVector(), Inkscape::Extension::Internal::PdfBuilder::TextContext::render_text(), Inkscape::LivePathEffect::LPEBendPath::resetDefaults(), Inkscape::LivePathEffect::LPECurveStitch::resetDefaults(), Geom::xAx::set(), SPGuide::set(), Inkscape::UI::Widget::DashSelector::set_dash_pattern(), SPItem::set_item_transform(), Inkscape::Extension::Internal::PdfBuilder::PageContext::set_pagebox(), SPItem::setCenter(), Inkscape::DrawingGroup::setChildTransform(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::setDefaults(), Inkscape::DrawingPattern::setPatternToUserTransform(), Geom::Ray::setPoints(), Inkscape::UI::Handle::setPosition(), Inkscape::DrawingItem::setTransform(), Inkscape::UI::Node::setType(), Inkscape::LivePathEffect::size_nondegenerate(), Geom::Path::snapEnds(), SPGenericEllipse::snappoints(), Inkscape::LivePathEffect::sp_bspline_do_effect(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_flowtext_render(), sp_svg_transform_write(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_text_render(), Inkscape::LivePathEffect::LPESlice::splititem(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), touching_circle(), Geom::Curve::unitTangentAt(), unitTangentAt(), Inkscape::DrawingItem::update(), Inkscape::Extension::Internal::PrintEmf::vector_rect_alignment(), VectorNear(), and SPDesktop::zoom_quick().
Definition at line 307 of file circle.cpp.
References are_near(), Geom::Circle::center(), and Geom::Circle::radius().
|
inline |
Definition at line 191 of file d2.h.
References are_near().
Definition at line 736 of file ellipse.cpp.
Definition at line 264 of file transforms.h.
References are_near(), and Geom::ShearBase< S >::factor().
Definition at line 1132 of file path.cpp.
References Geom::Path::size().
Definition at line 132 of file ray.h.
References are_near(), and distance().
Definition at line 420 of file line.h.
References are_near(), and distance().
|
inline |
Definition at line 472 of file line.h.
References are_near(), and distance().
Definition at line 224 of file transforms.h.
References are_near(), X, and Y.
Definition at line 178 of file transforms.h.
References are_near(), X, and Y.
Definition at line 140 of file transforms.h.
References are_near(), X, and Y.
Definition at line 281 of file transforms.h.
References are_near(), and Geom::ShearBase< S >::factor().
Definition at line 328 of file transforms.h.
References are_near(), Geom::Zoom::scale(), and Geom::Zoom::translation().
Test whether the relative distance between two points is less than some threshold.
Definition at line 409 of file point.h.
References Geom::Point::length(), and Geom::Point::x().
Referenced by Geom::EllipticalArc::_validateIntersection(), and TEST().
Definition at line 426 of file line.h.
References are_near(), cross(), and Geom::Line::vector().
Referenced by Geom::Line::are_same().
Definition at line 137 of file ray.h.
References are_near(), Geom::Ray::origin(), and Geom::Ray::vector().
Referenced by wrap_ray().
|
static |
Definition at line 61 of file geom-pathstroke.cpp.
Referenced by approx_min(), Geom::Piecewise< T >::centroid(), centroid(), Geom::PlanarGraph< EdgeLabel >::closedPathArea(), Inkscape::LivePathEffect::LPEPathLength::doEffect_pwd2(), draw_cell(), path_direction(), and touching_circle().
bool Geom::at_infinity | ( | Point const & | p | ) |
Definition at line 681 of file conicsec.cpp.
References infinity(), X, and Y.
Referenced by Geom::xAx::set().
|
related |
|
related |
|
related |
Referenced by Inkscape::UI::Tools::EraserTool::_apply(), Inkscape::UI::Widget::OKWheel::_discColor(), Geom::PlanarGraph< EdgeLabel >::_getAzimuth(), Inkscape::UI::Widget::OKWheel::_setColor(), Geom::EllipticalArc::_updateCenterAndAngles(), Geom::Rotate::angle(), Geom::xAx::angle_at(), Geom::Piecewise< T >::atan2(), bridges(), cartesian_to_polar(), Inkscape::LivePathEffect::LPEAttachPath::doEffect(), Inkscape::LivePathEffect::LPEGears::doEffect_path(), Inkscape::UI::Tools::SpiralTool::drag(), draw_line_seg_with_arrow(), Inkscape::LivePathEffect::endpoints2angles(), Inkscape::Colors::Space::Lch::fromLuv(), Inkscape::LivePathEffect::LPEPts2Ellipse::genIsometricEllipse(), Inkscape::LivePathEffect::LPEPts2Ellipse::genSteinerEllipse(), Proj::TransfMat3x4::get_infinite_angle(), Inkscape::UI::Tools::MarkerTool::get_marker_transform(), Geom::Ellipse::intersect(), Geom::Ellipse::operator*=(), Box3D::pos_angle(), random_arc(), Inkscape::UI::Tools::ToolBase::root_handler(), Persp3D::rotate_VP(), Geom::xAx::set(), Geom::xAx::set(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_flowtext_render(), sp_item_gradient_set_coords(), sp_shape_marker_get_transform(), sp_shape_marker_get_transform_at_end(), sp_shape_marker_get_transform_at_start(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_text_render(), Geom::Circle::timeAt(), Geom::Ellipse::timeAt(), Inkscape::UI::Widget::PatternEditor::update_widgets_from_pattern(), and wrap_point().
Convert curve time on the major axis to the corresponding angle parameters on a degenerate ellipse collapsed onto that axis.
t | The curve time on the major axis of an ellipse. |
vertical | If true, the major axis goes from angle -π/2 to +π/2; otherwise, the major axis connects angles π and 0. |
Definition at line 420 of file ellipse.cpp.
Referenced by double_axis_intersections().
bool Geom::below_x_monotonic_polyline | ( | Point const & | p, |
Iter | first, | ||
Iter | last, | ||
Lex | lex | ||
) |
Definition at line 265 of file convex-hull.cpp.
Referenced by Geom::ConvexHull::contains().
|
inline |
Compute the value of a Bernstein-Bezier polynomial.
This method uses a Horner-like fast evaluation scheme.
t | Time value |
c_ | Pointer to coefficients |
n | Degree of the polynomial (number of coefficients minus one) |
Definition at line 55 of file bezier.h.
Referenced by Geom::BezierFitter::bezier_pt(), casteljau_subdivision(), TEST_F(), Geom::Bezier::valueAndDerivatives(), and Geom::Bezier::valueAt().
|
inline |
Between function - returns true if a number x is within a range: (min < x) && (max > x).
The values delimiting the range and the number must have the same type.
Definition at line 63 of file math-utils.h.
Expand an interval to the image of a Bézier-Bernstein polynomial, assuming it already contains the initial point x0.
Definition at line 347 of file bezier.cpp.
References Geom::GenericInterval< C >::contains(), EPSILON, and Geom::GenericInterval< C >::expandTo().
Referenced by bezier_expand_to_image(), bezier_expand_to_image(), and Geom::BezierCurveN< degree >::expandToTransformed().
Definition at line 371 of file bezier.cpp.
References c, Geom::GenericInterval< C >::contains(), EPSILON, and Geom::GenericInterval< C >::expandTo().
|
static |
Definition at line 628 of file bezier-curve.cpp.
References bezier_expand_to_image(), X, and Y.
|
static |
Definition at line 635 of file bezier-curve.cpp.
References bezier_expand_to_image(), X, and Y.
Fit a single-segment Bezier curve to a set of digitized points.
Definition at line 109 of file bezier-utils.cpp.
References bezier_fit_cubic_r(), data, and len.
int Geom::BezierFitter::bezier_fit_cubic_full | ( | Point | bezier[], |
int | split_points[], | ||
Point const | data[], | ||
int const | len, | ||
Point const & | tHat1, | ||
Point const & | tHat2, | ||
double const | error, | ||
unsigned const | max_beziers | ||
) |
Fit a multi-segment Bezier curve to a set of digitized points, without possible weedout of identical points and NaNs.
max_beziers | Maximum number of generated segments |
Result | array, must be large enough for n. segments * 4 elements. |
Definition at line 192 of file bezier-utils.cpp.
References bezier_fit_cubic_full(), chord_length_parameterize(), compute_max_error_ratio(), darray_center_tangent(), data, distance(), generate_bezier(), is_zero(), len, reparameterize(), sqrt(), and unconstrained_tangent.
Referenced by Inkscape::UI::Tools::PencilTool::_fitAndSplit(), bezier_fit_cubic_full(), bezier_fit_cubic_r(), and SPSpiral::fitAndDraw().
int Geom::BezierFitter::bezier_fit_cubic_r | ( | Point | bezier[], |
Point const | data[], | ||
int const | len, | ||
double const | error, | ||
unsigned const | max_beziers | ||
) |
Fit a multi-segment Bezier curve to a set of digitized points, with possible weedout of identical points and NaNs.
max_beziers | Maximum number of generated segments |
Result | array, must be large enough for n. segments * 4 elements. |
Definition at line 124 of file bezier-utils.cpp.
References bezier_fit_cubic_full(), copy_without_nans_or_adjacent_duplicates(), data, len, and unconstrained_tangent.
Referenced by Inkscape::UI::Tools::EraserTool::_completeBezier(), Inkscape::UI::Tools::PencilTool::_interpolate(), Inkscape::UI::Tools::PencilTool::_sketchInterpolate(), Inkscape::UI::Tools::PencilTool::addPowerStrokePencil(), bezier_fit_cubic(), Inkscape::UI::Tools::CalligraphicTool::fit_and_split(), Geom::Interpolate::CubicBezierFit::interpolateToPath(), interpolateToPath(), interpolateToPath2(), main(), and ordered_fit().
Compute the length of a quadratic bezier curve given by its control points.
Definition at line 774 of file bezier-curve.cpp.
References bezier_length_internal().
Compute the length of a cubic bezier curve given by its control points.
Definition at line 803 of file bezier-curve.cpp.
References bezier_length_internal().
Compute the length of a bezier curve given by a vector of its control points.
Definition at line 746 of file bezier-curve.cpp.
Referenced by Inkscape::UI::Node::_linearGrow().
|
static |
Definition at line 753 of file bezier-curve.cpp.
References bezier_length_internal(), and distance().
|
static |
Definition at line 779 of file bezier-curve.cpp.
References bezier_length_internal(), and distance().
|
static |
Definition at line 665 of file bezier-curve.cpp.
References bezier_length_internal(), and distance().
Referenced by bezier_length(), bezier_length(), Geom::BezierCurve::bezier_length(), bezier_length_internal(), bezier_length_internal(), and bezier_length_internal().
|
static |
Find intersections of a low-degree Bézier curve with a line segment.
Uses algebraic solutions to low-degree polynomial equations which may be faster and more precise than iterative methods.
degree | The degree of the Bézier curve; must be 2 or 3. |
curve | A Bézier curve of the given degree. |
line | A line (but really a segment). |
Definition at line 509 of file bezier-curve.cpp.
References degree, distance(), Geom::Line::finalPoint(), Geom::Line::initialPoint(), length(), result, root, roots(), Geom::Line::rotationToZero(), solve_cubic(), solve_quadratic(), X, and Y.
Definition at line 352 of file bezier.h.
References result.
Referenced by Geom::BezierCurve::controlPoints(), find_intersections(), and sbasis_to_bezier().
Evaluate a Bezier curve at parameter value t.
degree | The degree of the Bezier curve: 3 for cubic, 2 for quadratic etc. Must be less than 4. |
V | The control points for the Bezier curve. Must have (degree+1) elements. |
t | The "parameter" value, specifying whereabouts along the curve to evaluate. Typically in the range [0.0, 1.0]. |
Let s = 1 - t. BezierII(1, V) gives (s, t) * V, i.e. t of the way from V[0] to V[1]. BezierII(2, V) gives (s**2, 2*s*t, t**2) * V. BezierII(3, V) gives (s**3, 3 s**2 t, 3s t**2, t**3) * V.
The derivative of BezierII(i, V) with respect to t is i * BezierII(i-1, V'), where for all j, V'[j] = V[j + 1] - V[j].
Pascal's triangle.
Pascal's triangle.
Definition at line 666 of file bezier-utils.cpp.
References degree.
Referenced by compute_hook(), compute_max_error_ratio(), and NewtonRaphsonRootFind().
Definition at line 44 of file bezier-to-sbasis.h.
References bezier_to_sbasis(), multiply(), and order.
Referenced by bezier_to_sbasis(), handles_to_sbasis(), Geom::RatQuad::homogeneous(), TEST_F(), and Geom::Bezier::toSBasis().
Changes the basis of d2 p to be sbasis.
p | the d2 Bernstein basis polynomial |
if the degree is even q is the order in the symmetrical power basis, if the degree is odd q is the order + 1 n is always the polynomial degree, i. e. the Bezier order
Definition at line 377 of file sbasis-to-bezier.cpp.
References binomial_decrement_n(), binomial_increment_k(), X, and Y.
Changes the basis of p to be sbasis.
p | the Bernstein basis polynomial |
if the degree is even q is the order in the symmetrical power basis, if the degree is odd q is the order + 1 n is always the polynomial degree, i. e. the Bezier order
Definition at line 318 of file sbasis-to-bezier.cpp.
References binomial_decrement_n(), binomial_increment_k(), Geom::SBasis::clear(), Geom::Bezier::order(), and Geom::SBasis::resize().
void Geom::binomial_coefficients | ( | std::vector< size_t > & | bc, |
std::size_t | n | ||
) |
Definition at line 40 of file utils.cpp.
Referenced by Geom::NL::LFMBezier::LFMBezier().
|
constexpr |
Given a multiple of binomial(n, k), modify it to the same multiple of binomial(n, k - 1).
Definition at line 70 of file choose.h.
Referenced by Geom::detail::bezier_clipping::distance_control_points().
|
constexpr |
Given a multiple of binomial(n, k), modify it to the same multiple of binomial(n - 1, k).
Definition at line 52 of file choose.h.
Referenced by bezier_to_sbasis(), and bezier_to_sbasis().
|
constexpr |
Given a multiple of binomial(n, k), modify it to the same multiple of binomial(n, k + 1).
Definition at line 61 of file choose.h.
Referenced by bezier_to_sbasis(), bezier_to_sbasis(), Geom::BinomialCoefficient< ValueType >::BinomialCoefficient(), choose(), Geom::detail::bezier_clipping::distance_control_points(), Geom::Bezier::forward_difference(), operator*(), and sbasis_to_bezier().
|
constexpr |
std::vector< Rect > Geom::bounds | ( | C const & | a | ) |
Definition at line 131 of file crossing.h.
References rs.
Definition at line 117 of file crossing.cpp.
References Geom::Path::boundsFast(), rs, and Geom::Path::size_default().
OptInterval Geom::bounds_exact | ( | Bezier const & | b | ) |
Definition at line 310 of file bezier.cpp.
References Geom::Bezier::at0(), Geom::Bezier::at1(), derivative(), Geom::Bezier::roots(), and Geom::Bezier::valueAt().
Referenced by bounds_exact(), Geom::Piecewise< T >::bounds_exact(), Geom::LinearOf< T >::bounds_fast(), Geom::Piecewise< T >::bounds_local(), Geom::BezierCurve::boundsExact(), Geom::SBasisCurve::boundsExact(), Geom::FragmentConcept< T >::constraints(), Inkscape::LivePathEffect::LPECurveStitch::doEffect_path(), Inkscape::LivePathEffect::LPEInterpolate::doEffect_path(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::LPEPatternAlongPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPERecursiveSkeleton::doEffect_pwd2(), Inkscape::LivePathEffect::LPERoughHatches::doEffect_pwd2(), Inkscape::LivePathEffect::LPESketch::doEffect_pwd2(), doEffect_pwd2(), Geom::BezierCurve::expandToTransformed(), Geom::SBasisCurve::expandToTransformed(), Inkscape::LivePathEffect::LPERoughHatches::linearSnake(), linearSnake(), monotonic_smash_intersect(), Inkscape::LivePathEffect::LPECurveStitch::resetDefaults(), smash_intersect(), Inkscape::LivePathEffect::stretch_along(), TEST_F(), TEST_F(), TEST_F(), and wrap_linear().
Definition at line 475 of file d2.h.
References bounds_exact(), X, and Y.
|
inline |
Definition at line 287 of file pathvector.h.
References Geom::PathVector::boundsExact().
OptInterval Geom::bounds_exact | ( | SBasis const & | a | ) |
OptInterval Geom::bounds_fast | ( | Bezier const & | b | ) |
Definition at line 305 of file bezier.cpp.
Referenced by all_nearest_times(), bounds_fast(), Geom::Piecewise< T >::bounds_fast(), bounds_fast(), bounds_fast(), bounds_local(), Geom::BezierCurve::boundsFast(), Geom::SBasisCurve::boundsFast(), Geom::Piecewise< T >::compose(), Geom::FragmentConcept< T >::constraints(), Inkscape::LivePathEffect::LPESimplify::doEffect(), goal_function(), item_find_paths(), monotonic_smash_intersect(), nearest_time(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), reciprocal(), reciprocal(), sb2d_cubic_solve(), sbofsb_cubic_solve(), smash_intersect(), Geom::SBasisOf< T >::tailError(), Geom::SBasis::tailError(), TEST_F(), TEST_F(), and wrap_linear().
Definition at line 470 of file d2.h.
References bounds_fast(), X, and Y.
|
inline |
Definition at line 286 of file pathvector.h.
References Geom::PathVector::boundsFast().
OptInterval Geom::bounds_fast | ( | SBasis const & | a, |
int | order = 0 |
||
) |
OptInterval Geom::bounds_local | ( | Bezier const & | b, |
OptInterval const & | i | ||
) |
Definition at line 320 of file bezier.cpp.
References bounds_fast(), and portion().
Referenced by bounds_local(), Geom::Piecewise< T >::bounds_local(), bounds_local(), Geom::BezierCurve::boundsLocal(), Geom::SBasisCurve::boundsLocal(), Geom::FragmentConcept< T >::constraints(), TEST_F(), TEST_F(), toPoly(), and wrap_linear().
OptRect Geom::bounds_local | ( | const D2< T > & | a, |
const OptInterval & | t | ||
) |
Definition at line 480 of file d2.h.
References bounds_local(), X, and Y.
|
inline |
OptInterval Geom::bounds_local | ( | SBasis const & | a, |
const OptInterval & | t, | ||
int | order = 0 |
||
) |
Definition at line 80 of file conicsec.cpp.
Referenced by Geom::RatQuad::fromPointsTangents().
std::vector< pair< int, int > > Geom::bridges | ( | ConvexHull | a, |
ConvexHull | b | ||
) |
find bridging pairs between two convex hulls.
this code is based on Hormoz Pirzadeh's masters thesis. There is room for optimisation:
Definition at line 543 of file convex-hull.cpp.
References angle_between(), atan2(), same_side(), and Geom::ConvexHull::size().
Referenced by merge().
void Geom::build_from_sbasis | ( | Geom::PathBuilder & | pb, |
D2< SBasis > const & | B, | ||
double | tol, | ||
bool | only_cubicbeziers | ||
) |
Make a path from a d2 sbasis.
p | the d2 Symmetric basis polynomial |
If only_cubicbeziers is true, the resulting path may only contain CubicBezier curves.
Definition at line 497 of file sbasis-to-bezier.cpp.
References Geom::D2< T >::at1(), build_from_sbasis(), compose(), Geom::PathIteratorSink< OutputIterator >::curveTo(), Geom::D2< T >::isFinite(), Geom::PathIteratorSink< OutputIterator >::lineTo(), sbasis_size(), sbasis_to_cubic_bezier(), and tail_error().
Referenced by build_from_sbasis(), path_from_piecewise(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), and path_from_sbasis().
|
inline |
Perform Casteljau subdivision of a Bezier polynomial.
Given an array of coefficients and a time value, computes two new Bernstein-Bezier basis polynomials corresponding to the \([0, t]\) and \([t, 1]\) intervals of the original one.
t | Time value |
v | Array of input coordinates |
left | Output polynomial corresponding to \([0, t]\) |
right | Output polynomial corresponding to \([t, 1]\) |
order | Order of the input polynomial, equal to one less the number of coefficients |
Definition at line 78 of file bezier.h.
References bernstein_value_at(), lerp(), and order.
Referenced by find_parametric_bezier_roots().
|
related |
int Geom::centroid | ( | std::vector< Geom::Point > const & | p, |
Geom::Point & | centroid, | ||
double & | area | ||
) |
polyCentroid: Calculates the centroid (xCentroid, yCentroid) and area of a polygon, given its vertices (x[0], y[0]) ... (x[n-1], y[n-1]).
It is assumed that the contour is closed, i.e., that the vertex following (x[n-1], y[n-1]) is (x[0], y[0]). The algebraic sign of the area is positive for counterclockwise ordering of vertices in x-y plane; otherwise negative.
Returned values: 0 for normal execution; 1 if the polygon is degenerate (number of vertices < 3); 2 if area = 0 (and the centroid is undefined).
for now we require the path to be a polyline and assume it is closed.
Definition at line 366 of file geom.cpp.
References area(), centroid(), and cross().
Referenced by Geom::Piecewise< T >::centroid(), centroid(), Geom::PlanarGraph< EdgeLabel >::closedPathArea(), Inkscape::LivePathEffect::LPEPathLength::doEffect_pwd2(), draw_cell(), Inkscape::is_path_empty(), path_direction(), and pwd2sb_centroid().
SBasis Geom::cheb | ( | unsigned | n | ) |
Definition at line 14 of file chebyshev.cpp.
References basis(), and Geom::SBasis::push_back().
Referenced by cheb_series().
SBasis Geom::cheb_series | ( | unsigned | n, |
double * | cheb_coeff | ||
) |
Definition at line 27 of file chebyshev.cpp.
References cheb().
SBasis Geom::chebyshev | ( | unsigned | n | ) |
Definition at line 102 of file chebyshev.cpp.
References basis(), and Geom::SBasis::push_back().
SBasis Geom::chebyshev_approximant | ( | double(*)(double, void *) | f, |
int | order, | ||
Interval | in, | ||
void * | p = 0 |
||
) |
Definition at line 59 of file chebyshev.cpp.
References clenshaw_series(), compose(), and order.
Referenced by chebyshev_approximant_interpolating().
SBasis Geom::chebyshev_approximant_interpolating | ( | double(*)(double, void *) | f, |
int | order, | ||
Interval | in, | ||
void * | p = 0 |
||
) |
Definition at line 88 of file chebyshev.cpp.
References chebyshev_approximant(), compose(), f_interp(), and order.
void Geom::check_transforms | ( | ) |
Definition at line 162 of file transforms.cpp.
References Geom::Translate::identity(), Geom::Scale::identity(), Geom::Rotate::identity(), Geom::ShearBase< VShear >::identity(), Geom::ShearBase< HShear >::identity(), and Geom::Zoom::identity().
|
constexpr |
Calculate the (n, k)th binomial coefficient.
Definition at line 79 of file choose.h.
References binomial_increment_k(), and max().
|
static |
Assign parameter values to digitized points using relative distances between points.
Definition at line 833 of file bezier-utils.cpp.
References distance(), and len.
Referenced by bezier_fit_cubic_full().
Definition at line 202 of file crossing.cpp.
|
static |
Definition at line 133 of file intersection-by-smashing.cpp.
References compareIntersectionsTimesX(), intersects, X, and Y.
Referenced by smash_intersect().
SBasis Geom::clenshaw_series | ( | unsigned | m, |
double * | cheb_coeff | ||
) |
b_n = a_n b_n-1 = 2*x*b_n + a_n-1 b_n-k = 2*x*b_{n-k+1} + a_{n-k} - b_{n - k + 2} b_0 = x*b_1 + a_0 - b_2
Definition at line 39 of file chebyshev.cpp.
Referenced by chebyshev_approximant().
|
inline |
Definition at line 526 of file line.h.
References Geom::Line::clip().
Definition at line 1619 of file conicsec.cpp.
References R.
Referenced by Geom::CLIPPER_CLASS::clip(), Inkscape::LivePathEffect::LPEPowerClip::doOnRemove(), Inkscape::LivePathEffect::LPEBool::get_union(), and Inkscape::LivePathEffect::LPEPowerClip::getClipPathvector().
|
static |
Definition at line 126 of file intersection-by-smashing.cpp.
References Geom::GenericRect< C >::min(), Geom::SmashIntersection::times, X, and Y.
Referenced by cleanup_and_fuse().
Definition at line 405 of file d2.h.
References compose().
Referenced by Geom::Piecewise< T >::arc_length_parametrization(), bend(), Inkscape::LivePathEffect::bend(), build_from_sbasis(), chebyshev_approximant(), chebyshev_approximant_interpolating(), compose(), compose(), compose(), compose(), compose(), compose(), Geom::Piecewise< T >::compose(), Geom::Piecewise< T >::compose(), compose(), compose(), compose(), compose(), compose(), compose(), compose(), compose_each(), compose_each(), compose_each(), convole(), convole(), cos(), divide(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEBendPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::LPEEnvelope::doEffect_pwd2(), Inkscape::LivePathEffect::LPEPatternAlongPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPERecursiveSkeleton::doEffect_pwd2(), doEffect_pwd2(), main(), monotonic_smash_intersect(), Geom::Piecewise< T >::operator()(), Geom::SBasis::operator()(), Geom::Piecewise< T >::operator()(), Geom::SBasisOf< T >::operator()(), plot3d(), plot3d(), plot3d_top(), Geom::SBasis::portion(), portion(), portion(), Geom::Piecewise< T >::pw_compose_inverse(), reciprocal(), reciprocal(), recursive_curvature_fitter(), sb2d_cubic_solve(), sb2dsolve(), sbofsb_cubic_solve(), single_curvature_fitter(), smash_intersect(), solve_lambda0(), sqrt_internal(), Inkscape::LivePathEffect::stretch_along(), Geom::Piecewise< T >::unitVector(), and wrap_sbasis().
Definition at line 40 of file sbasis-2d.cpp.
References multiply(), X, and Y.
SBasisOf< T > Geom::compose | ( | LinearOf< T > const & | a, |
LinearOf< T > const & | b | ||
) |
Definition at line 595 of file sbasis-of.h.
References compose().
SBasisOf< T > Geom::compose | ( | LinearOf< T > const & | a, |
SBasisOf< T > const & | b | ||
) |
Definition at line 587 of file sbasis-of.h.
References compose().
Definition at line 157 of file polynomial.cpp.
References result.
Compute a composed with b.
a,b | sbasis functions |
return a0 + s(a1 + s(a2 +... where s = (1-u)u; ak =(1 - u)a^0_k + ua^1_k
Definition at line 448 of file sbasis.cpp.
References multiply(), multiply_add(), and Geom::SBasis::size().
Compute a composed with b to k terms.
a,b | sbasis functions |
return a0 + s(a1 + s(a2 +... where s = (1-u)u; ak =(1 - u)a^0_k + ua^1_k
Definition at line 464 of file sbasis.cpp.
References multiply(), multiply_add(), Geom::SBasis::size(), and Geom::SBasis::truncate().
Definition at line 49 of file sbasis-2d.cpp.
References compose(), Geom::SBasis2d::us, and Geom::SBasis2d::vs.
SBasisN< n > Geom::compose | ( | SBasisN< n > const & | a, |
SBasisN< n > const & | b, | ||
unsigned | k | ||
) |
SBasisN< m > Geom::compose | ( | SBasisN< n > const & | f, |
std::vector< SBasisN< m > > const & | t, | ||
unsigned const | k = 0 , |
||
unsigned const | idx = 0 |
||
) |
Definition at line 970 of file sbasisN.h.
References compose(), multiply(), and Geom::SBasisN< n >::sizes.
SBasisOf< T > Geom::compose | ( | SBasisOf< T > const & | a, |
LinearOf< T > const & | b | ||
) |
Definition at line 591 of file sbasis-of.h.
References compose().
SBasisOf< T > Geom::compose | ( | SBasisOf< T > const & | a, |
SBasisOf< T > const & | b | ||
) |
Definition at line 565 of file sbasis-of.h.
References multiply(), and multiply_add().
SBasisOf< T > Geom::compose | ( | SBasisOf< T > const & | a, |
SBasisOf< T > const & | b, | ||
unsigned | k | ||
) |
Definition at line 576 of file sbasis-of.h.
References multiply(), multiply_add(), and Geom::SBasisOf< T >::truncate().
Definition at line 69 of file sbasis-2d.cpp.
Definition at line 414 of file d2.h.
References compose().
Referenced by Inkscape::LivePathEffect::LPELattice::doEffect_pwd2(), and Inkscape::LivePathEffect::LPELattice2::doEffect_pwd2().
int Geom::compose_findSegIdx | ( | std::map< double, unsigned >::iterator const & | cut, |
std::map< double, unsigned >::iterator const & | next, | ||
std::vector< double > const & | levels, | ||
SBasis const & | g | ||
) |
Definition at line 130 of file piecewise.cpp.
Referenced by Geom::Piecewise< T >::compose().
compute fog^-1.
f,g | sbasis functions |
("zero" = double comparison threshold. !*we might divide by "zero"!*) TODO: compute order according to tol? TODO: requires g(0)=0 & g(1)=1 atm... adaptation to other cases should be obvious!
Definition at line 623 of file sbasis.cpp.
References Geom::SBasis::at(), det(), order, Geom::SBasis::resize(), result, Geom::SBasis::truncate(), and valuation().
std::map< double, unsigned > Geom::compose_pullback | ( | std::vector< double > const & | cuts, |
SBasis const & | g | ||
) |
Definition at line 107 of file piecewise.cpp.
References Geom::SBasis::at0(), Geom::SBasis::at1(), multi_roots(), result, and roots().
Referenced by Geom::Piecewise< T >::compose().
|
static |
Whereas compute_max_error_ratio() checks for itself that each data point is near some point on the curve, this function checks that each point on the curve is near some data point (or near some point on the polyline defined by the data points, or something like that: we allow for a "reasonable curviness" from such a polyline).
"Reasonable curviness" means we draw a circle centred at the midpoint of a..b, of radius proportional to the length |a - b|, and require that each point on the segment of bezCurve between the parameters of a and b be within that circle. If any point P on the bezCurve segment is outside of that allowable region (circle), then we return some metric that increases with the distance from P to the circle.
Given that this is a fairly arbitrary criterion for finding appropriate places for sharp corners, we test only one point on bezCurve, namely the point on bezCurve with parameter halfway between our estimated parameters for a and b. (Alternatives are taking the farthest of a few parameters between those of a and b, or even using a variant of NewtonRaphsonFindRoot() for finding the maximum rather than minimum distance.)
Definition at line 969 of file bezier-utils.cpp.
References bezier_pt(), and distance().
Referenced by compute_max_error_ratio().
|
static |
Find the maximum squared distance of digitized points to fitted curve, and (if this maximum error is non-zero) set *splitPoint to the corresponding index.
Definition at line 898 of file bezier-utils.cpp.
References bezier_pt(), compute_hook(), len, lensq(), and sqrt().
Referenced by bezier_fit_cubic_full().
|
static |
Definition at line 170 of file solve-bezier-parametric.cpp.
Referenced by find_parametric_bezier_roots().
|
static |
Definition at line 19 of file intersection-by-smashing.cpp.
References Geom::D2< T >::at0(), Geom::D2< T >::at1(), Geom::Piecewise< T >::cuts, make_cuts_independent(), Geom::Piecewise< T >::segs, X, and Y.
Referenced by monotonic_smash_intersect(), and smash_intersect().
|
static |
Definition at line 51 of file intersection-by-smashing.cpp.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::domain(), Geom::Piecewise< T >::firstValue(), Geom::Piecewise< T >::lastValue(), Geom::GenericInterval< C >::max(), Geom::GenericInterval< C >::min(), Geom::Piecewise< T >::offsetDomain(), and Geom::Piecewise< T >::segs.
void Geom::concept_checks | ( | ) |
Definition at line 49 of file concepts.cpp.
Point Geom::constrain_angle | ( | Point const & | A, |
Point const & | B, | ||
unsigned | n = 4 , |
||
Point const & | dir = {1, 0} |
||
) |
Referenced by Inkscape::UI::Handle::dragged().
Definition at line 47 of file path-intersection.h.
References winding().
Referenced by Geom::Line::clip(), Geom::GenericRect< C >::contains(), Inkscape::LivePathEffect::LPEEmbroderyStitchOrdering::contains(), draw(), Geom::EllipticalArc::expandToTransformed(), Inkscape::LivePathEffect::LPEEmbroderyStitchOrdering::FindShortestReconnect(), Geom::GenericRect< C >::nearestEdgePoint(), TEST_F(), TEST_F(), and TEST_F().
|
static |
Definition at line 109 of file solve-bezier-parametric.cpp.
References BEPSILON, c, degree, distance(), X, and Y.
Referenced by find_parametric_bezier_roots().
|
static |
Copy points from src to dest, filter out points containing NaN and adjacent points with equal x and y.
Definition at line 154 of file bezier-utils.cpp.
Referenced by bezier_fit_cubic_r().
Compute the cosine of a.
b | linear function |
It is recommended to use the piecewise version unless you have good reason.
Definition at line 609 of file sbasis.cpp.
References sin().
Referenced by cos(), cos(), cosC(), Inkscape::LivePathEffect::LPEAttachPath::doEffect(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::evalSteinerEllipse(), Inkscape::LivePathEffect::LPEPts2Ellipse::gen_perspective_axes_paths(), Inkscape::LivePathEffect::LPEPts2Ellipse::genPerspectiveEllipse(), sin(), sin(), sincos(), solve_cubic(), Geom::Piecewise< T >::tan2(), Geom::Circle::toSBasis(), Geom::EllipticalArc::toSBasis(), and Inkscape::LivePathEffect::LPEPts2Ellipse::unit_arc_path().
Compute the cosine of a function.
f | function |
tol | maximum error |
order | maximum degree polynomial to use |
Definition at line 222 of file sbasis-math.cpp.
References cos(), Geom::Piecewise< T >::cuts, order, result, Geom::Piecewise< T >::segs, Geom::Piecewise< T >::setDomain(), and Geom::Piecewise< T >::size().
Compute the cosine of a function.
f | function |
tol | maximum error |
order | maximum degree polynomial to use |
Definition at line 237 of file sbasis-math.cpp.
References Geom::SBasis::at0(), Geom::SBasis::at1(), c, compose(), Geom::Piecewise< T >::concat(), cos(), order, Geom::Piecewise< T >::setDomain(), Geom::SBasis::tailError(), and Geom::SBasis::truncate().
Piecewise< SBasis > Geom::cross | ( | Piecewise< D2< SBasis > > const & | a, |
Piecewise< D2< SBasis > > const & | b | ||
) |
Definition at line 144 of file d2-sbasis.cpp.
References cross(), Geom::Piecewise< T >::cuts, result, and Geom::Piecewise< T >::segs.
Referenced by Inkscape::CanvasItemGridXY::_render(), ang(), Geom::Point::angle_between(), Geom::Ellipse::arc(), Inkscape::LivePathEffect::are_colinear(), are_parallel(), Geom::ConvexHull::area(), Geom::Piecewise< T >::centroid(), centroid(), Geom::Line::coefficients(), Inkscape::CanvasItemQuad::contains(), cross(), Geom::D2< T >::cubics_fitting_curvature(), cubics_fitting_curvature(), Geom::Piecewise< T >::curvature(), distance(), distanceLessThanOrEqual(), DistanceToCubic(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::doBeforeEffect(), Inkscape::LivePathEffect::LPEKnot::doEffect_path(), Inkscape::LivePathEffect::LPEFilletChamfer::doEffect_path(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doEffect_path(), Inkscape::LivePathEffect::LPESketch::doEffect_pwd2(), find_ellipse(), Geom::D2< T >::find_tangents(), Inkscape::LivePathEffect::LPEPts2Ellipse::genIsometricEllipse(), Inkscape::LivePathEffect::LPEPts2Ellipse::genPerspectiveEllipse(), Inkscape::LivePathEffect::getAngle(), Geom::BezierCurveN< degree >::intersect(), Geom::Circle::intersect(), Geom::Line::intersect(), intersect(), Geom::detail::intersection_impl(), intersection_point(), intersection_point(), Geom::Circle::intersects(), Inkscape::LivePathEffect::LPEPts2Ellipse::is_ccw(), is_clockwise_turn(), Inkscape::LivePathEffect::FilletChamferKnotHolderEntity::knot_get(), linear_intersect(), non_collinear_segments_intersect(), Geom::detail::bezier_clipping::orientation_line(), Inkscape::outline_join(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), Inkscape::LivePathEffect::LPEEmbroderyStitchOrdering::OrderingGroup::SetEndpoints(), Inkscape::signed_distance(), signed_triangle_area(), SignedTriangleArea(), Inkscape::LivePathEffect::LPECopyRotate::split(), Inkscape::LivePathEffect::LPESlice::splititem(), Path::Surface(), touching_circle(), touching_circle(), triangulate(), and Geom::EllipticalArc::winding().
unsigned Geom::crossing_count | ( | double const * | V, |
unsigned | degree, | ||
double | left_t, | ||
double | right_t | ||
) |
unsigned Geom::crossing_count | ( | Geom::Point const * | V, |
unsigned | degree | ||
) |
Definition at line 85 of file solve-bezier-parametric.cpp.
References degree, sign(), and Y.
Referenced by find_parametric_bezier_roots().
Definition at line 90 of file path-intersection.h.
References c.
Referenced by Inkscape::UI::Tools::calculate_intersections(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doEffect_path(), Geom::EllipticalArc::intersect(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), NodeSatellite::radToLen(), Inkscape::LivePathEffect::LPECopyRotate::split(), and Inkscape::LivePathEffect::LPESlice::splititem().
Definition at line 95 of file path-intersection.h.
References c.
|
inline |
Definition at line 100 of file path-intersection.h.
References c.
CrossingSet Geom::crossings_among | ( | PathVector const & | p | ) |
Definition at line 692 of file path-intersection.cpp.
References bounds, Geom::SimpleCrosser::crossings(), Geom::PathVector::empty(), flip_crossings(), merge_crossings(), self_crossings(), Geom::PathVector::size(), and sweep_bounds().
Referenced by cells().
|
inline |
Definition at line 58 of file math-utils.h.
Referenced by Inkscape::Colors::Space::OkLab::toLinearRGB().
|
static |
Definition at line 65 of file bezier-utils.h.
References c.
Definition at line 72 of file sbasis-to-bezier.h.
References path_from_sbasis().
Referenced by cairo_curve(), cairo_curve(), feed_curve_to_cairo(), geom_curve_bbox_wind_distance(), pathv_to_cubicbezier(), pathv_to_linear_and_cubic_beziers(), Inkscape::Extension::Internal::PrintLatex::print_2geomcurve(), Inkscape::Extension::Internal::PdfBuilder::DrawContext::set_shape_path(), sp_svg_write_curve(), and wrap_path().
std::vector< D2< SBasis > > Geom::cubics_fitting_curvature | ( | Point const & | M0, |
Point const & | M1, | ||
Point const & | dM0, | ||
Point const & | dM1, | ||
Point const & | d2M0, | ||
Point const & | d2M1, | ||
int | insist_on_speed_signs = 1 , |
||
double | epsilon = 1e-5 |
||
) |
Definition at line 716 of file sbasis-geometric.cpp.
References cross(), and cubics_fitting_curvature().
std::vector< D2< SBasis > > Geom::cubics_with_prescribed_curvature | ( | Point const & | M0, |
Point const & | M1, | ||
Point const & | dM0, | ||
Point const & | dM1, | ||
double | k0, | ||
double | k1, | ||
int | insist_on_speed_signs = 1 , |
||
double | error = 1e-5 |
||
) |
Definition at line 727 of file sbasis-geometric.cpp.
References cubics_fitting_curvature(), Geom::Point::length(), and length().
|
related |
std::vector< double > Geom::curve_mono_splits | ( | Curve const & | d | ) |
This returns the times when the x or y derivative is 0 in the curve.
Definition at line 388 of file path-intersection.cpp.
References append(), Geom::Curve::derivative(), Geom::Curve::roots(), rs, X, and Y.
Referenced by curve_self_crossings(), and path_mono_splits().
Definition at line 550 of file path-intersection.cpp.
References append(), curve_mono_splits(), and pair_intersect().
Referenced by self_crossings().
Definition at line 52 of file path-intersection.h.
References bounds, offset_crossings(), Geom::Path::size(), and sweep_bounds().
Piecewise< D2< SBasis > > Geom::cutAtRoots | ( | Piecewise< D2< SBasis > > const & | M, |
double | tol = 1e-4 |
||
) |
Definition at line 136 of file sbasis-geometric.cpp.
References roots(), and vect_intersect().
Referenced by Geom::Piecewise< T >::atan2(), Geom::Piecewise< T >::curvature(), and Geom::Piecewise< T >::unitVector().
Iter Geom::cyclic_next | ( | Iter | i, |
Container & | c | ||
) |
Get the next iterator in the container with wrap-around.
If the iterator would become the end iterator after incrementing, return the begin iterator instead.
Definition at line 81 of file utils.h.
References c.
Referenced by Geom::PathIntersectionGraph::_assignEdgeWindingParities(), Geom::PathIntersectionGraph::_getResult(), Geom::PathIntersectionGraph::_removeDegenerateIntersections(), Geom::PathIntersectionGraph::_verify(), Geom::PlanarGraph< EdgeLabel >::Vertex::cyclicNextIncidence(), Geom::PlanarGraph< EdgeLabel >::Vertex::cyclicNextIncidence(), and Geom::PathIntersectionGraph::fragments().
Iter Geom::cyclic_prior | ( | Iter | i, |
Container & | c | ||
) |
Get the previous iterator in the container with wrap-around.
If the passed iterator is the begin iterator, return the iterator just before the end iterator instead.
Definition at line 93 of file utils.h.
References c.
Referenced by Geom::PathIntersectionGraph::_getResult(), Geom::PathIntersectionGraph::_removeDegenerateIntersections(), Geom::PlanarGraph< EdgeLabel >::Vertex::cyclicPrevIncidence(), and Geom::PlanarGraph< EdgeLabel >::Vertex::cyclicPrevIncidence().
|
static |
Estimates the (backward) tangent at d[center], by averaging the two segments connected to d[center] (and then normalizing the result).
Definition at line 807 of file bezier-utils.cpp.
References len, Geom::Point::normalize(), and rot90().
Referenced by bezier_fit_cubic_full().
Estimate the (forward) tangent at point d[first + 0.5].
Unlike the center and right versions, this calculates the tangent in the way one might expect, i.e., wrt increasing index into d.
Definition at line 706 of file bezier-utils.cpp.
References len, and unit_vector().
Referenced by darray_left_tangent(), and generate_bezier().
Estimate the (forward) tangent at point d[0].
Unlike the center and right versions, this calculates the tangent in the way one might expect, i.e., wrt increasing index into d.
Definition at line 745 of file bezier-utils.cpp.
References darray_left_tangent(), dot(), len, and unit_vector().
Estimates the (backward) tangent at d[last - 0.5].
Definition at line 724 of file bezier-utils.cpp.
References len, and unit_vector().
Estimates the (backward) tangent at d[last].
Definition at line 776 of file bezier-utils.cpp.
References darray_right_tangent(), dot(), len, and unit_vector().
Referenced by darray_right_tangent(), and generate_bezier().
|
inline |
Returns x rounded to the nearest multiple of \(10^{p}\).
Implemented in terms of round, i.e. we make no guarantees as to what happens if x is half way between two rounded numbers.
Note: places is the number of decimal places without using scientific (e) notation, not the number of significant figures. This function may not be suitable for values of x whose magnitude is so far from 1 that one would want to use scientific (e) notation.
places may be negative: e.g. places = -2 means rounding to a multiple of .01
Definition at line 77 of file math-utils.h.
Referenced by angle_formatter().
At this point we have tried up to 4 points: 0,0, 1,0, 1,1, 2,1, 1.5,1.5
No degenerate conic can pass through these points, so we can assume that we've found a perpendicular to the double line. Proof: any degenerate must consist of at most 2 lines. 1.5,0.5 is not on any pair of lines passing through the previous 4 trials.
alternatively, there may be a way to determine this directly from xC0
Definition at line 238 of file conicsec.cpp.
References Geom::xAx::c, c, Geom::Affine::det(), det(), Geom::Line::from_origin_and_vector(), Geom::xAx::gradient(), Geom::xAx::hessian(), L1(), n1, Geom::Line::pointAt(), Geom::xAx::roots(), and rot90().
Referenced by intersect().
void Geom::delete_duplicates | ( | Crossings & | crs | ) |
Definition at line 188 of file crossing.cpp.
References are_near().
Referenced by Inkscape::UI::Tools::calculate_intersections().
Definition at line 282 of file bezier.cpp.
Referenced by all_nearest_times(), arc_length_integrating(), Geom::Piecewise< T >::arcLengthSb(), arcLengthSb2(), Geom::Piecewise< T >::atan2(), bounds_exact(), Geom::BezierCurve::boundsLocal(), Geom::Piecewise< T >::centroid(), Geom::Piecewise< T >::curvature(), Geom::BezierCurve::derivative(), Geom::BezierCurveN< degree >::derivative(), Geom::SBasisCurve::derivative(), derivative(), Geom::Piecewise< T >::derivative(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEBendPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::LPEEnvelope::doEffect_pwd2(), Inkscape::LivePathEffect::LPEExtrude::doEffect_pwd2(), Inkscape::LivePathEffect::LPEPatternAlongPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPERecursiveSkeleton::doEffect_pwd2(), Inkscape::LivePathEffect::LPERuler::doEffect_pwd2(), Inkscape::LivePathEffect::LPESketch::doEffect_pwd2(), Inkscape::LivePathEffect::LPETangentToCurve::doEffect_pwd2(), Inkscape::LivePathEffect::LPETextLabel::doEffect_pwd2(), doEffect_pwd2(), dot_plot(), dot_plot(), Geom::Path::extrema(), Inkscape::LivePathEffect::find_cusps(), Geom::D2< T >::find_normals(), Geom::D2< T >::find_normals_by_vector(), find_self_intersections(), Geom::D2< T >::find_tangents(), Geom::D2< T >::find_tangents_by_vector(), goal_function(), Geom::D2< T >::length_integrating(), linearizeCusps(), Inkscape::LivePathEffect::LPERoughHatches::linearSnake(), linearSnake(), main(), monotonic_smash_intersect(), monotonicSplit(), my_inverse(), naive_sb_seg_to_bez(), nearest_time(), nearest_time(), plot_offset(), polish_root(), sb_seg_to_bez(), sbofsb_cubic_solve(), Inkscape::LivePathEffect::TextParam::setPosAndAnchor(), smash_intersect(), Inkscape::LivePathEffect::stretch_along(), subderivative(), TEST_F(), TEST_F(), Geom::BezierCurve::timesWithRadiusOfCurvature(), toPoly(), touching_circle(), and wrap_pw().
Definition at line 452 of file d2.h.
References derivative(), X, and Y.
Definition at line 145 of file polynomial.cpp.
References result.
Compute the derivative of a (Exact)
a | sbasis functions |
Definition at line 323 of file sbasis.cpp.
References c, Geom::SBasis::isZero(), Geom::SBasis::resize(), and Geom::SBasis::size().
Definition at line 506 of file sbasis-of.h.
References c, and Geom::SBasisOf< T >::isZero().
Definition at line 56 of file conicsec.cpp.
Referenced by Inkscape::LivePathEffect::_circle3(), boxprod(), compose_inverse(), decompose_degenerate(), det3(), det3(), det3(), Geom::SL::determinant_minor(), Geom::xAx::kind(), linear_intersect(), recursively_intersect(), and solve().
|
static |
Definition at line 61 of file conicsec.cpp.
References c.
|
static |
Definition at line 66 of file conicsec.cpp.
|
static |
Definition at line 71 of file conicsec.cpp.
References det().
Referenced by Geom::xAx::categorise(), intersect(), xAx_descr(), and xAx_descr().
unsigned int Geom::dist_test | ( | Piecewise< SBasis > const & | pwc, |
Curve01T const & | A, | ||
CurveT const & | B, | ||
double | step | ||
) |
Definition at line 707 of file curve-curve-distance.cpp.
References are_near(), distance(), and nearest_time().
Definition at line 163 of file angle.h.
References Geom::Angle::radians0().
Referenced by Inkscape::UI::Tools::PencilTool::_addFreehandPoint(), Inkscape::UI::PathManipulator::_deleteStretch(), Inkscape::UI::ControlPointSelection::_pointDragged(), Inkscape::UI::ControlPointSelection::_pointGrabbed(), Inkscape::UI::ControlPointSelection::_rotationRadius(), Inkscape::ObjectSnapper::_snapPaths(), Inkscape::ObjectSnapper::_snapPathsTangPerp(), Inkscape::UI::PathManipulator::_updateDragPoint(), Inkscape::LivePathEffect::LPECopyRotate::addCanvasIndicators(), Inkscape::LivePathEffect::LPERoughen::addNodesAndJitter(), GrDrag::addStopNearPoint(), arc_length_integrating(), arc_length_subdividing(), Geom::Ellipse::are_near(), are_near(), are_near(), are_near(), bezier_fit_cubic_full(), Geom::BezierFitter::bezier_fit_cubic_full(), bezier_length_internal(), bezier_length_internal(), bezier_length_internal(), bezier_line_intersections(), SPMeshNodeArray::bicubic(), box3d_half_line_crosses_joining_line(), Inkscape::LivePathEffect::LPEInterpolate::calculate_trajectory(), chord_length_parameterize(), Geom::BezierFitter::chord_length_parameterize(), Inkscape::CanvasItemGuideLine::closest_distance_to(), Inkscape::CanvasItemCtrl::closest_distance_to(), Inkscape::CanvasItemCurve::closest_distance_to(), Geom::BezierFitter::compute_hook(), compute_hook(), Geom::Circle::contains(), Geom::Circle::contains(), control_poly_flat_enough(), Inkscape::LivePathEffect::LPEMeasureSegments::createLine(), cubic_length_subdividing(), Geom::PlanarGraph< EdgeLabel >::deviatesLeft(), dist_test(), Inkscape::LivePathEffect::LPEEmbroderyStitchOrdering::OrderingGroupConnection::Distance(), distance(), distance(), distance(), distance(), Inkscape::distance_to_segment(), Inkscape::do_offset(), Inkscape::LivePathEffect::LPECopyRotate::doBeforeEffect(), Inkscape::LivePathEffect::LPEMeasureSegments::doBeforeEffect(), Inkscape::LivePathEffect::LPETransform2Pts::doBeforeEffect(), Inkscape::LivePathEffect::LPEFillBetweenMany::doEffect(), Inkscape::LivePathEffect::LPERoughen::doEffect(), Inkscape::LivePathEffect::LPECopyRotate::doEffect_path(), Inkscape::LivePathEffect::LPEEmbroderyStitch::doEffect_path(), Inkscape::LivePathEffect::LPEFilletChamfer::doEffect_path(), Inkscape::LivePathEffect::LPEGears::doEffect_path(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doEffect_path(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPETransform2Pts::doEffect_pwd2(), Inkscape::LivePathEffect::LPETransform2Pts::doOnApply(), Inkscape::UI::Handle::dragged(), Inkscape::LivePathEffect::LPEShowHandles::drawHandleLine(), Inkscape::LivePathEffect::LPESimplify::drawHandleLine(), GrDrag::dropColor(), GrDrag::dropColorOnCorrespondingRegion(), estimate_lengths(), Geom::BezierFitter::estimate_lengths(), Inkscape::UI::PathManipulator::extremeNode(), Inkscape::Extension::Internal::PrintEmf::fill(), Inkscape::Extension::Internal::PrintWmf::fill(), Inkscape::LivePathEffect::LPEEmbroderyStitchOrdering::OrderingPoint::FindNearest2(), Inkscape::LivePathEffect::LPEEmbroderyStitchOrdering::FindShortestReconnect(), Geom::Circle::fit(), Inkscape::LivePathEffect::LPESimplify::generateHelperPathAndSmooth(), Inkscape::UI::get_monitor_geometry_at_point(), Inkscape::Extension::Internal::PdfBuilder::Document::get_radial_pattern(), SPStar::getSideLength(), hausdorf(), hausdorfl(), PointHandle::hit(), PointSetHandle::hit(), RectHandle::hit(), Inkscape::LivePathEffect::LPELattice2::horizontal(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::horizontal(), Geom::BezierCurveN< degree >::intersect(), Inkscape::SnappedCurve::intersect(), Inkscape::SnappedCurve::intersect(), intersection(), Geom::Circle::intersects(), Inkscape::LivePathEffect::LPERoughen::jitter(), Inkscape::LivePathEffect::FilletChamferKnotHolderEntity::knot_set(), Geom::BezierCurve::length(), length(), NodeSatellite::lenToRad(), Geom::Path::nearestTime(), Inkscape::LivePathEffect::LPEEmbroderyStitchOrdering::OrderingClosest(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), random_arc(), Inkscape::Filters::FilterImage::render_cairo(), Inkscape::LivePathEffect::LPETransform2Pts::reset(), Geom::CLIPPER_CLASS::rsplit(), Geom::xAx::set(), Inkscape::UI::Node::setType(), Inkscape::LivePathEffect::LPEOffset::sp_get_offset(), Inkscape::UI::ControlPointSelection::spatialGrow(), Inkscape::LivePathEffect::LPESlice::splititem(), TEST(), Geom::xAx::toCurve(), touching_circle(), Inkscape::UI::Widget::ColorWheelHSLuv::updateGeometry(), SPRect::vectorStretch(), Inkscape::LivePathEffect::LPELattice2::vertical(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::vertical(), wrap_point(), and wrap_rect().
|
inline |
Definition at line 647 of file curve-curve-distance.cpp.
|
inline |
Definition at line 686 of file curve-curve-distance.cpp.
References Geom::Path::closed(), distance(), Geom::Piecewise< T >::offsetDomain(), result, and Geom::Path::size().
|
inline |
Definition at line 665 of file curve-curve-distance.cpp.
References distance(), Geom::Piecewise< T >::offsetDomain(), result, and Geom::Piecewise< T >::scaleDomain().
Definition at line 126 of file ray.h.
References Geom::Ray::nearestTime(), and Geom::Ray::pointAt().
|
inline |
Definition at line 465 of file line.h.
References distance(), Geom::BezierCurveN< degree >::nearestTime(), and Geom::BezierCurve::pointAt().
Minimum distance to rectangle, or infinity if empty.
Definition at line 198 of file rect.cpp.
References distance().
Minimum square of distance to rectangle, or infinity if empty.
Definition at line 193 of file rect.cpp.
References distanceSq().
Definition at line 158 of file rect.cpp.
References Geom::GenericRect< C >::bottom(), Geom::GenericRect< C >::left(), Geom::GenericRect< C >::right(), Geom::GenericRect< C >::top(), X, and Y.
Referenced by all_nearest_times(), Geom::xAx::allNearestTimes(), Geom::Path::allNearestTimes(), Geom::EllipticalArc::allNearestTimes(), Geom::Interpolate::CentripetalCatmullRomInterpolator::calc_bezier(), distanceSq(), nearest_time(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), wrap_point(), and wrap_rect().
Piecewise< SBasis > Geom::divide | ( | Piecewise< SBasis > const & | a, |
Piecewise< SBasis > const & | b, | ||
double | tol, | ||
unsigned | k, | ||
double | zero = 1.e-3 |
||
) |
Definition at line 49 of file piecewise.cpp.
References Geom::Piecewise< T >::concat(), Geom::Piecewise< T >::cuts, divide(), Geom::Piecewise< T >::setDomain(), and Geom::Piecewise< T >::size().
Piecewise< SBasis > Geom::divide | ( | Piecewise< SBasis > const & | a, |
Piecewise< SBasis > const & | b, | ||
unsigned | k | ||
) |
Definition at line 38 of file piecewise.cpp.
References Geom::Piecewise< T >::cuts, divide(), Geom::Piecewise< T >::push_seg(), and Geom::Piecewise< T >::size().
Piecewise< SBasis > Geom::divide | ( | Piecewise< SBasis > const & | a, |
SBasis const & | b, | ||
double | tol, | ||
unsigned | k, | ||
double | zero = 1.e-3 |
||
) |
Definition at line 60 of file piecewise.cpp.
References divide().
Definition at line 188 of file polynomial.cpp.
References c, Geom::Poly::degree(), Geom::Poly::normalize(), and Geom::Poly::shifted().
Piecewise< SBasis > Geom::divide | ( | SBasis const & | a, |
Piecewise< SBasis > const & | b, | ||
double | tol, | ||
unsigned | k, | ||
double | zero = 1.e-3 |
||
) |
Definition at line 63 of file piecewise.cpp.
References divide().
Piecewise< SBasis > Geom::divide | ( | SBasis const & | a, |
SBasis const & | b, | ||
double | tol, | ||
unsigned | k, | ||
double | zero = 1.e-3 |
||
) |
Definition at line 66 of file piecewise.cpp.
References Geom::SBasis::at0(), Geom::SBasis::at1(), c, compose(), Geom::Piecewise< T >::concat(), divide(), Geom::SBasis::resize(), Geom::Piecewise< T >::setDomain(), sgn(), shift(), and Geom::SBasis::tailError().
Compute a / b to k terms.
a,b | sbasis functions |
It is recommended to use the piecewise version unless you have good reason.
Definition at line 421 of file sbasis.cpp.
References c, Geom::SBasis::isZero(), multiply(), Geom::SBasis::resize(), shift(), Geom::SBasis::tailError(), and Geom::SBasis::truncate().
Definition at line 355 of file d2.h.
Referenced by Inkscape::CanvasItemGridXY::_render(), all_nearest_times(), ang(), Geom::Point::angle_between(), Geom::Piecewise< T >::arcLengthSb(), arcLengthSb2(), Geom::Line::are_orthogonal(), Geom::Piecewise< T >::centroid(), Geom::RatQuad::circularArc(), cubic_length_subdividing(), Geom::Piecewise< T >::curvature(), darray_left_tangent(), Geom::BezierFitter::darray_left_tangent(), darray_right_tangent(), Geom::BezierFitter::darray_right_tangent(), Geom::PlanarGraph< EdgeLabel >::deviatesLeft(), distance(), Geom::detail::bezier_clipping::distance_control_points(), distanceLessThanOrEqual(), DistanceToCubic(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::LPEExtrude::doEffect_pwd2(), Inkscape::LivePathEffect::LPELattice::doEffect_pwd2(), Inkscape::LivePathEffect::LPELattice2::doEffect_pwd2(), Geom::Piecewise< T >::dot(), Geom::Piecewise< T >::dot(), estimate_lengths(), Geom::BezierFitter::estimate_lengths(), extremePoints(), fill_line_in_rect(), find_ellipse(), Geom::D2< T >::find_normals(), Geom::D2< T >::find_normals_by_vector(), Geom::D2< T >::find_tangents_by_vector(), Geom::xAx::fromPoint(), Inkscape::LivePathEffect::LPEPts2Ellipse::genIsometricEllipse(), Inkscape::LivePathEffect::LPEPts2Ellipse::genSteinerEllipse(), goal_function(), Geom::BezierCurveN< degree >::intersect(), Box3D::Line::intersect(), intersect(), intersect_polish_root(), intersect_polish_root(), intersection(), Geom::detail::intersection_impl(), intersector_ccw(), Geom::Parallelogram::isSheared(), Inkscape::LivePathEffect::PowerStrokePointArrayParamKnotHolderEntity::knot_set(), L2(), Box3D::Line::lambda(), Geom::D2< T >::length_integrating(), lensq(), Geom::BezierFitter::lensq(), Box3D::Line::lie_on_same_side(), Box3D::lies_in_sector(), Box3D::Line::Line(), line_best_fit(), line_intersection(), line_segment_intersect(), line_twopoint_intersect(), md_sample_based(), Geom::ConvexHull::minAreaRotation(), Inkscape::UI::Handle::move(), nearest_time(), Geom::BezierCurveN< degree >::nearestTime(), Geom::Ray::nearestTime(), Geom::BezierFitter::NewtonRaphsonRootFind(), NewtonRaphsonRootFind(), Geom::Line::normalAndDist(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), RecDistanceToCubic(), rect_line_intersect(), Inkscape::SelTrans::rotateRequest(), segment_intersect(), Box3D::Line::set_direction(), Inkscape::PureRotateConstrained::storeTransform(), tighten(), tighten(), Geom::Line::timeAtProjection(), touching_circle(), Geom::xAx::translate(), triangulate(), and Geom::Piecewise< T >::unitVector().
|
related |
|
static |
For each intersection of some shape with the major axis of an ellipse, produce one or two intersections of a degenerate ellipse (collapsed onto that axis) with the same shape.
axis_intersections | The intersections of some shape with the major axis. |
vertical | Whether this is the vertical major axis (in the ellipse's natural coordinates). |
Definition at line 440 of file ellipse.cpp.
References axis_time_to_angles(), and result.
Referenced by Geom::Ellipse::intersect(), and Geom::Ellipse::intersect().
|
static |
Definition at line 238 of file geom.cpp.
References is_less(), and size.
Referenced by rect_line_intersect().
|
static |
Definition at line 263 of file basic-intersection.cpp.
Referenced by intersect_polish_root().
|
static |
Definition at line 116 of file path-intersection.cpp.
|
constexpr |
Definition at line 24 of file interval-test.cpp.
|
static |
Definition at line 492 of file bezier-utils.cpp.
References data, len, and num.
Referenced by generate_bezier().
|
static |
Definition at line 387 of file bezier-utils.cpp.
References data, distance(), dot(), len, and X.
Referenced by generate_bezier().
Definition at line 90 of file sbasis-2d.h.
Referenced by cairo_d2_sb2d(), cairo_sb2d(), and extract_u().
Definition at line 6 of file sbasis-2d.cpp.
References extract_u(), Geom::SBasis2d::index(), Geom::SBasis2d::us, and Geom::SBasis2d::vs.
Definition at line 96 of file sbasis-2d.h.
Referenced by cairo_d2_sb2d(), cairo_sb2d(), and extract_v().
Definition at line 23 of file sbasis-2d.cpp.
References extract_v(), Geom::SBasis2d::index(), Geom::SBasis2d::us, and Geom::SBasis2d::vs.
double Geom::f_interp | ( | double | x, |
void * | p | ||
) |
Definition at line 82 of file chebyshev.cpp.
Referenced by chebyshev_approximant_interpolating().
std::vector< std::vector< unsigned > > Geom::fake_cull | ( | unsigned | a, |
unsigned | b | ||
) |
Definition at line 130 of file sweep-bounds.cpp.
void Geom::filter_line_segment_intersections | ( | std::vector< ShapeIntersection > & | xs, |
bool | a = false , |
||
bool | b = true |
||
) |
Removes intersections outside of the unit interval.
A helper used to implement line segment intersections.
xs | Line intersections |
a | Whether the first time value has to be in the unit interval |
b | Whether the second time value has to be in the unit interval |
Definition at line 287 of file line.cpp.
References Geom::GenericInterval< C >::contains().
Referenced by Geom::Line::intersect(), and Geom::Circle::intersect().
void Geom::filter_ray_intersections | ( | std::vector< ShapeIntersection > & | xs, |
bool | a = false , |
||
bool | b = true |
||
) |
Definition at line 300 of file line.cpp.
Referenced by Geom::Line::intersect().
void Geom::find_bernstein_roots | ( | double const * | w, |
unsigned | degree, | ||
std::vector< double > & | solutions, | ||
unsigned | depth, | ||
double | left_t = 0 , |
||
double | right_t = 1 , |
||
bool | use_secant = true |
||
) |
Definition at line 45 of file solve-bezier-one-d.cpp.
References degree, solutions, and w.
Referenced by Geom::Bezier::roots().
void Geom::find_bernstein_roots | ( | std::vector< double > & | solutions, |
Geom::Bezier const & | bz, | ||
double | left_t, | ||
double | right_t | ||
) |
Definition at line 56 of file solve-bezier-one-d.cpp.
References Geom::Bezier::degree(), solutions, and w.
unsigned Geom::find_bottom_right | ( | ConvexHull const & | a | ) |
Definition at line 593 of file convex-hull.cpp.
References Geom::ConvexHull::size(), and Y.
void Geom::find_collinear_normal | ( | std::vector< std::pair< double, double > > & | xs, |
std::vector< Point > const & | A, | ||
std::vector< Point > const & | B, | ||
double | precision = EPSILON |
||
) |
Definition at line 1128 of file bezier-clipping.cpp.
Referenced by hausdorfl().
|
static |
Determine whether the d-coordinate increases or decreases at the given path time.
path | A path. |
time | A forward-normalized time on the given path. |
d | The coordinate about which we want to know whether it increases. |
Definition at line 59 of file path-extrema.cpp.
References Geom::Path::closed(), Geom::PathTime::curve_index, Geom::Path::curveAt(), Geom::Path::finalUnitTangent(), Geom::Path::initialUnitTangent(), sign(), Geom::Path::size(), Geom::PathTime::t, and Geom::Curve::unitTangentAt().
Referenced by Geom::Path::extrema().
document this! very quick: this finds the ellipse with minimum eccentricity passing through point P and Q, with tangent PO at P and QO at Q http://mathforum.org/kb/message.jspa?messageID=7471596&tstart=0
Definition at line 63 of file lpe-powerstroke.cpp.
References c, cross(), D, dot(), K, X, and Y.
Referenced by Inkscape::LivePathEffect::path_from_piecewise_fix_cusps().
void Geom::find_intersections | ( | std::vector< std::pair< double, double > > & | xs, |
D2< Bezier > const & | A, | ||
D2< Bezier > const & | B, | ||
double | precision = EPSILON |
||
) |
Definition at line 75 of file basic-intersection.cpp.
References bezier_points(), and find_intersections_bezier_clipping().
Referenced by Inkscape::LivePathEffect::LPEKnotNS::CrossingPoints::CrossingPoints(), find_self_intersections(), and Geom::BezierCurve::intersect().
void Geom::find_intersections | ( | std::vector< std::pair< double, double > > & | xs, |
D2< SBasis > const & | A, | ||
D2< SBasis > const & | B, | ||
double | precision = EPSILON |
||
) |
Definition at line 83 of file basic-intersection.cpp.
References find_intersections_bezier_clipping(), and sbasis_to_bezier().
void Geom::find_intersections | ( | std::vector< std::pair< double, double > > & | xs, |
std::vector< Point > const & | A, | ||
std::vector< Point > const & | B, | ||
double | precision = EPSILON |
||
) |
Definition at line 95 of file basic-intersection.cpp.
References find_intersections_bezier_clipping().
void Geom::find_intersections_bezier_clipping | ( | std::vector< std::pair< double, double > > & | xs, |
std::vector< Point > const & | A, | ||
std::vector< Point > const & | B, | ||
double | precision = EPSILON |
||
) |
Definition at line 1149 of file bezier-clipping.cpp.
Referenced by find_intersections(), find_intersections(), and find_intersections().
|
static |
Definition at line 449 of file recursive-bezier-intersection.cpp.
References intersect_BB(), recursively_intersect(), and wangs_theorem().
Referenced by find_intersections_bezier_recursive().
void Geom::find_intersections_bezier_recursive | ( | std::vector< std::pair< double, double > > & | xs, |
vector< Geom::Point > const & | A, | ||
vector< Geom::Point > const & | B, | ||
double | |||
) |
Definition at line 64 of file recursive-bezier-intersection.cpp.
References find_intersections_bezier_recursive().
void Geom::find_parametric_bezier_roots | ( | Geom::Point const * | w, |
unsigned | degree, | ||
std::vector< double > & | solutions, | ||
unsigned | depth | ||
) |
Definition at line 36 of file solve-bezier-parametric.cpp.
References casteljau_subdivision(), compute_x_intercept(), control_poly_flat_enough(), crossing_count(), degree, find_parametric_bezier_roots(), MAXDEPTH, solutions, total_steps, total_subs, w, and X.
Referenced by find_parametric_bezier_roots().
void Geom::find_self_intersections | ( | std::vector< std::pair< double, double > > & | xs, |
D2< Bezier > const & | A, | ||
double | precision = EPSILON |
||
) |
Definition at line 139 of file basic-intersection.cpp.
References derivative(), find_intersections(), portion(), Geom::Bezier::roots(), X, and Y.
void Geom::find_self_intersections | ( | std::vector< std::pair< double, double > > & | xs, |
D2< SBasis > const & | A, | ||
double | precision = EPSILON |
||
) |
Definition at line 192 of file basic-intersection.cpp.
References find_self_intersections(), and sbasis_to_bezier().
Referenced by Inkscape::LivePathEffect::LPEKnotNS::CrossingPoints::CrossingPoints(), and find_self_intersections().
void Geom::flip_crossings | ( | Crossings & | crs | ) |
Definition at line 687 of file path-intersection.cpp.
Referenced by crossings_among().
Piecewise< D2< SBasis > > Geom::force_continuity | ( | Piecewise< D2< SBasis > > const & | f, |
double | tol = 0 , |
||
bool | closed = false |
||
) |
Definition at line 169 of file d2-sbasis.cpp.
References c, Geom::SBasis::isZero(), and result.
Referenced by Inkscape::LivePathEffect::LPEBendPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::LPEEnvelope::doEffect_pwd2(), Inkscape::LivePathEffect::LPEPatternAlongPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPERecursiveSkeleton::doEffect_pwd2(), doEffect_pwd2(), and Inkscape::LivePathEffect::stretch_along().
std::string Geom::format_coord_nice | ( | Coord | x | ) |
Definition at line 89 of file coord.cpp.
References builder.
Referenced by IntersectionsValid(), ObjectNear(), ObjectNotNear(), operator<<(), operator<<(), operator<<(), Geom::Ellipse::operator<<(), Geom::EllipticalArc::operator<<(), Geom::Point::operator<<(), TEST(), TEST_F(), TEST_F(), TEST_F(), and VectorNear().
std::string Geom::format_coord_shortest | ( | Coord | x | ) |
Definition at line 77 of file coord.cpp.
References builder.
Referenced by Geom::SVGPathWriter::_formatCoord(), and TEST().
Creates a Affine given an axis and origin point.
The axis is represented as two vectors, which represent skew, rotation, and scaling in two dimensions. from_basis(Point(1, 0), Point(0, 1), Point(0, 0)) would return the identity matrix.
x_basis | the vector for the x-axis. |
y_basis | the vector for the y-axis. |
offset | the translation applied by the matrix. |
Definition at line 26 of file affine.cpp.
Referenced by Inkscape::LivePathEffect::findShadowedTime().
std::vector< Piecewise< D2< SBasis > > > Geom::fuse_nearby_ends | ( | std::vector< Piecewise< D2< SBasis > > > const & | f, |
double | tol = 0 |
||
) |
Definition at line 254 of file d2-sbasis.cpp.
References Geom::Piecewise< T >::concat(), Geom::Piecewise< T >::firstValue(), L2(), Geom::Piecewise< T >::lastValue(), result, Geom::Piecewise< T >::segs, set_first_point(), and set_last_point().
Referenced by Inkscape::LivePathEffect::LPEPatternAlongPath::doEffect_pwd2().
|
static |
Fill in bezier[] based on the given data and tangent requirements, using a least-squares fit.
Each of tHat1 and tHat2 should be either a zero vector or a unit vector. If it is zero, then bezier[1 or 2] is estimated without constraint; otherwise, it bezier[1 or 2] is placed in the specified direction from bezier[0 or 3].
tolerance_sq | Used only for an initial guess as to tangent directions when tHat1 or tHat2 is zero. |
Definition at line 360 of file bezier-utils.cpp.
References darray_left_tangent(), darray_right_tangent(), data, estimate_bi(), estimate_lengths(), is_zero(), len, and unit_vector().
Referenced by bezier_fit_cubic_full().
Definition at line 26 of file geom-nodetype.cpp.
References are_near(), L2(), NODE_CUSP, NODE_NONE, NODE_SMOOTH, Geom::Curve::pointAt(), Geom::Curve::reverse(), and Geom::Curve::unitTangentAt().
Referenced by Inkscape::LivePathEffect::LPEShowHandles::generateHelperPath(), Inkscape::LivePathEffect::return_at_first_cusp(), SPShape::snappoints(), and Inkscape::LivePathEffect::sp_spiro_do_effect().
ConvexHull Geom::graham_merge | ( | ConvexHull | a, |
ConvexHull | b | ||
) |
if we modified graham scan to work top to bottom as proposed in lect754.pdf we could replace the angle sort with a simple merge sort type algorithm. furthermore, we could do the graham scan online, avoiding a bunch of memory copies. That would probably be linear. – njh
Definition at line 687 of file convex-hull.cpp.
References Geom::ConvexHull::begin(), Geom::ConvexHull::end(), and result.
|
inline |
Definition at line 56 of file bezier-to-sbasis.h.
References bezier_to_sbasis(), and order.
double Geom::hausdorf | ( | D2< SBasis > & | A, |
D2< SBasis > const & | B, | ||
double | m_precision, | ||
double * | a_t = NULL , |
||
double * | b_t = NULL |
||
) |
Compute the symmetric Hausdorf distance.
Definition at line 451 of file basic-intersection.cpp.
References Geom::D2< T >::at0(), Geom::D2< T >::at1(), distance(), hausdorfl(), and nearest_time().
double Geom::hausdorfl | ( | D2< SBasis > & | A, |
D2< SBasis > const & | B, | ||
double | m_precision, | ||
double * | a_t = NULL , |
||
double * | b_t = NULL |
||
) |
Compute the Hausdorf distance from A to B only.
Definition at line 401 of file basic-intersection.cpp.
References Geom::D2< T >::at0(), Geom::D2< T >::at1(), distance(), find_collinear_normal(), nearest_time(), and sbasis_to_bezier().
Referenced by hausdorf().
|
related |
Create an identity matrix.
This is a convenience function identical to Affine::identity().
Definition at line 210 of file affine.h.
References Geom::Affine::identity().
Referenced by Inkscape::ObjectSnapper::_collectPaths(), Inkscape::Extension::Internal::SvgBuilder::_createClip(), Inkscape::Extension::Internal::SvgBuilder::_createGradient(), Inkscape::Extension::Internal::CairoRenderContext::_createPatternPainter(), Inkscape::Extension::Internal::SvgBuilder::_getClip(), BlurKnotHolderEntity::_pos(), Inkscape::CanvasItemRect::_render(), Inkscape::Extension::Internal::SvgBuilder::_shouldClip(), _ungroup_compensate_source_transform(), SPSymbol::bbox(), SPRoot::build(), Inkscape::ObjectSet::clearLastAffine(), ClipHistoryEntry::ClipHistoryEntry(), Inkscape::UI::Dialog::LivePathEffectEditor::clonetolpeitem(), Inkscape::AlignmentSnapper::constrainedSnap(), Inkscape::DistributionSnapper::constrainedSnap(), Inkscape::ObjectSnapper::constrainedSnap(), Inkscape::Pixbuf::create_from_buffer(), Inkscape::Pixbuf::create_from_data_uri(), Inkscape::Extension::Internal::SvgBuilder::cropPage(), ctmToAffine(), Inkscape::UI::Tools::do_trace(), Inkscape::LivePathEffect::LPETiling::doAfterEffect(), Inkscape::LivePathEffect::LPECopyRotate::doAfterEffect(), Inkscape::LivePathEffect::LPETiling::doBeforeEffect(), Inkscape::LivePathEffect::LPECopyRotate::doEffect_path_post(), Inkscape::LivePathEffect::LPETiling::doEffect_path_post(), Inkscape::LivePathEffect::LPECloneOriginal::doOnRemove(), Inkscape::LivePathEffect::LPETiling::doOnVisibilityToggled(), SPItem::doWriteTransform(), feed_path_to_cairo(), Inkscape::AlignmentSnapper::freeSnap(), Inkscape::DistributionSnapper::freeSnap(), Inkscape::ObjectSnapper::freeSnap(), generate_marker(), SPFilter::get_automatic_filter_region(), Inkscape::Pixbuf::get_embedded_orientation(), Inkscape::UI::Tools::MarkerTool::get_marker_transform(), Inkscape::Filters::FilterUnits::get_matrix_user2units(), SPUse::get_parent_transform(), SPViewBox::get_rctx(), Inkscape::LivePathEffect::PathParam::get_relative_affine(), SPUse::get_root_transform(), Inkscape::UI::Dialog::CloneTiler::get_transform(), SPGradient::getAllItemsBox(), SPItem::getClipPathVector(), Inkscape::PageManager::getSelectedPageAffine(), Inkscape::ObjectSet::group(), i2i_affine(), Inkscape::Extension::Internal::PdfBuilder::Document::item_to_transparency_group(), Inkscape::Extension::Internal::LaTeXTextRenderer::LaTeXTextRenderer(), Inkscape::LivePathEffect::SatelliteParam::linked_modified(), Inkscape::LivePathEffect::LPEBool::LPEBool(), Inkscape::Extension::Internal::PdfBuilder::DrawContext::paint_group(), Inkscape::Extension::Internal::PdfBuilder::DrawContext::paint_item(), Inkscape::Extension::Internal::PdfBuilder::DrawContext::paint_item_group(), Inkscape::Extension::Internal::PdfBuilder::DrawContext::paint_item_to_raster(), Inkscape::Extension::Internal::PdfBuilder::DrawContext::paint_raster(), path_simplify(), Inkscape::UI::PathManipulator::PathManipulator(), SPPattern::produce(), Inkscape::SelTrans::scaleRequest(), SPGradient::set(), SPItem::set(), SPPattern::set(), SPHatch::set(), SPBox3D::set_transform(), SPLine::set_transform(), SPPath::set_transform(), Inkscape::DrawingGroup::setChildTransform(), ClipHistoryEntry::setClip(), Inkscape::ObjectSet::setClipGroup(), Inkscape::UI::Tools::MeasureTool::setGuide(), Inkscape::DrawingPattern::setPatternToUserTransform(), Inkscape::UI::Widget::RegisteredTransformedPoint::setTransform(), Inkscape::DrawingItem::setTransform(), SPDocument::setupViewport(), Inkscape::BooleanBuilder::shape_commit(), Inkscape::SelTrans::skewRequest(), Inkscape::LivePathEffect::sp_bbox_without_clip(), sp_gradient_convert_to_userspace(), sp_image_set_curve(), sp_item_group_ungroup(), sp_item_transform_repr(), sp_selected_path_create_offset_object(), sp_selected_path_do_offset(), sp_svg_transform_read(), Inkscape::Extension::Internal::sp_symbol_render(), Inkscape::UI::Toolbar::ConnectorToolbar::spacing_changed(), SPGradient::SPGradient(), SPItem::SPItem(), Inkscape::LivePathEffect::LPESlice::splititem(), Inkscape::SelTrans::stamp(), Inkscape::SelTrans::stretchRequest(), Inkscape::Extension::Internal::PdfBuilder::Document::style_to_transparency_mask(), TEST(), Inkscape::ObjectSet::toSymbol(), Inkscape::DrawingItem::transform(), Inkscape::Extension::Internal::PdfBuilder::DrawContext::transform(), SPUse::unlink(), SPMarker::update(), SPClipPath::update_view(), and SPMask::update_view().
T Geom::idx_to_pair | ( | pair< T, T > | p, |
int | idx | ||
) |
Definition at line 646 of file convex-hull.cpp.
Referenced by merge().
iter Geom::inc | ( | iter const & | x, |
unsigned | n | ||
) |
Definition at line 410 of file path.cpp.
Referenced by Geom::PlanarGraph< EdgeLabel >::Vertex::_addIncidence(), Geom::PlanarGraph< EdgeLabel >::_purgeJunkIncidences(), Geom::Path::appendPortionTo(), and Geom::PlanarGraph< EdgeLabel >::nextIncidence().
Definition at line 294 of file bezier.cpp.
References Geom::Bezier::order().
Referenced by Geom::Piecewise< T >::arcLengthSb(), arcLengthSb2(), Geom::Piecewise< T >::atan2(), Geom::Piecewise< T >::centroid(), convole(), convole(), Inkscape::LivePathEffect::LPEDashedStroke::doEffect_path(), Inkscape::LivePathEffect::LPEPathLength::doEffect_pwd2(), integral(), Geom::Piecewise< T >::integral(), integral(), interpolate(), log(), main(), TEST_F(), TEST_F(), wrap_pw(), and xlogx().
Definition at line 456 of file d2.h.
References integral(), X, and Y.
Definition at line 133 of file polynomial.cpp.
References result.
Compute the integral of a (Exact)
a | sbasis functions |
Definition at line 299 of file sbasis.cpp.
References c, Geom::SBasis::normalize(), and Geom::SBasis::resize().
Definition at line 493 of file sbasis-of.h.
References c, Geom::HatOf< T >::d, and Geom::SBasisOf< T >::normalize().
Piecewise< SBasis > Geom::interpolate | ( | std::vector< double > | times, |
std::vector< double > | values, | ||
unsigned | smoothness | ||
) |
Returns a Piecewise SBasis with prescribed values at prescribed times.
times | vector of times at which the values are given. Should be sorted in increasing order. |
values | vector of prescribed values. Should have the same size as times and be sorted accordingly. |
smoothness | (defaults to 1) regularity class of the result: 0=piecewise linear, 1=continuous derivative, etc... |
Definition at line 349 of file sbasis-math.cpp.
References Geom::SBasis::at0(), Geom::SBasis::at1(), Geom::Piecewise< T >::cuts, integral(), result, reverse(), and shift().
Definition at line 361 of file conicsec.cpp.
References Geom::xAx::c, D, decompose_degenerate(), det3(), roots(), Geom::SBasis::valueAt(), and xAx_descr().
Referenced by Inkscape::DrawingItem::_renderOutline(), Geom::xAx::allNearestTimes(), Inkscape::LivePathEffect::complementOf(), Geom::RTree::find_enlargement(), intersect(), level_set(), level_sets(), monotonic_smash_intersect(), Inkscape::UI::Preview::render_preview(), smash_intersect(), Inkscape::UI::Dialog::sp_icon_doc_icon(), tighten(), tighten(), triangulate(), TYPED_TEST(), uncross(), and wrap_conic().
|
inline |
Definition at line 220 of file interval.h.
|
inline |
Definition at line 49 of file int-rect.h.
|
inline |
Definition at line 52 of file int-rect.h.
|
static |
Definition at line 303 of file d2-sbasis.cpp.
|
static |
Definition at line 149 of file intersection-by-smashing.cpp.
bool Geom::intersect_BB | ( | OldBezier | a, |
OldBezier | b | ||
) |
Definition at line 169 of file recursive-bezier-intersection.cpp.
Referenced by find_intersections_bezier_recursive(), and recursively_intersect().
|
static |
Definition at line 242 of file basic-intersection.cpp.
Referenced by intersect_polish_root(), and intersect_polish_root().
|
static |
Definition at line 139 of file path-intersection.cpp.
|
static |
we want to solve J*(x1 - x0) = f(x0)
|dA(s)[0] -dB(t)[0]| (X1 - X0) = A(s) - B(t) |dA(s)[1] -dB(t)[1]|
Definition at line 156 of file path-intersection.cpp.
References bs, dot(), intersect_polish_f(), Geom::Affine::inverse(), and Geom::Curve::pointAndDerivatives().
|
static |
we want to solve J*(x1 - x0) = f(x0)
|dA(s)[0] -dB(t)[0]| (X1 - X0) = A(s) - B(t) |dA(s)[1] -dB(t)[1]|
Definition at line 272 of file basic-intersection.cpp.
References bs, c, dot(), EpsilonBy(), intersect_polish_f(), Geom::Affine::inverse(), L1(), and Geom::D2< T >::valueAndDerivatives().
Referenced by mono_intersect(), pair_intersect(), and polish_intersections().
ConvexHull Geom::intersection | ( | ConvexHull | , |
ConvexHull | |||
) |
Definition at line 632 of file convex-hull.cpp.
OptCrossing Geom::intersection | ( | Line const & | l1, |
Line const & | l2 | ||
) |
Definition at line 446 of file line.cpp.
References c, distance(), Geom::detail::intersection_impl(), Geom::Line::origin(), and Geom::Line::vector().
|
inline |
Definition at line 564 of file line.h.
References Geom::detail::intersection_impl().
|
inline |
Definition at line 552 of file line.h.
References Geom::detail::intersection_impl().
LineSegment Geom::intersection | ( | Line | l, |
Rect | r | ||
) |
Definition at line 47 of file conicsec.cpp.
References Geom::Line::clip().
|
inline |
Definition at line 558 of file line.h.
References Geom::detail::intersection_impl().
OptCrossing Geom::intersection | ( | LineSegment const & | ls1, |
LineSegment const & | ls2 | ||
) |
Definition at line 499 of file line.cpp.
References are_near(), dot(), Geom::BezierCurve::finalPoint(), Geom::BezierCurve::initialPoint(), and Geom::detail::intersection_impl().
|
inline |
Definition at line 570 of file line.h.
References Geom::detail::intersection_impl().
|
inline |
Definition at line 545 of file line.h.
References Geom::detail::intersection_impl().
Referenced by Inkscape::CanvasItemGuideLine::_render(), avoid_item_poly(), box3d_half_line_crosses_joining_line(), Inkscape::LineSnapper::constrainedSnap(), curvature(), draw_ray(), Geom::CLIPPER_CLASS::find_inner_point(), Geom::RatQuad::fromPointsTangents(), Inkscape::GridSnapper::getSnapLinesAxonom(), Inkscape::SnappedLine::intersect(), Inkscape::SnappedLineSegment::intersect(), Inkscape::intersect_line_rectangle(), make_angle_bisector_line(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::projectPoint(), and Geom::xAx::toCurve().
|
inline |
Definition at line 577 of file line.h.
References Geom::detail::intersection_impl().
OptCrossing Geom::intersection | ( | Ray const & | r1, |
Ray const & | r2 | ||
) |
Definition at line 458 of file line.cpp.
References are_near(), Geom::detail::intersection_impl(), Geom::Ray::origin(), and Geom::Ray::vector().
|
static |
Find the point where two straight lines cross.
Definition at line 39 of file lpe-powerstroke.cpp.
References are_near(), and cross().
|
static |
Definition at line 24 of file geom-pathstroke.cpp.
References are_near(), cross(), and infinity().
Referenced by Inkscape::LivePathEffect::path_from_piecewise_fix_cusps().
int Geom::intersector_ccw | ( | const Geom::Point & | p0, |
const Geom::Point & | p1, | ||
const Geom::Point & | p2 | ||
) |
find the function a^-1 such that a^-1 composed with a to k terms is the identity function
a | sbasis function |
The function must have 'unit range'("a00 = 0 and a01 = 1") and be monotonic.
Definition at line 505 of file sbasis.cpp.
References c, multiply(), Geom::SBasis::resize(), Geom::SBasis::size(), Geom::SBasis::tailError(), and Geom::SBasis::truncate().
Definition at line 107 of file convex-hull.cpp.
Referenced by Geom::ConvexHull::_construct().
|
inlinestatic |
Definition at line 41 of file svg-path-writer.cpp.
References c.
Referenced by Geom::SVGPathWriter::flush().
Definition at line 225 of file geom.cpp.
Referenced by eliminate_duplicates_p().
Referenced by wrap_point().
|
related |
Referenced by Inkscape::UI::Tools::EraserTool::_apply(), Inkscape::UI::Tools::PencilTool::_fitAndSplit(), Inkscape::UI::Tools::PencilTool::_interpolate(), Inkscape::UI::Tools::PencilTool::_sketchInterpolate(), bezier_fit_cubic_full(), Geom::BezierFitter::bezier_fit_cubic_full(), generate_bezier(), Geom::BezierFitter::generate_bezier(), TEST_F(), and wrap_point().
Referenced by cairo_path_stitches(), decompose_degenerate(), distanceLessThanOrEqual(), intersect_polish_root(), and wrap_point().
double Geom::L2 | ( | D2< double > const & | a | ) |
Definition at line 42 of file d2-sbasis.cpp.
Referenced by Inkscape::UI::Tools::EraserTool::_addCap(), Inkscape::UI::Tools::EraserTool::_apply(), Inkscape::UI::Tools::EraserTool::_brush(), Inkscape::LivePathEffect::_circle3(), Inkscape::SelTrans::_keepClosestPointOnly(), Inkscape::UI::Tools::PenTool::_setAngleDistanceStatusMessage(), Inkscape::AlignmentSnapper::_snapBBoxPoints(), Inkscape::ObjectSnapper::_snapNodes(), Inkscape::ObjectSnapper::_snapPathsConstrained(), Inkscape::ObjectSnapper::_snapTranslatingGuide(), Geom::EllipticalArc::_updateCenterAndAngles(), Inkscape::UI::Tools::TextTool::_updateCursor(), Inkscape::UI::Tools::add_cap(), GrDrag::addDragger(), Box3D::VPDrag::addDragger(), GrDrag::addStopNearPoint(), Inkscape::UI::Tools::CalligraphicTool::apply(), arc_length_deriv(), box3d_snap(), cartesian_to_polar(), Geom::Point::constrain_angle(), Inkscape::LineSnapper::constrainedSnap(), Path::ConvertEvenLines(), curvature(), Path::CurvilignToPosition(), Path::DashSubPath(), dist_to(), distanceLessThanOrEqual(), Inkscape::LivePathEffect::LPECopyRotate::doBeforeEffect(), Inkscape::LivePathEffect::LPESimplify::doEffect(), Inkscape::LivePathEffect::LPECircleWithRadius::doEffect_path(), Inkscape::LivePathEffect::LPECurveStitch::doEffect_path(), Inkscape::LivePathEffect::LPERoughHatches::doEffect_pwd2(), Inkscape::LivePathEffect::LPECopyRotate::doOnApply(), Inkscape::UI::Tools::SpiralTool::drag(), Inkscape::UI::Tools::StarTool::drag(), draw_ratquad(), eat(), Inkscape::LineSnapper::freeSnap(), fuse_nearby_ends(), get_nodetype(), getClosestSP(), Inkscape::SnappedPoint::getDistanceToAlignTarget(), gr_knot_moved_handler(), gr_knot_moved_midpoint_handler(), Inkscape::UI::TransformHandle::grabbed(), Inkscape::LivePathEffect::LPEKnotNS::idx_of_nearest(), Inkscape::SnappedCurve::intersect(), Inkscape::SnappedLine::intersect(), Inkscape::SnappedCurve::intersect(), Inkscape::SnappedLineSegment::intersect(), Geom::Point::is_unit_vector(), Inkscape::SnappedPoint::isOtherSnapBetter(), Inkscape::ObjectSnapper::isUnselectedNode(), item_find_paths(), Box3D::Line::lambda(), Path::Length(), Inkscape::Display::SnapIndicator::make_alignment_indicator(), Shape::MakeOffset(), Shape::MakeTweak(), Inkscape::Rubberband::move(), SnapManager::multipleConstrainedSnaps(), nearest_after(), neighbors(), Inkscape::UI::Dialog::SpellCheck::nextWord(), Inkscape::UI::Widget::Rotateable::on_motion(), Geom::Ellipse::operator*=(), Path::PositionToLength(), Inkscape::Snapper::SnapConstraint::projection(), Box3D::Line::pts_coincide(), Inkscape::LivePathEffect::LPERoughHatches::resetDefaults(), Inkscape::Selection::rotateAnchored(), Inkscape::SelTrans::rotateRequest(), GrDrag::selectByCoords(), Geom::xAx::set(), Geom::xAx::set(), Proj::TransfMat3x4::set_infinite_direction(), Inkscape::PureRotateConstrained::snap(), Inkscape::PureTransform::snap(), Inkscape::UI::Tools::ToolBase::snap_delay_handler(), sort_nearest_bis(), sp_item_gradient_set_coords(), sp_star_get_curvepoint(), Inkscape::UI::Tools::sp_tweak_color_recursive(), Inkscape::UI::Tools::sp_tweak_dilate_recursive(), split_at_discontinuities(), Inkscape::PureScale::storeTransform(), Inkscape::PureRotateConstrained::storeTransform(), Inkscape::UI::Tools::tweak_colors_in_gradient(), and Box3D::vp_knot_moved_handler().
Definition at line 344 of file sbasis-geometric.cpp.
References arcLengthSb(), and length().
|
inline |
Definition at line 348 of file bezier-curve.h.
References distance(), Geom::BezierCurve::finalPoint(), and Geom::BezierCurve::initialPoint().
Referenced by Inkscape::LivePathEffect::LPERoughen::addNodesAndJitter(), Geom::Piecewise< T >::arcLengthSb(), arcLengthSb2(), Inkscape::LivePathEffect::LPEEmbroderyStitchOrdering::AssertIsTour(), bezier_line_intersections(), create_bezier(), Inkscape::UI::Tools::LpeTool::create_measuring_items(), Inkscape::LivePathEffect::LPEMeasureSegments::createTextLabel(), cubics_with_prescribed_curvature(), Inkscape::LivePathEffect::LPEMeasureSegments::doBeforeEffect(), Inkscape::LivePathEffect::LPEAttachPath::doEffect(), Inkscape::LivePathEffect::LPERoughen::doEffect(), Inkscape::LivePathEffect::LPEDashedStroke::doEffect_path(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEPathLength::doEffect_pwd2(), draw_segment(), Inkscape::LivePathEffect::LPEEmbroderyStitchOrdering::FindShortestReconnect(), length(), length(), Geom::detail::bezier_clipping::orientation_line(), Geom::CLIPPER_CLASS::rsplit(), sb_seg_to_bez(), Inkscape::LivePathEffect::TextParam::setPosAndAnchor(), Inkscape::UI::Tools::MeasureTool::showInfoBox(), Geom::Line::transformTo(), unitTangentAt(), and Inkscape::UI::Tools::LpeTool::update_measuring_items().
Definition at line 350 of file sbasis-geometric.cpp.
References arcLengthSb(), and length().
|
related |
Referenced by Geom::D2< T >::length(), and Geom::Piecewise< T >::length().
|
static |
Definition at line 487 of file bezier-utils.cpp.
References dot().
Referenced by compute_max_error_ratio(), and NewtonRaphsonRootFind().
|
inline |
Definition at line 43 of file linear-of.h.
|
inline |
Definition at line 47 of file linearN.h.
Referenced by Geom::LinearN< n >::valueAt().
Definition at line 322 of file d2-sbasis.cpp.
References Geom::GenericRect< C >::expandBy(), and level_set().
Definition at line 318 of file d2-sbasis.cpp.
References level_sets().
Referenced by level_set(), level_set(), level_set(), level_set(), linearizeCusps(), monotonic_smash_intersect(), and smash_intersect().
std::vector< Interval > Geom::level_set | ( | Piecewise< SBasis > const & | f, |
double | v, | ||
double | vtol, | ||
double | tol = 1e-5 |
||
) |
Definition at line 250 of file piecewise.cpp.
References level_set().
std::vector< Interval > Geom::level_set | ( | Piecewise< SBasis > const & | f, |
Interval const & | level, | ||
double | tol = 1e-5 |
||
) |
Definition at line 231 of file piecewise.cpp.
References Geom::Piecewise< T >::cuts, level_set(), result, and Geom::Piecewise< T >::size().
std::vector< Interval > Geom::level_set | ( | SBasis const & | f, |
double | level, | ||
double | vtol = 1e-5 , |
||
double | a = 0. , |
||
double | b = 1. , |
||
double | tol = 1e-5 |
||
) |
Solve f(t) = v +/- tolerance.
The collection of intervals where v - vtol <= f(t) <= v+vtol is returned (with a precision tol on the boundaries).
f | sbasis function |
level | the value of v. |
vtol | error tolerance on v. |
a,b | limit search on domain [a,b] |
tol | tolerance on the result bounds. |
std::vector< Interval > Geom::level_set | ( | SBasis const & | f, |
Interval const & | level, | ||
double | a = 0. , |
||
double | b = 1. , |
||
double | tol = 1e-5 |
||
) |
Solve f(t)\in I=[u,v], which defines a collection of intervals (J_k).
More precisely, a collection (J'_k) is returned with J'_k = J_k up to a given tolerance.
f | sbasis function |
level | the given interval of deisred values for f. |
a,b | limit search on domain [a,b] |
tol | tolerance on the bounds of the result. |
std::vector< std::vector< Interval > > Geom::level_sets | ( | D2< SBasis > const & | f, |
std::vector< Point > | pts, | ||
double | tol | ||
) |
Definition at line 342 of file d2-sbasis.cpp.
References level_sets().
std::vector< std::vector< Interval > > Geom::level_sets | ( | D2< SBasis > const & | f, |
std::vector< Rect > | regions | ||
) |
Definition at line 327 of file d2-sbasis.cpp.
References intersect(), level_sets(), result, X, and Y.
Referenced by level_set(), level_sets(), and level_sets().
std::vector< std::vector< Interval > > Geom::level_sets | ( | SBasis const & | f, |
std::vector< double > const & | levels, | ||
double | a = 0. , |
||
double | b = 1. , |
||
double | vtol = 1e-5 , |
||
double | tol = 1e-5 |
||
) |
'Solve' f(t) = v +/- tolerance for several values of v at once.
f | sbasis function |
levels | vector of values, that should be sorted. |
vtol | error tolerance on v. |
a,b | limit search on domain [a,b] |
tol | the bounds of the returned intervals are exact up to that tolerance. |
std::vector< std::vector< Interval > > Geom::level_sets | ( | SBasis const & | f, |
std::vector< Interval > const & | levels, | ||
double | a = 0. , |
||
double | b = 1. , |
||
double | tol = 1e-5 |
||
) |
'Solve' f(t)\in I=[u,v] for several intervals I at once.
f | sbasis function |
levels | vector of 'y' intervals, that should be disjoints and sorted. |
a,b | limit search on domain [a,b] |
tol | the bounds of the returned intervals are exact up to that tolerance. |
IntersectorKind Geom::line_intersection | ( | Geom::Point const & | n0, |
double const | d0, | ||
Geom::Point const & | n1, | ||
double const | d1, | ||
Geom::Point & | result | ||
) |
Finds the intersection of the two (infinite) lines defined by the points p such that dot(n0, p) == d0 and dot(n1, p) == d1.
If the two lines intersect, then result becomes their point of intersection; otherwise, result remains unchanged.
This function finds the intersection of the two lines (infinite) defined by n0.X = d0 and x1.X = d1. The algorithm is as follows: To compute the intersection point use kramer's rule:
* convert lines to form * ax + by = c * dx + ey = f * * ( * e.g. a = (x2 - x1), b = (y2 - y1), c = (x2 - x1)*x1 + (y2 - y1)*y1 * ) * * In our case we use: * a = n0.x d = n1.x * b = n0.y e = n1.y * c = d0 f = d1 * * so: * * adx + bdy = cd * adx + aey = af * * bdy - aey = cd - af * (bd - ae)y = cd - af * * y = (cd - af)/(bd - ae) * * repeat for x and you get: * * x = (fb - ce)/(bd - ae)
If the denominator (bd-ae) is 0 then the lines are parallel, if the numerators are 0 then the lines coincide.
Definition at line 67 of file geom.cpp.
References coincident, dot(), intersects, n1, parallel, result, rot90(), X, and Y.
Referenced by draw_line_in_rect(), line_segment_intersect(), line_twopoint_intersect(), segment_intersect(), and tighten().
IntersectorKind Geom::line_segment_intersect | ( | Geom::Point const & | p00, |
Geom::Point const & | p01, | ||
Geom::Point const & | p10, | ||
Geom::Point const & | p11, | ||
Geom::Point & | result | ||
) |
Determine whether & where a line segments intersects an (infinite) line.
If there is no intersection, then result remains unchanged.
Definition at line 164 of file geom.cpp.
References dot(), line_intersection(), line_segment_intersectp(), n1, no_intersection, and result.
Referenced by rect_line_intersect().
bool Geom::line_segment_intersectp | ( | Geom::Point const & | p00, |
Geom::Point const & | p01, | ||
Geom::Point const & | p10, | ||
Geom::Point const & | p11 | ||
) |
Determine whether the line segment from p00 to p01 intersects the infinite line passing through p10 and p11.
This doesn't find the point of intersection, use the line_intersect function above, or the segment_intersection interface below.
Definition at line 128 of file geom.cpp.
References intersector_ccw().
Referenced by line_segment_intersect(), and segment_intersectp().
IntersectorKind Geom::line_twopoint_intersect | ( | Geom::Point const & | p00, |
Geom::Point const & | p01, | ||
Geom::Point const & | p10, | ||
Geom::Point const & | p11, | ||
Geom::Point & | result | ||
) |
bool Geom::linear_intersect | ( | Point const & | A0, |
Point const & | A1, | ||
Point const & | B0, | ||
Point const & | B1, | ||
double & | tA, | ||
double & | tB, | ||
double & | det | ||
) |
Finds the intersection between the lines defined by A0 & A1, and B0 & B1.
Returns through the last 3 parameters, returning the t-values on the lines and the cross-product of the deltas (a useful byproduct). The return value indicates if the time values are within their proper range on the line segments.
Definition at line 76 of file path-intersection.cpp.
References are_near(), cross(), det(), and Geom::Point::length().
Referenced by mono_intersect(), mono_pair(), and pair_intersect().
Referenced by Inkscape::UI::Tools::PenTool::_handleMotionNotify(), Inkscape::UI::Tools::PencilTool::_handleMotionNotify(), Inkscape::UI::Widget::CanvasGrid::_rulerMotion(), Inkscape::UI::Tools::ToolBase::checkDragMoved(), Path::ConvertEvenLines(), Path::ConvertPositionsToMoveTo(), SPKnot::eventHandler(), Path::Fill(), Inkscape::UI::Tools::in_svg_plane(), Inkscape::UI::Tools::MeasureTool::root_handler(), Inkscape::UI::Tools::SprayTool::root_handler(), Inkscape::Selection::setAnchor(), Path::Stroke(), and wrap_point().
double Geom::Lmax | ( | Point | p | ) |
Definition at line 315 of file recursive-bezier-intersection.cpp.
Referenced by desy_lambert_W(), exp_sample_based(), log(), log4(), log_sample_based(), trial_eval(), and xlogx().
|
inline |
Definition at line 305 of file recursive-bezier-intersection.cpp.
References log().
Definition at line 569 of file line.cpp.
References angle_between(), intersection(), make_angle_bisector_line(), Geom::Line::pointAt(), and Geom::Line::vector().
Definition at line 504 of file line.h.
References Geom::AngleInterval::angleAt().
Referenced by make_angle_bisector_line(), and TEST().
Returns the angle bisector for the two given rays.
r1 is rotated half the way to r2 in either clockwise or counter-clockwise direction.
true
, the returned ray will equal the passed rays r1 and r2.false
, the returned ray will go in the opposite direction.RangeError | if the given rays do not have the same origins |
Definition at line 167 of file ray.h.
References angle_between(), are_near(), Geom::Ray::origin(), Geom::Ray::reverse(), and Geom::Ray::vector().
Referenced by wrap_ray().
|
inline |
Definition at line 497 of file line.h.
References make_orthogonal_line(), and middle_point().
Referenced by Geom::CLIPPER_CLASS::find_inner_point_by_bisector_line(), and Geom::xAx::toCurve().
Definition at line 75 of file d2-sbasis.cpp.
Referenced by bend(), Inkscape::LivePathEffect::bend(), computeLinfinityNeighborhood(), computeLinfinityNeighborhood(), Inkscape::LivePathEffect::LPECurveStitch::doEffect_path(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEBendPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::LPEEnvelope::doEffect_pwd2(), Inkscape::LivePathEffect::LPEPatternAlongPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPERecursiveSkeleton::doEffect_pwd2(), doEffect_pwd2(), Inkscape::LivePathEffect::LPERoughHatches::linearSnake(), linearSnake(), Inkscape::LivePathEffect::LPECurveStitch::resetDefaults(), Inkscape::LivePathEffect::stretch_along(), and wrap_pw().
bool Geom::make_elliptical_arc | ( | EllipticalArc & | ea, |
Point const & | centre, | ||
Point const & | initial, | ||
Point const & | final, | ||
Point const & | inner | ||
) |
Definition at line 43 of file elliptiarc-3point-center-fitting.cpp.
References angle_between(), are_near(), inner(), make_elliptical_arc(), Geom::EllipticalArc::set(), Geom::NL::detail::MatrixImpl::set_all(), Geom::NL::LinearSystem::solution(), Geom::NL::LinearSystem::SV_solve(), Geom::Exception::what(), X, and Y.
Referenced by Geom::EllipticalArc::arc_from_sbasis(), and make_elliptical_arc().
Definition at line 479 of file line.h.
References Geom::Point::cw(), and Geom::Line::vector().
Referenced by make_bisector_line().
Definition at line 488 of file line.h.
References result.
Referenced by Inkscape::CanvasItemGridXY::_render().
MultiDegree< n > Geom::max | ( | MultiDegree< n > const & | p, |
MultiDegree< n > const & | q | ||
) |
Returns the maximal degree appearing in the two arguments for each variables.
Definition at line 158 of file sbasisN.h.
References max(), and Geom::MultiDegree< n >::p.
Referenced by Geom::SBasisN< n >::appendCoef(), Geom::xAx::arc_bound(), are_equal(), are_equal(), between(), Geom::LinearN< n >::bounds_exact(), choose(), Geom::Line::clip(), Inkscape::LivePathEffect::complementOf(), Geom::GenericRect< C >::corner(), Inkscape::LivePathEffect::LPETiling::doAfterEffect(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPETiling::doEffect_path_post(), dot_plot(), dot_plot(), extremePoints(), goal_function(), Geom::GenericRect< C >::infinite(), Geom::RedBlackTree::insert(), linearizeCusps(), max(), max(), max(), max(), max(), min(), min(), min(), min(), monotonic_smash_intersect(), operator+(), reverse_ta(), reverse_ta(), reverse_tb(), reverse_tb(), Inkscape::LivePathEffect::ScalarArrayParam::ScalarArrayParam(), Inkscape::LivePathEffect::ScalarParam::ScalarParam(), Geom::RedBlackTree::search(), smash_intersect(), sqrt(), sqrt(), sweep_bounds(), sweep_bounds(), TEST(), TEST(), TEST_F(), and TEST_F().
Return the greater of the two functions pointwise.
f,g | two functions |
Definition at line 87 of file sbasis-math.cpp.
References Geom::Piecewise< T >::cuts, max(), roots(), and Geom::Piecewise< T >::segs.
Return the greater of the two functions pointwise.
f,g | two functions |
Definition at line 75 of file sbasis-math.cpp.
References max().
Return the greater of the two functions pointwise.
f,g | two functions |
Definition at line 81 of file sbasis-math.cpp.
References max().
Return the greater of the two functions pointwise.
f,g | two functions |
Definition at line 69 of file sbasis-math.cpp.
References max().
ConvexHull Geom::merge | ( | ConvexHull | a, |
ConvexHull | b | ||
) |
Definition at line 653 of file convex-hull.cpp.
References bridges(), idx_to_pair(), limit, Geom::ConvexHull::size(), size, and Y.
Definition at line 128 of file crossing.cpp.
References sort_crossings().
Referenced by Geom::MonoCrosser::crossings(), and crossings_among().
|
inline |
Definition at line 344 of file bezier-curve.h.
References Geom::BezierCurve::finalPoint(), and Geom::BezierCurve::initialPoint().
Referenced by Inkscape::UI::Tools::EraserTool::_brush(), Geom::EllipticalArc::_updateCenterAndAngles(), Geom::CLIPPER_CLASS::clip(), Geom::detail::bezier_clipping::clip< intersection_point_tag >(), Geom::PlanarGraph< EdgeLabel >::deviatesLeft(), Inkscape::LivePathEffect::LPEMeasureSegments::doBeforeEffect(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doBeforeEffect(), Inkscape::LivePathEffect::LPESlice::doBeforeEffect(), Inkscape::LivePathEffect::LPECopyRotate::doEffect_path(), Inkscape::LivePathEffect::LPEFilletChamfer::doEffect_path(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Geom::CLIPPER_CLASS::find_inner_point(), Inkscape::LivePathEffect::LPEPts2Ellipse::genFitEllipse(), Geom::BezierCurveN< degree >::intersect(), Geom::Ellipse::intersect(), Geom::CLIPPER_CLASS::intersect(), Geom::detail::bezier_clipping::iterate< intersection_point_tag >(), Inkscape::UI::MultiPathManipulator::joinNodes(), make_bisector_line(), Inkscape::UI::Tools::PagesTool::middleOfSide(), Geom::EllipticalArc::operator*=(), parting_point(), Inkscape::UI::TransformHandleSet::setBounds(), SPShape::snappoints(), Inkscape::LivePathEffect::LPESlice::splititem(), TEST(), Inkscape::UI::Tools::MeasureTool::toMarkDimension(), and Inkscape::UI::PathManipulator::weldNodes().
Return the more negative of the two functions pointwise.
f,g | two functions |
Definition at line 116 of file sbasis-math.cpp.
Return the more negative of the two functions pointwise.
f,g | two functions |
Definition at line 106 of file sbasis-math.cpp.
Return the more negative of the two functions pointwise.
f,g | two functions |
Definition at line 111 of file sbasis-math.cpp.
Return the more negative of the two functions pointwise.
f,g | two functions |
Definition at line 101 of file sbasis-math.cpp.
Referenced by approx_min(), Geom::xAx::arc_bound(), between(), Geom::LinearN< n >::bounds_exact(), Geom::Line::clip(), Inkscape::LivePathEffect::complementOf(), Geom::GenericRect< C >::corner(), Inkscape::LivePathEffect::LPETiling::doAfterEffect(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPETiling::doEffect_path_post(), dot_plot(), extremePoints(), Geom::GenericRect< C >::infinite(), Geom::RedBlackTree::insert(), linearizeCusps(), min(), min(), min(), min(), monotonic_smash_intersect(), Inkscape::LivePathEffect::ScalarArrayParam::ScalarArrayParam(), Inkscape::LivePathEffect::ScalarParam::ScalarParam(), Geom::RedBlackTree::search(), smash_intersect(), sweep_bounds(), sweep_bounds(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and wrap_sbasis().
int Geom::mod | ( | int | i, |
int | l | ||
) |
Definition at line 416 of file convex-hull.cpp.
void Geom::mono_intersect | ( | Curve const & | A, |
double | Al, | ||
double | Ah, | ||
Curve const & | B, | ||
double | Bl, | ||
double | Bh, | ||
Crossings & | ret, | ||
double | tol = 0.1 , |
||
unsigned | depth = 0 |
||
) |
Definition at line 301 of file path-intersection.cpp.
References c, intersect_polish_root(), Geom::GenericRect< C >::intersects(), linear_intersect(), Geom::GenericRect< C >::maxExtent(), mono_intersect(), and Geom::Curve::pointAt().
Crossings Geom::mono_intersect | ( | Curve const & | A, |
Interval const & | Ad, | ||
Curve const & | B, | ||
Interval const & | Bd | ||
) |
Definition at line 339 of file path-intersection.cpp.
References Geom::GenericInterval< C >::max(), Geom::GenericInterval< C >::min(), and mono_intersect().
Referenced by mono_intersect(), and mono_intersect().
void Geom::mono_pair | ( | Path const & | A, |
double | Al, | ||
double | Ah, | ||
Path const & | B, | ||
double | Bl, | ||
double | Bh, | ||
Crossings & | ret, | ||
double | , | ||
unsigned | depth = 0 |
||
) |
Takes two paths and time ranges on them, with the invariant that the paths are monotonic on the range.
Splits A when the linear intersection doesn't exist or is inaccurate. Uses the fact that it is monotonic to do very fast local bounds.
Definition at line 352 of file path-intersection.cpp.
References c, Geom::GenericRect< C >::intersects(), linear_intersect(), Geom::GenericRect< C >::maxExtent(), mono_pair(), and Geom::Path::pointAt().
Referenced by Geom::MonoCrosser::crossings(), and mono_pair().
std::vector< SmashIntersection > Geom::monotonic_smash_intersect | ( | D2< SBasis > const & | a, |
D2< SBasis > const & | b, | ||
double | tol | ||
) |
Definition at line 170 of file intersection-by-smashing.cpp.
References Geom::D2< T >::at0(), Geom::D2< T >::at1(), bounds_exact(), bounds_fast(), compose(), computeLinfinityNeighborhood(), derivative(), Geom::Piecewise< T >::domain(), infinity(), intersect(), Geom::GenericOptRect< C >::intersects(), level_set(), Geom::GenericInterval< C >::max(), max(), Geom::GenericInterval< C >::min(), min(), portion(), prolongateByConstants(), pw_compose_inverse(), result, Geom::D2< T >::valueAt(), X, and Y.
Referenced by monotonic_smash_intersect(), and smash_intersect().
Definition at line 73 of file intersection-by-smashing.cpp.
References derivative(), result, roots(), X, and Y.
Referenced by smash_intersect().
std::vector< std::vector< double > > Geom::multi_roots | ( | Piecewise< SBasis > const & | f, |
std::vector< double > const & | values | ||
) |
Definition at line 217 of file piecewise.cpp.
References Geom::Piecewise< T >::mapToDomain(), multi_roots(), result, Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::size().
std::vector< std::vector< double > > Geom::multi_roots | ( | SBasis const & | f, |
std::vector< double > const & | levels, | ||
double | htol = 1e-7 , |
||
double | vtol = 1e-7 , |
||
double | a = 0 , |
||
double | b = 1 |
||
) |
std::vector< std::vector< double > > Geom::multi_roots | ( | SBasisN< n > const & | f, |
std::vector< double > const & | levels, | ||
double | htol = 1e-7 , |
||
double | vtol = 1e-7 , |
||
double | a = 0 , |
||
double | b = 1 |
||
) |
Definition at line 337 of file bezier.h.
References result.
Referenced by array_roots(), bezier_to_sbasis(), Geom::Piecewise< T >::centroid(), compose(), compose(), compose(), compose(), compose(), compose(), compose(), compose(), divide(), inverse(), main(), multi_compose(), multiply(), multiply(), nearest_time(), operator*(), operator*(), operator*(), operator*(), operator*(), operator*=(), operator*=(), operator*=(), poly_to_sbasis(), sqrt(), sqrt_internal(), TEST_F(), and TEST_F().
Definition at line 44 of file d2-sbasis.cpp.
References multiply(), X, and Y.
Definition at line 48 of file d2-sbasis.cpp.
References multiply(), X, and Y.
Compute the pointwise product of a and b (Exact)
a,b | sbasis functions |
Definition at line 228 of file sbasis.cpp.
References c, Geom::SBasis::isZero(), Geom::SBasis::normalize(), and Geom::SBasis::size().
Definition at line 873 of file sbasisN.h.
References c, Geom::MultiDegree< n >::p, Geom::SBasisN< n >::real_t_degrees(), sign(), and Geom::SBasisN< n >::sizes.
SBasisOf< T > Geom::multiply | ( | SBasisOf< T > const & | a, |
SBasisOf< T > const & | b | ||
) |
Definition at line 485 of file sbasis-of.h.
References c, Geom::SBasisOf< T >::isZero(), and multiply_add().
Compute the pointwise product of a and b adding c (Exact)
a,b,c | sbasis functions |
The added term is almost free
Definition at line 259 of file sbasis.cpp.
References c, Geom::SBasis::isZero(), Geom::SBasis::normalize(), Geom::SBasis::resize(), and Geom::SBasis::size().
SBasisN< n > Geom::multiply_add | ( | SBasisN< n > const & | a, |
SBasisN< n > const & | b, | ||
SBasisN< n > | c | ||
) |
SBasisOf< T > Geom::multiply_add | ( | SBasisOf< T > const & | a, |
SBasisOf< T > const & | b, | ||
SBasisOf< T > | c | ||
) |
Definition at line 463 of file sbasis-of.h.
References c, Geom::SBasisOf< T >::isZero(), and Geom::SBasisOf< T >::normalize().
Referenced by compose(), compose(), compose(), compose(), and multiply().
Definition at line 354 of file curve.h.
References c.
Referenced by Inkscape::UI::PathManipulator::_bsplineHandlePosition(), dist_test(), Inkscape::LivePathEffect::LPERoughen::doEffect(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), hausdorf(), hausdorfl(), Inkscape::LivePathEffect::FilletChamferKnotHolderEntity::knot_get(), Inkscape::LivePathEffect::FilletChamferKnotHolderEntity::knot_set(), Inkscape::LivePathEffect::PowerStrokePointArrayParamKnotHolderEntity::knot_set(), nearest_time(), nearest_time(), nearest_time(), Geom::Curve::nearestTime(), Geom::BezierCurve::nearestTime(), Geom::SBasisCurve::nearestTime(), Inkscape::LivePathEffect::PowerStrokePointArrayParam::reverse_controlpoints(), NodeSatellite::setPosition(), and Inkscape::LivePathEffect::sp_bspline_do_effect().
Coord Geom::nearest_time | ( | Point const & | p, |
D2< Bezier > const & | bez, | ||
Coord | from = 0 , |
||
Coord | to = 1 |
||
) |
Definition at line 40 of file nearest-time.cpp.
References Geom::D2< T >::at0(), Geom::D2< T >::at1(), derivative(), infinity(), Geom::D2< T >::isConstant(), Geom::GenericInterval< C >::max(), Geom::GenericInterval< C >::min(), multiply(), portion(), roots(), Geom::Interval::valueAt(), Geom::D2< T >::valueAt(), X, and Y.
double Geom::nearest_time | ( | Point const & | p, |
D2< SBasis > const & | c, | ||
D2< SBasis > const & | deriv, | ||
double | from = 0 , |
||
double | to = 1 |
||
) |
Definition at line 103 of file nearest-time.cpp.
|
inline |
Definition at line 76 of file nearest-time.h.
References c, derivative(), and nearest_time().
Definition at line 868 of file path.h.
References c, Geom::PathTime::curve_index, and Geom::PathTime::t.
Definition at line 111 of file nearest-time.h.
References c, and nearest_time().
double Geom::nearest_time | ( | Point const & | p, |
Piecewise< D2< SBasis > > const & | c, | ||
double | from, | ||
double | to | ||
) |
Definition at line 192 of file nearest-time.cpp.
References bounds_fast(), c, distanceSq(), and nearest_time().
Definition at line 54 of file nearest-time.h.
Definition at line 360 of file curve.h.
References c, and Geom::Curve::duplicate().
|
static |
Use Newton-Raphson iteration to find better root.
Q | Current fitted curve |
P | Digitized point |
u | Parameter value for "P" |
Definition at line 567 of file bezier-utils.cpp.
References bezier_pt(), dot(), and lensq().
Referenced by reparameterize().
bool Geom::non_collinear_segments_intersect | ( | const Point & | A, |
const Point & | B, | ||
const Point & | C, | ||
const Point & | D | ||
) |
Check if two line segments intersect.
If they are collinear, the result is undefined.
Definition at line 477 of file basic-intersection.cpp.
Referenced by Geom::Parallelogram::intersects().
void Geom::offset_crossings | ( | Crossings & | cr, |
double | a, | ||
double | b | ||
) |
Definition at line 136 of file crossing.cpp.
Referenced by curve_sweep(), and self_crossings().
std::vector< double > Geom::offset_doubles | ( | std::vector< double > const & | x, |
double | offs | ||
) |
Convenience function to add a value to each entry in a vector of doubles.
Definition at line 398 of file path-intersection.cpp.
Referenced by path_mono_splits().
Definition at line 140 of file sbasis-2d.h.
|
inline |
Definition at line 213 of file linear-of.h.
|
inline |
Definition at line 44 of file int-rect.h.
References Geom::GenericOptRect< C >::intersectWith().
Definition at line 245 of file rect.h.
References Geom::GenericOptRect< C >::intersectWith().
Definition at line 221 of file bezier.cpp.
References binomial_increment_k(), and Geom::Bezier::order().
Definition at line 197 of file polynomial.h.
Definition at line 146 of file sbasis-2d.h.
Definition at line 221 of file sbasis-of.h.
Definition at line 497 of file d2.h.
References multiply().
Definition at line 222 of file linear-of.h.
Definition at line 158 of file d2-sbasis.cpp.
References Geom::Piecewise< T >::push_cut(), and result.
Definition at line 499 of file d2.h.
References multiply().
Compute the pointwise product of a and b (Exact)
a,b | sbasis functions |
Definition at line 170 of file sbasis.cpp.
References c, and Geom::SBasis::size().
Definition at line 380 of file sbasis.h.
References multiply().
Definition at line 683 of file sbasisN.h.
References c, Geom::SBasisN< n >::isZero(), result, and Geom::SBasisN< n >::sizes.
|
inline |
Definition at line 947 of file sbasisN.h.
References multiply().
Definition at line 211 of file sbasis-of.h.
References c.
|
inline |
Definition at line 552 of file sbasis-of.h.
References multiply().
Definition at line 128 of file sbasis-2d.h.
Definition at line 230 of file linear-of.h.
Definition at line 637 of file piecewise.h.
References Geom::Piecewise< T >::size().
Compute the pointwise product of a and b and store the value in a (Exact)
a,b | sbasis functions |
Definition at line 182 of file sbasis.cpp.
References Geom::SBasis::clear(), and Geom::SBasis::isZero().
Definition at line 384 of file sbasis.h.
References multiply().
Definition at line 291 of file sbasis-2d.h.
|
inline |
Definition at line 952 of file sbasisN.h.
References multiply().
Definition at line 225 of file sbasis-of.h.
References Geom::SBasisOf< T >::isZero().
|
inline |
Definition at line 557 of file sbasis-of.h.
References multiply().
Compute the pointwise sum of a and b (Exact)
a,b | sbasis functions |
Definition at line 88 of file sbasis.cpp.
References result, and Geom::SBasis::size().
Definition at line 215 of file sbasis-2d.h.
References Geom::SBasis2d::index(), result, Geom::SBasis2d::us, and Geom::SBasis2d::vs.
SBasisN< n > Geom::operator+ | ( | const SBasisN< n > & | a, |
const SBasisN< n > & | b | ||
) |
Definition at line 709 of file sbasisN.h.
References Geom::MultiDegree< n >::asIdx(), Geom::SBasisN< n >::isZero(), max(), Geom::SBasisN< n >::quick_multi_degree(), result, and Geom::SBasisN< n >::sizes.
Definition at line 784 of file sbasisN.h.
References Geom::SBasisN< n >::isZero(), and result.
|
inline |
Definition at line 749 of file sbasisN.h.
References Geom::LinearN< n >::isZero(), Geom::SBasisN< n >::isZero(), and result.
|
inline |
Definition at line 266 of file sbasis-of.h.
References result.
|
inline |
Definition at line 337 of file sbasis-of.h.
References Geom::LinearOf< T >::isZero(), Geom::SBasisOf< T >::isZero(), and result.
Definition at line 403 of file sbasis-of.h.
References Geom::SBasisOf< T >::isZero(), and result.
Definition at line 106 of file sbasis-2d.h.
Definition at line 168 of file linear-of.h.
|
inline |
Definition at line 149 of file linear-of.h.
MultiDegree< n > Geom::operator+ | ( | MultiDegree< n > const & | p, |
MultiDegree< n > const & | q | ||
) |
Definition at line 167 of file sbasisN.h.
References Geom::MultiDegree< n >::p.
Definition at line 118 of file sbasis-2d.h.
Definition at line 176 of file linear-of.h.
|
inline |
Definition at line 157 of file linear-of.h.
MultiDegree< n > Geom::operator+= | ( | MultiDegree< n > const & | p, |
MultiDegree< n > const & | q | ||
) |
|
inline |
Definition at line 693 of file piecewise.h.
Piecewise< T > & Geom::operator+= | ( | Piecewise< T > & | a, |
typename T::output_type | b | ||
) |
Definition at line 544 of file piecewise.h.
References Geom::Piecewise< T >::empty(), Geom::Piecewise< T >::push(), Geom::Piecewise< T >::push_cut(), and Geom::Piecewise< T >::size().
Compute the pointwise sum of a and b and store in a (Exact)
a,b | sbasis functions |
Definition at line 132 of file sbasis.cpp.
References Geom::SBasis::resize(), and Geom::SBasis::size().
Definition at line 343 of file sbasis.h.
References Geom::SBasis::SBasis().
Definition at line 256 of file sbasis-2d.h.
Definition at line 272 of file sbasis-2d.h.
Definition at line 736 of file sbasisN.h.
References Geom::SBasisN< n >::isZero().
|
inline |
Definition at line 352 of file sbasis-of.h.
References Geom::SBasisOf< T >::isZero().
SBasisOf< T > & Geom::operator+= | ( | SBasisOf< T > & | a, |
const SBasisOf< T > & | b | ||
) |
Definition at line 306 of file sbasis-of.h.
Definition at line 417 of file sbasis-of.h.
References Geom::SBasisOf< T >::isZero().
Compute the pointwise difference of a and b (Exact)
a,b | sbasis functions |
Definition at line 110 of file sbasis.cpp.
References result, and Geom::SBasis::size().
Definition at line 280 of file sbasis.h.
References result, and Geom::SBasis::SBasis().
Definition at line 235 of file sbasis-2d.h.
References Geom::SBasis2d::index(), result, Geom::SBasis2d::us, and Geom::SBasis2d::vs.
Definition at line 205 of file sbasis-2d.h.
References result.
Definition at line 791 of file sbasisN.h.
References Geom::SBasisN< n >::isZero(), and result.
|
inline |
Definition at line 758 of file sbasisN.h.
References Geom::LinearN< n >::isZero(), Geom::SBasisN< n >::isZero(), and result.
Returns a function which reverses the domain of a.
a | sbasis function |
useful for reversing a parameteric curve.
Definition at line 670 of file sbasisN.h.
References Geom::SBasisN< n >::isZero(), result, and Geom::SBasisN< n >::sizes.
SBasisOf< T > Geom::operator- | ( | const SBasisOf< T > & | a, |
const SBasisOf< T > & | b | ||
) |
Definition at line 286 of file sbasis-of.h.
References result.
|
inline |
Definition at line 345 of file sbasis-of.h.
References Geom::LinearOf< T >::isZero(), and result.
Definition at line 410 of file sbasis-of.h.
References Geom::SBasisOf< T >::isZero(), and result.
Definition at line 199 of file sbasis-of.h.
References Geom::SBasisOf< T >::isZero(), and result.
Definition at line 102 of file sbasis-2d.h.
References Geom::Linear2d::a.
Definition at line 112 of file sbasis-2d.h.
Definition at line 218 of file linear-of.h.
Definition at line 172 of file linear-of.h.
|
inline |
Definition at line 153 of file linear-of.h.
Piecewise< T > Geom::operator- | ( | Piecewise< T > const & | a, |
typename T::output_type | b | ||
) |
Definition at line 533 of file piecewise.h.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::size().
Definition at line 123 of file sbasis-2d.h.
Definition at line 181 of file linear-of.h.
|
inline |
Definition at line 162 of file linear-of.h.
|
inline |
Definition at line 698 of file piecewise.h.
Piecewise< T > & Geom::operator-= | ( | Piecewise< T > & | a, |
typename T::output_type | b | ||
) |
Definition at line 554 of file piecewise.h.
References Geom::Piecewise< T >::empty(), Geom::Piecewise< T >::push(), Geom::Piecewise< T >::push_cut(), and Geom::Piecewise< T >::size().
Compute the pointwise difference of a and b and store in a (Exact)
a,b | sbasis functions |
Definition at line 151 of file sbasis.cpp.
References Geom::SBasis::resize(), and Geom::SBasis::size().
Definition at line 350 of file sbasis.h.
References Geom::SBasis::SBasis().
Definition at line 264 of file sbasis-2d.h.
Definition at line 282 of file sbasis-2d.h.
|
inline |
Definition at line 360 of file sbasis-of.h.
References Geom::SBasisOf< T >::isZero().
SBasisOf< T > & Geom::operator-= | ( | SBasisOf< T > & | a, |
const SBasisOf< T > & | b | ||
) |
Definition at line 321 of file sbasis-of.h.
Definition at line 425 of file sbasis-of.h.
References Geom::SBasisOf< T >::isZero().
Definition at line 226 of file linear-of.h.
Definition at line 223 of file sbasis-of.h.
Definition at line 235 of file linear-of.h.
Definition at line 645 of file piecewise.h.
References Geom::Piecewise< T >::size().
Definition at line 297 of file sbasis-2d.h.
Definition at line 236 of file sbasis-of.h.
|
inline |
Definition at line 372 of file bezier.h.
References format_coord_nice(), and Geom::Bezier::order().
Referenced by Geom::SL::operator<<(), Inkscape::LivePathEffect::operator<<(), operator<<(), operator<<(), operator<<(), Geom::Ellipse::operator<<(), Geom::EllipticalArc::operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), and Geom::Point::operator<<().
std::ostream & Geom::operator<< | ( | std::ostream & | os, |
PathIntersectionGraph const & | pig | ||
) |
Format the PathIntersectionGraph for output.
Definition at line 509 of file intersection-graph.cpp.
|
inline |
Definition at line 176 of file path.h.
References Geom::PathTime::curve_index, format_coord_nice(), operator<<(), and Geom::PathTime::t.
|
inline |
Definition at line 84 of file pathvector.h.
References Geom::PathVectorTime::asPathTime(), operator<<(), and Geom::PathVectorTime::path_index.
std::ostream & Geom::operator<< | ( | std::ostream & | out, |
Circle const & | c | ||
) |
Definition at line 320 of file circle.cpp.
References c, format_coord_nice(), and operator<<().
|
related |
Definition at line 769 of file ellipse.cpp.
|
related |
Definition at line 1023 of file elliptical-arc.cpp.
|
inline |
Definition at line 354 of file generic-interval.h.
References operator<<().
|
inline |
Definition at line 360 of file generic-interval.h.
References operator<<().
|
inline |
Definition at line 534 of file generic-rect.h.
References operator<<().
|
inline |
Definition at line 529 of file generic-rect.h.
References operator<<(), X, and Y.
|
inline |
Output operator for convex hulls.
Prints out all the coordinates.
Definition at line 319 of file convex-hull.h.
References operator<<().
|
related |
std::ostream & Geom::operator<< | ( | std::ostream & | out, |
Path const & | path | ||
) |
Definition at line 1142 of file path.cpp.
References Geom::PathSink::feed(), operator<<(), and Geom::SVGPathWriter::str().
std::ostream & Geom::operator<< | ( | std::ostream & | out, |
PathVector const & | pv | ||
) |
Definition at line 317 of file pathvector.cpp.
References Geom::PathSink::feed(), operator<<(), and Geom::SVGPathWriter::str().
|
inline |
|
inline |
|
inline |
Definition at line 340 of file sbasis-2d.h.
|
inline |
|
inline |
Definition at line 612 of file sbasis-of.h.
|
inline |
|
inline |
Definition at line 237 of file polynomial.h.
|
inline |
|
inline |
Definition at line 346 of file sbasis-2d.h.
|
inline |
Definition at line 994 of file sbasisN.h.
References Geom::SBasisN< n >::sizes.
|
inline |
Definition at line 618 of file sbasis-of.h.
|
inline |
Definition at line 515 of file conicsec.h.
References Geom::xAx::c.
bool Geom::operator<= | ( | MultiDegree< n > const & | p, |
MultiDegree< n > const & | q | ||
) |
MultiDegree comparison.
p | is smaller than another |
q | if all it's smaller for all variables. |
In particular, p<=q and q<=p can both be false!
Definition at line 177 of file d2.h.
References operator==().
Referenced by operator==(), operator==(), operator==(), operator==(), and Geom::SL::operator==().
Definition at line 134 of file sbasis-2d.h.
References operator==().
|
inline |
Definition at line 282 of file linearN.h.
References operator==().
|
inline |
Definition at line 209 of file linear-of.h.
References operator==().
void Geom::pair_intersect | ( | Curve const & | A, |
double | Al, | ||
double | Ah, | ||
Curve const & | B, | ||
double | Bl, | ||
double | Bh, | ||
Crossings & | ret, | ||
unsigned | depth = 0 |
||
) |
This uses the local bounds functions of curves to generically intersect two.
It passes in the curves, time intervals, and keeps track of depth, while returning the results through the Crossings parameter.
Definition at line 245 of file path-intersection.cpp.
References Geom::Curve::boundsLocal(), c, intersect_polish_root(), Geom::GenericOptRect< C >::intersects(), linear_intersect(), pair_intersect(), and Geom::Curve::pointAt().
Crossings Geom::pair_intersect | ( | Curve const & | A, |
Interval const & | Ad, | ||
Curve const & | B, | ||
Interval const & | Bd | ||
) |
Definition at line 285 of file path-intersection.cpp.
References Geom::GenericInterval< C >::max(), Geom::GenericInterval< C >::min(), and pair_intersect().
Referenced by Geom::SimpleCrosser::crossings(), curve_self_crossings(), pair_intersect(), pair_intersect(), and self_crossings().
Coord Geom::parse_coord | ( | std::string const & | s | ) |
Definition at line 73 of file sbasis-2d.cpp.
References Geom::SBasis2d::index(), result, Geom::SBasis2d::us, and Geom::SBasis2d::vs.
Referenced by sb2d_cubic_solve(), and sb2dsolve().
PathIntersection Geom::parting_point | ( | Path const & | first, |
Path const & | second, | ||
Coord | precision = EPSILON |
||
) |
Find the first point where two paths diverge away from one another.
If the two paths have a common starting point, the algorithm follows them for as long as the images of the paths coincide and finds the first point where they stop coinciding. Note that only the images of paths in the plane are compared, and not their parametrizations, so this is not a functional (parametric) coincidence. If you want to test parametric coincidence, use bool are_near(Path const&, Path const&, Coord) instead.
The function returns the point where the traces of the two paths finally diverge up to the specified precision. If the traces (images) of the paths are nearly identical until the end, the returned point is their (almost) common endpoint. If however the image of one of the paths is completely contained in the image of the other path, the returned point is the endpoint of the shorter path.
If the paths have different starting points, then the returned intersection has the special time values of -1.0 on both paths and the returned intersection point is the midpoint of the line segment connecting the two starting points.
first | The first path to follow; corresponds to .first in the return value. |
second | The second path to follow; corresponds to .second in the return value. |
precision | How close the paths' images need to be in order to be considered as overlapping. |
Curve indices up until which the paths are known to overlap
Curve times on the curves with indices pos[] up until which the curves are known to overlap ahead of the nodes.
< Flag indicating which leg is stepping on the ladder
A closure to crop and compare the curve pieces ([-—] in the diagrams above).
A closure to skip degenerate curves; returns true if we reached the end.
Curve indices up until which the paths are known to overlap
Curve times on the curves with indices pos[] up until which the curves are known to overlap ahead of the nodes.
< Flag indicating which leg is stepping on the ladder
A closure to crop and compare the curve pieces ([-—] in the diagrams above).
A closure to skip degenerate curves; returns true if we reached the end.
Definition at line 40 of file parting-point.cpp.
References are_near(), Geom::Path::empty(), Geom::Path::initialPoint(), Geom::Curve::isNear(), Geom::GenericInterval< C >::max(), middle_point(), paths, Geom::Curve::pointAt(), Geom::Path::pointAt(), Geom::Curve::portion(), Geom::Path::size(), start_time, and Geom::Path::timeRange().
Referenced by Geom::PlanarGraph< EdgeLabel >::_compareAndReglue(), Geom::PlanarGraph< EdgeLabel >::_reglueTeardrop(), and TEST_F().
bool Geom::path_direction | ( | Path const & | p | ) |
This function should only be applied to simple paths (regions), as otherwise a boolean winding direction is undefined.
It returns true for fill, false for hole. Defaults to using the sign of area when it reaches funny cases.
Definition at line 25 of file path-intersection.cpp.
References area(), centroid(), Geom::Path::empty(), and Geom::Path::toPwSb().
Referenced by Geom::PlanarGraph< EdgeLabel >::deviatesLeft(), Inkscape::do_offset(), Inkscape::LivePathEffect::FilletChamferKnotHolderEntity::knot_get(), and Inkscape::LivePathEffect::sp_get_recursive_pathvector().
PathVector Geom::path_from_piecewise | ( | Geom::Piecewise< Geom::D2< Geom::SBasis > > const & | B, |
double | tol, | ||
bool | only_cubicbeziers | ||
) |
Make a path from a d2 sbasis.
p | the d2 Symmetric basis polynomial |
If only_cubicbeziers is true, the resulting path may only contain CubicBezier curves. TODO: some of this logic should be lifted into svg-path
Definition at line 539 of file sbasis-to-bezier.cpp.
References are_near(), build_from_sbasis(), Geom::PathIteratorSink< OutputIterator >::closePath(), Geom::PathIteratorSink< OutputIterator >::flush(), Geom::PathIteratorSink< OutputIterator >::moveTo(), Geom::PathBuilder::peek(), sbasis_size(), and start.
Referenced by Inkscape::UI::Tools::PencilTool::_addFreehandPoint(), Inkscape::UI::Tools::PencilTool::_sketchInterpolate(), Inkscape::LivePathEffect::LPETaperStroke::doBeforeEffect(), LPEToy::doEffect_path(), Inkscape::LivePathEffect::Effect::doEffect_path(), Inkscape::LivePathEffect::LPEAngleBisector::doEffect_path(), Inkscape::LivePathEffect::LPECurveStitch::doEffect_path(), Inkscape::LivePathEffect::LPEEmbroderyStitch::doEffect_path(), Inkscape::LivePathEffect::LPEInterpolate::doEffect_path(), Inkscape::LivePathEffect::LPELattice2::doEffect_pwd2(), LPEToy::draw(), Inkscape::LivePathEffect::PowerStrokePointArrayParam::knot_get(), Inkscape::LivePathEffect::PowerStrokePointArrayParamKnotHolderEntity::knot_set(), Inkscape::LivePathEffect::PowerStrokePointArrayParam::recalculate_controlpoints(), Inkscape::LivePathEffect::LPERuler::ruler_mark(), Inkscape::LivePathEffect::PathParam::set_new_value(), SPCurve::stretch_endpoints(), Inkscape::Extension::Internal::PrintEmf::stroke(), Inkscape::Extension::Internal::PrintWmf::stroke(), and wrap_path().
Make a path from a d2 sbasis.
p | the d2 Symmetric basis polynomial |
If only_cubicbeziers is true, the resulting path may only contain CubicBezier curves.
Definition at line 523 of file sbasis-to-bezier.cpp.
References Geom::D2< T >::at0(), build_from_sbasis(), Geom::PathIteratorSink< OutputIterator >::flush(), Geom::PathVector::front(), Geom::PathIteratorSink< OutputIterator >::moveTo(), and Geom::PathBuilder::peek().
Referenced by cairo_d2_sb(), cairo_d2_sb(), cubicbezierpath_from_sbasis(), Inkscape::LivePathEffect::LPEEmbroderyStitch::doEffect_path(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), and wrap_path().
std::vector< double > Geom::path_mono_splits | ( | Path const & | p | ) |
Finds all the monotonic splits for a path.
Only includes the split between curves if they switch derivative directions at that point.
Definition at line 410 of file path-intersection.cpp.
References append(), curve_mono_splits(), Geom::Path::empty(), Geom::Path::finalPoint(), Geom::Path::initialPoint(), offset_doubles(), Geom::Path::size(), Geom::Path::valueAt(), X, and Y.
Referenced by paths_mono_splits().
std::vector< std::vector< double > > Geom::paths_mono_splits | ( | PathVector const & | ps | ) |
Applies path_mono_splits to multiple paths, and returns the results such that time-set i corresponds to Path i.
Definition at line 433 of file path-intersection.cpp.
References path_mono_splits().
Referenced by Geom::MonoCrosser::crossings().
Piecewise< D2< SBasis > > Geom::paths_to_pw | ( | PathVector const & | paths | ) |
Definition at line 1123 of file path.cpp.
References Geom::Piecewise< T >::concat(), and paths.
Referenced by Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPELattice2::doEffect_pwd2(), draw_cell(), Inkscape::LivePathEffect::LPERuler::ruler_mark(), Inkscape::UI::Tools::LpeTool::update_measuring_items(), and wrap_path().
void Geom::polish_intersections | ( | std::vector< std::pair< double, double > > & | xs, |
D2< SBasis > const & | A, | ||
D2< SBasis > const & | B | ||
) |
Definition at line 390 of file basic-intersection.cpp.
References intersect_polish_root().
double Geom::polish_root | ( | Poly const & | p, |
double | guess, | ||
double | tol | ||
) |
Definition at line 122 of file polynomial.cpp.
References derivative().
Changes the basis of p to be sbasis.
p | the Monomial basis polynomial |
This algorithm is horribly slow and numerically terrible. Only for testing.
Definition at line 11 of file sbasis-poly.cpp.
References multiply(), and Geom::SBasis::normalize().
Referenced by main().
Definition at line 250 of file bezier.cpp.
Referenced by bounds_local(), Geom::FragmentConcept< T >::constraints(), Geom::PlanarGraph< EdgeLabel >::deviatesLeft(), Inkscape::LivePathEffect::LPEKnot::doEffect_path(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doEffect_path(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEExtrude::doEffect_pwd2(), Inkscape::LivePathEffect::LPESketch::doEffect_pwd2(), Geom::Piecewise< T >::elem_portion(), find_self_intersections(), linearizeCusps(), monotonic_smash_intersect(), monotonic_smash_intersect(), nearest_time(), Geom::Piecewise< T >::partition(), portion(), portion(), Geom::Piecewise< T >::portion(), portion(), Geom::BezierCurve::portion(), Geom::BezierCurveN< degree >::portion(), Geom::SBasisCurve::portion(), Geom::Piecewise< T >::pw_compose_inverse(), Inkscape::LivePathEffect::LPERuler::ruler_mark(), smash_intersect(), smash_intersect(), Inkscape::LivePathEffect::LPESlice::splititem(), subdivide(), TEST_F(), TEST_F(), TEST_F(), and wrap_d2().
Definition at line 475 of file sbasis.cpp.
Definition at line 420 of file sbasis.h.
References Geom::GenericInterval< C >::max(), Geom::GenericInterval< C >::min(), and Geom::SBasis::portion().
|
inline |
Definition at line 602 of file sbasis-of.h.
References compose().
|
inline |
Definition at line 136 of file concepts.h.
References Geom::GenericInterval< C >::max(), Geom::GenericInterval< C >::min(), and portion().
Definition at line 149 of file linear.h.
References result, and Geom::Linear::valueAt().
|
inline |
Definition at line 519 of file line.h.
References Geom::BezierCurve::finalPoint(), Geom::BezierCurve::initialPoint(), Geom::Line::nearestTime(), and Geom::Line::segment().
Definition at line 513 of file line.h.
References Geom::Line::nearestTime(), and Geom::Line::pointAt().
Referenced by Inkscape::ObjectSnapper::_snapTranslatingGuide(), Inkscape::LineSnapper::constrainedSnap(), Inkscape::LineSnapper::freeSnap(), Inkscape::Snapper::SnapConstraint::projection(), and tighten().
Definition at line 117 of file intersection-by-smashing.cpp.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::size().
Referenced by monotonic_smash_intersect(), and smash_intersect().
|
related |
Definition at line 158 of file piecewise.cpp.
Referenced by monotonic_smash_intersect(), Geom::Piecewise< T >::pw_compose_inverse(), and smash_intersect().
auto Geom::randpts | ( | ) |
Definition at line 35 of file min-bbox-test.cpp.
Referenced by TEST().
Compute the recpirocal of a.
a | sbasis functions |
It is recommended to use the piecewise version unless you have good reason.
Definition at line 402 of file sbasis.cpp.
References c, Geom::Linear::isZero(), and Geom::Linear::tri().
Referenced by log(), reciprocalOnDomain(), and wrap_sbasis().
Piecewise< SBasis > Geom::reciprocal | ( | Piecewise< SBasis >const & | f, |
double | tol = 1e-3 , |
||
int | order = 3 |
||
) |
Definition at line 335 of file sbasis-math.cpp.
References bounds_fast(), compose(), order, reciprocalOnDomain(), result, and truncateResult().
Definition at line 329 of file sbasis-math.cpp.
References bounds_fast(), compose(), order, reciprocalOnDomain(), result, and truncateResult().
Definition at line 282 of file sbasis-math.cpp.
References Geom::Piecewise< T >::concat(), Geom::Piecewise< T >::cuts, floor(), Geom::GenericInterval< C >::max(), Geom::GenericInterval< C >::min(), Geom::Piecewise< T >::push(), Geom::Piecewise< T >::push_cut(), Geom::Piecewise< T >::push_seg(), R, reciprocal(), reverse(), Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::size().
Referenced by reciprocal(), and reciprocal().
std::vector< Geom::Point > Geom::rect_line_intersect | ( | Geom::Point const & | c0, |
Geom::Point const & | c1, | ||
Geom::Point const & | p0, | ||
Geom::Point const & | p1 | ||
) |
Determine whether & where an (infinite) line intersects a rectangle.
c0, c1 are diagonal corners of the rectangle and p1, p1 are distinct points on the line
Definition at line 280 of file geom.cpp.
References D, dot(), eliminate_duplicates_p(), intersects, line_segment_intersect(), X, and Y.
std::optional< LineSegment > Geom::rect_line_intersect | ( | Geom::Rect & | r, |
Geom::Line | l | ||
) |
Definition at line 346 of file geom.cpp.
References rect_line_intersect(), and Geom::Line::segment().
std::optional< LineSegment > Geom::rect_line_intersect | ( | Geom::Rect & | r, |
Geom::LineSegment | ls | ||
) |
Determine whether & where an (infinite) line intersects a rectangle.
c0, c1 are diagonal corners of the rectangle and p1, p1 are distinct points on the line
Definition at line 333 of file geom.cpp.
References Geom::GenericRect< C >::max(), Geom::GenericRect< C >::min(), and rect_line_intersect().
Referenced by draw_line_in_rect(), fill_line_in_rect(), rect_line_intersect(), rect_line_intersect(), and tighten().
void Geom::recursively_intersect | ( | OldBezier | a, |
double | t0, | ||
double | t1, | ||
int | deptha, | ||
OldBezier | b, | ||
double | u0, | ||
double | u1, | ||
int | depthb, | ||
std::vector< std::pair< double, double > > & | parameters | ||
) |
Definition at line 218 of file recursive-bezier-intersection.cpp.
References det(), intersect_BB(), intersect_steps, recursively_intersect(), X, and Y.
Referenced by find_intersections_bezier_recursive(), and recursively_intersect().
Definition at line 93 of file coord.h.
Referenced by Geom::Affine::inverse().
|
static |
Given set of points and their parameterization, try to find a better assignment of parameter values for the points.
d | Array of digitized points. |
u | Current parameter values. |
bezCurve | Current fitted curve. |
len | Number of values in both d and u arrays. Also the size of the array that is allocated for return. |
Definition at line 538 of file bezier-utils.cpp.
References len, and NewtonRaphsonRootFind().
Referenced by bezier_fit_cubic_full().
|
inline |
Scale the doubles in the passed array to make them "reasonably large".
All doubles in the passed array will get scaled by the same power of 2 (which is a lossless operation) in such a way that their geometric average gets closer to 1.
N | The size of the passed array. |
[in,out] | values | The doubles to be rescaled in place. |
Definition at line 108 of file math-utils.h.
References N.
Referenced by Geom::xAx::decompose_df(), Geom::Ellipse::intersect(), and Geom::Ellipse::intersect().
Definition at line 342 of file bezier.h.
References Geom::Bezier::order(), and result.
Referenced by Geom::PathIntersectionGraph::_getResult(), Geom::Path::appendPortionTo(), Geom::FragmentConcept< T >::constraints(), convole(), Inkscape::LivePathEffect::LPEEmbroderyStitch::doEffect_path(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::LPEExtrude::doEffect_pwd2(), Inkscape::LivePathEffect::LPEEmbroderyStitch::GetEndPointInterpolBeforeRev(), Inkscape::LivePathEffect::LPEEmbroderyStitch::GetStartPointInterpolBeforeRev(), interpolate(), Inkscape::LivePathEffect::LPEEmbroderyStitchOrdering::OrderingAdvanced(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), plot(), Geom::Piecewise< T >::pw_compose_inverse(), reciprocalOnDomain(), Geom::BezierCurve::reverse(), Geom::BezierCurveN< degree >::reverse(), reverse(), Geom::Piecewise< T >::reverse(), reverse(), Inkscape::LivePathEffect::PowerStrokePointArrayParam::reverse_controlpoints(), smash_intersect(), TEST_F(), TEST_F(), TEST_F(), wrap_d2(), wrap_linear(), and wrap_sbasis().
Definition at line 145 of file linear-of.h.
Definition at line 189 of file sbasis-of.h.
CrossingSet Geom::reverse_ta | ( | CrossingSet const & | cr, |
unsigned | split, | ||
std::vector< double > | max | ||
) |
Definition at line 163 of file crossing.cpp.
References max(), reverse_ta(), and split().
Definition at line 153 of file crossing.cpp.
References max(), and split().
Referenced by reverse_tb().
CrossingSet Geom::reverse_tb | ( | CrossingSet const & | cr, |
unsigned | split, | ||
std::vector< double > | max | ||
) |
Definition at line 173 of file crossing.cpp.
References max(), reverse_tb(), and split().
Definition at line 205 of file piecewise.cpp.
References Geom::Piecewise< T >::mapToDomain(), result, roots(), Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::size().
std::vector< double > Geom::roots | ( | SBasis const & | s | ) |
Referenced by abs(), all_nearest_times(), bezier_line_intersections(), compose(), compose_pullback(), Geom::xAx::crossings(), cutAtRoots(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEExtrude::doEffect_pwd2(), Inkscape::LivePathEffect::LPERuler::doEffect_pwd2(), Inkscape::LivePathEffect::LPESketch::doEffect_pwd2(), Geom::D2< T >::find_normals(), Geom::D2< T >::find_normals_by_vector(), Geom::D2< T >::find_tangents(), Geom::D2< T >::find_tangents_by_vector(), Inkscape::LivePathEffect::findShadowedTime(), intersect(), main(), max(), monotonicSplit(), nearest_time(), nearest_time(), plot3d_top(), Geom::Piecewise< T >::roots(), Geom::SBasisCurve::roots(), roots(), signSb(), solve(), solve_lambda0(), solve_reals(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), Inkscape::LivePathEffect::LPEDashedStroke::timeAtLength(), and wrap_sbasis().
std::vector< double > Geom::roots | ( | SBasisN< n > const & | s | ) |
Definition at line 397 of file d2.h.
Referenced by Inkscape::UI::Tools::EraserTool::_addCap(), Inkscape::UI::Tools::EraserTool::_apply(), Inkscape::UI::Dialog::GuidelinePropertiesDialog::_onOKimpl(), Inkscape::CanvasItemGuideLine::_render(), Inkscape::ObjectSnapper::_snapTranslatingGuide(), Inkscape::UI::Tools::add_cap(), Inkscape::UI::Tools::CalligraphicTool::apply(), Geom::Piecewise< T >::centroid(), Inkscape::CanvasItemGuideLine::closest_distance_to(), Inkscape::LineSnapper::constrainedSnap(), SPGuide::createSPGuide(), cubic_length_subdividing(), curvature(), darray_center_tangent(), Geom::BezierFitter::darray_center_tangent(), decompose_degenerate(), Inkscape::LivePathEffect::LPECurveStitch::doEffect_path(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEBendPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::LPEEnvelope::doEffect_pwd2(), Inkscape::LivePathEffect::LPEExtrude::doEffect_pwd2(), Inkscape::LivePathEffect::LPEPatternAlongPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPERecursiveSkeleton::doEffect_pwd2(), Inkscape::LivePathEffect::LPERoughHatches::doEffect_pwd2(), Inkscape::LivePathEffect::LPERuler::doEffect_pwd2(), Inkscape::LivePathEffect::LPETextLabel::doEffect_pwd2(), doEffect_pwd2(), dot_plot(), dot_plot(), Inkscape::UI::Handle::dragged(), Inkscape::UI::Node::dragged(), draw_line(), draw_ray(), Geom::Eigen::Eigen(), Geom::Eigen::Eigen(), Geom::D2< T >::find_tangents_by_vector(), Inkscape::LineSnapper::freeSnap(), Geom::Line::from_normal_distance(), Inkscape::SnappedLine::getLine(), Inkscape::GridSnapper::getSnapLinesAxonom(), goal_function(), SnapManager::guideConstrainedSnap(), SnapManager::guideFreeSnap(), intersector_ccw(), line_best_fit(), line_intersection(), Geom::Line::normal(), Geom::detail::bezier_clipping::normal(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), plot_offset(), rot90(), Inkscape::SelTrans::rotateRequest(), Inkscape::UI::Widget::ruler_snap_new_guide(), sb2d_cubic_solve(), sbofsb_cubic_solve(), Inkscape::UI::Tools::MeasureTool::setGuide(), Inkscape::LivePathEffect::TextParam::setPosAndAnchor(), Inkscape::UI::Tools::MeasureTool::showCanvasItems(), Inkscape::PureRotateConstrained::storeTransform(), Inkscape::LivePathEffect::stretch_along(), Geom::xAx::toCurve(), Geom::xAx::toRatQuad(), and vectors_are_clockwise().
Definition at line 85 of file d2-sbasis.cpp.
References Geom::Piecewise< T >::push_cut(), result, and rot90().
Definition at line 526 of file convex-hull.cpp.
References sgn(), and SignedTriangleArea().
Referenced by bridges().
D2< SBasis > Geom::sb2d_cubic_solve | ( | SBasis2d const & | f, |
Geom::Point const & | A, | ||
Geom::Point const & | B | ||
) |
Finds a path which traces the 0 contour of f, traversing from A to B as a single cubic d2<sbasis>.
The algorithm is based on matching direction and curvature at each end point.
Definition at line 147 of file sbasis-2d.cpp.
References Geom::SBasis2d::apply(), bounds, bounds_fast(), compose(), cubics_fitting_curvature(), Geom::GenericRect< C >::max(), Geom::GenericRect< C >::min(), partial_derivative(), result, rot90(), X, and Y.
D2< SBasis > Geom::sb2dsolve | ( | SBasis2d const & | f, |
Geom::Point const & | A, | ||
Geom::Point const & | B, | ||
unsigned | degmax | ||
) |
Finds a path which traces the 0 contour of f, traversing from A to B as a single d2<sbasis>.
degmax specifies the degree (degree = 2*degmax-1, so a degmax of 2 generates a cubic fit). The algorithm is based on dividing out derivatives at each end point and does not use the curvature for fitting. It is less accurate than sb2d_cubic_solve, although this may be fixed in the future.
Definition at line 107 of file sbasis-2d.cpp.
References Geom::SBasis2d::apply(), compose(), partial_derivative(), result, sign(), X, and Y.
Definition at line 56 of file d2-sbasis.cpp.
References size.
Referenced by build_from_sbasis(), and path_from_piecewise().
Changes the basis of p to be bernstein.
p | the Symmetric basis polynomial |
if the degree is even q is the order in the symmetrical power basis, if the degree is odd q is the order + 1 n is always the polynomial degree, i. e. the Bezier order sz is the number of bezier handles.
Definition at line 86 of file sbasis-to-bezier.cpp.
References binomial_increment_k(), Geom::Bezier::clear(), Geom::Bezier::resize(), and Geom::SBasis::size().
Referenced by Geom::Curve::feed(), find_intersections(), find_self_intersections(), hausdorfl(), main(), sbasis_to_bezier(), sbasis_to_bezier(), sbasis_to_cubic_bezier(), sbasis_to_cubicbezier(), sbasis_to_returned_bezier(), TEST_F(), and TEST_F().
Definition at line 143 of file sbasis-to-bezier.cpp.
References sbasis_to_bezier(), size, X, and Y.
std::vector< Geom::Point > Geom::sbasis_to_bezier | ( | D2< SBasis > const & | B, |
unsigned | q = 0 |
||
) |
Changes the basis of p to be Bernstein.
p | the D2 Symmetric basis polynomial |
sz is always the polynomial degree, i. e. the Bezier order
Definition at line 158 of file sbasis-to-bezier.cpp.
References bezier_points(), and sbasis_to_bezier().
Changes the basis of p to be Bernstein.
p | the D2 Symmetric basis polynomial |
Bezier is always cubic. For general asymmetric case, fit the SBasis function value at midpoint For parallel, symmetric case, find the point of closest approach to the midpoint For parallel, anti-symmetric case, fit the SBasis slope at midpoint
Definition at line 174 of file sbasis-to-bezier.cpp.
References Geom::ConvexHull::contains(), EPSILON, sbasis_to_bezier(), size, test1, test2, X, and Y.
Referenced by build_from_sbasis(), and TEST_F().
|
static |
Definition at line 50 of file lpe-powerstroke.cpp.
References sbasis_to_bezier().
Referenced by Inkscape::LivePathEffect::path_from_piecewise_fix_cusps().
Changes the basis of p to be monomial.
p | the Symmetric basis polynomial |
This algorithm is horribly slow and numerically terrible. Only for testing.
Definition at line 29 of file sbasis-poly.cpp.
References Geom::SBasis::isZero(), Geom::Poly::normalize(), and Geom::SBasis::size().
Referenced by intersect(), main(), and make_implicit_curve().
Definition at line 65 of file d2-sbasis.cpp.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::push_seg(), and Geom::Piecewise< T >::size().
Referenced by bend(), Inkscape::LivePathEffect::bend(), cairo_d2_pw_sb(), cairo_d2_pw_sb(), and SPCurve::stretch_endpoints().
IntersectorKind Geom::segment_intersect | ( | Geom::Point const & | p00, |
Geom::Point const & | p01, | ||
Geom::Point const & | p10, | ||
Geom::Point const & | p11, | ||
Geom::Point & | result | ||
) |
Determine whether & where two line segments intersect.
If the two segments don't intersect, then result remains unchanged.
Definition at line 188 of file geom.cpp.
References dot(), line_intersection(), n1, no_intersection, result, and segment_intersectp().
bool Geom::segment_intersectp | ( | Geom::Point const & | p00, |
Geom::Point const & | p01, | ||
Geom::Point const & | p10, | ||
Geom::Point const & | p11 | ||
) |
Determine whether two line segments intersect.
This doesn't find the point of intersection, use the line_intersect function above, or the segment_intersection interface below.
Definition at line 145 of file geom.cpp.
References line_segment_intersectp().
Referenced by segment_intersect().
Definition at line 659 of file path-intersection.cpp.
References append(), bounds, curve_self_crossings(), offset_crossings(), pair_intersect(), and sweep_bounds().
Referenced by crossings_among().
Definition at line 235 of file d2-sbasis.cpp.
Referenced by fuse_nearby_ends().
Definition at line 244 of file d2-sbasis.cpp.
Referenced by fuse_nearby_ends().
void Geom::setToVariable | ( | LinearN< n > & | x, |
unsigned | k | ||
) |
|
inline |
Sign function - indicates the sign of a numeric type.
Mathsy people will know this is basically the derivative of abs, except for the fact that it is defined on 0.
Definition at line 51 of file math-utils.h.
Referenced by Inkscape::UI::Node::_eventHandler(), Geom::Ellipse::arc(), Geom::xAx::arc_bound(), Geom::CLIPPER_CLASS::are_paired(), CrossingCount(), divide(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::doBeforeEffect(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doEffect_path(), Geom::NL::detail::trace_sgn< 2, 2 >::evaluate(), Geom::NL::detail::trace_sgn< K, N >::evaluate(), Geom::Bezier::find_bezier_roots(), Geom::xAx::roots(), Geom::xAx::roots(), same_side(), Inkscape::UI::Widget::ColorPalette::scroll_cb(), Geom::Ellipse::semiaxis(), Inkscape::LivePathEffect::LPECopyRotate::split(), Inkscape::LivePathEffect::LPESlice::splititem(), and Inkscape::PureScale::storeTransform().
int Geom::sgn | ( | double | x | ) |
Definition at line 521 of file convex-hull.cpp.
multiply a by x^sh (Exact)
a | linear function |
sh | power |
Definition at line 216 of file sbasis.cpp.
References c.
SBasisN< n > Geom::shift | ( | LinearN< n > const & | a, |
MultiDegree< n > | sh | ||
) |
Definition at line 831 of file sbasisN.h.
References Geom::MultiDegree< n >::asIdx(), result, and Geom::SBasisN< n >::sizes.
Definition at line 843 of file sbasisN.h.
References result, and Geom::SBasisN< n >::sizes.
Definition at line 446 of file sbasis-of.h.
References c.
multiply a by x^sh in place (Exact)
a | sbasis function |
sh | power |
Definition at line 198 of file sbasis.cpp.
References c, and Geom::SBasis::size().
SBasisN< n > Geom::shift | ( | SBasisN< n > const & | a, |
MultiDegree< n > | sh | ||
) |
Definition at line 815 of file sbasisN.h.
References Geom::MultiDegree< n >::asIdx(), Geom::SBasisN< n >::quick_multi_degree(), result, and Geom::SBasisN< n >::sizes.
Definition at line 435 of file sbasis-of.h.
References c.
Referenced by divide(), divide(), divide_by_sk(), Inkscape::LivePathEffect::LPERoughHatches::doEffect_pwd2(), interpolate(), sqrt(), sqrt_internal(), and wrap_sbasis().
|
inlinestatic |
Returns +1 for positive numbers, -1 for negative numbers, and 0 otherwise.
Definition at line 42 of file path-extrema.cpp.
Referenced by Geom::PlanarGraph< EdgeLabel >::Vertex::_addIncidence(), Inkscape::LivePathEffect::LPEKnot::addCanvasIndicators(), crossing_count(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEVonKoch::doEffect_path(), Inkscape::LivePathEffect::LPERuler::doEffect_pwd2(), find_direction_of_travel(), get_random_irreducible_quadratic(), Geom::PlanarGraph< EdgeLabel >::getIncidence(), multiply(), sb2dsolve(), Geom::Ellipse::semiaxis(), Geom::Ellipse::semimajorAxis(), Geom::Ellipse::semiminorAxis(), signSb(), solve_quadratic(), and triangulate().
Definition at line 206 of file conic_section_clipper_impl.cpp.
References cross().
Referenced by Geom::xAx::arc_bound(), and Geom::CLIPPER_CLASS::are_paired().
Return the sign of the two functions pointwise.
f | function |
Definition at line 129 of file sbasis-math.cpp.
Return the sign of the two functions pointwise.
f | function |
Definition at line 123 of file sbasis-math.cpp.
References signSb().
Referenced by signSb().
Compute the sine of a to k terms.
b | linear function |
It is recommended to use the piecewise version unless you have good reason.
Definition at line 583 of file sbasis.cpp.
References Geom::Linear::tri().
Referenced by cos(), Inkscape::LivePathEffect::LPEMeasureSegments::doBeforeEffect(), Inkscape::LivePathEffect::LPEAttachPath::doEffect(), Inkscape::LivePathEffect::LPEFilletChamfer::doEffect_path(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::evalSteinerEllipse(), Inkscape::LivePathEffect::LPEPts2Ellipse::gen_perspective_axes_paths(), Inkscape::LivePathEffect::LPEPts2Ellipse::genPerspectiveEllipse(), sinC(), sincos(), Geom::Piecewise< T >::tan2(), TEST_F(), Geom::Circle::toSBasis(), Geom::EllipticalArc::toSBasis(), and Inkscape::LivePathEffect::LPEPts2Ellipse::unit_arc_path().
Compute the sine of a function.
f | function |
tol | maximum error |
order | maximum degree polynomial to use |
Definition at line 215 of file sbasis-math.cpp.
Compute the sine of a function.
f | function |
tol | maximum error |
order | maximum degree polynomial to use |
Definition at line 209 of file sbasis-math.cpp.
|
inline |
Simultaneously compute a sine and a cosine of the same angle.
This function can be up to 2 times faster than separate computation, depending on the platform. It uses the standard library function sincos() if available.
angle | Angle |
sin_ | Variable that will store the sine |
cos_ | Variable that will store the cosine |
Definition at line 89 of file math-utils.h.
References cos(), sin(), and sincos().
Referenced by Inkscape::UI::Widget::OKWheel::_curColorWheelCoords(), Geom::EllipticalArc::allNearestTimes(), Geom::Ellipse::coefficients(), Geom::Ellipse::initialPoint(), Geom::Line::Line(), Geom::Point::polar(), Geom::Ray::Ray(), Geom::EllipticalArc::roots(), Geom::Ray::setAngle(), Geom::Line::setAngle(), Geom::Ellipse::setCoefficients(), sincos(), Inkscape::Colors::Space::Lch::toLuv(), Inkscape::Colors::Space::OkHsl::toOkLab(), Inkscape::Colors::Space::OkLch::toOkLab(), Geom::EllipticalArc::toSBasis(), Inkscape::UI::Tools::unsnapped_polar(), Geom::Ellipse::valueAt(), and Geom::EllipticalArc::winding().
std::vector< SmashIntersection > Geom::smash_intersect | ( | D2< SBasis > const & | a, |
D2< SBasis > const & | b, | ||
double | tol | ||
) |
Definition at line 317 of file intersection-by-smashing.cpp.
References cleanup_and_fuse(), monotonic_smash_intersect(), monotonicSplit(), portion(), result, X, and Y.
std::vector< std::complex< double > > Geom::solve | ( | const Poly & | p | ) |
Definition at line 84 of file polynomial.cpp.
References Geom::Poly::degree(), Geom::Poly::normalize(), roots(), and w.
Referenced by Geom::xAx::bottom(), main(), and solve_reals().
std::optional< Point > Geom::solve | ( | double | A[2][2], |
double | b[2] | ||
) |
Definition at line 628 of file conicsec.cpp.
References det().
Analytically solve cubic equation.
The equation is given in the standard form: ax^3 + bx^2 + cx + d = 0. Only real roots are returned.
Definition at line 260 of file polynomial.cpp.
References c, cbrt, cos(), D, R, result, solve_quadratic(), and sqrt().
Referenced by bezier_line_intersections(), Geom::Ellipse::intersect(), Inkscape::Colors::Space::OkLch::max_chroma(), solve_quartic(), TEST(), and TEST().
Analytically solve quadratic equation.
The equation is given in the standard form: ax^2 + bx + c = 0. Only real roots are returned.
Definition at line 226 of file polynomial.cpp.
References c, delta, result, sign(), and sqrt().
Referenced by bezier_line_intersections(), Geom::Eigen::Eigen(), Geom::Eigen::Eigen(), Geom::Ellipse::intersect(), solve_cubic(), solve_quartic(), TEST(), TEST(), and TEST().
Analytically solve quartic equation.
The equation is given in the standard form: ax^4 + bx^3 + cx^2 + dx + e = 0. Only real roots are returned.
Definition at line 318 of file polynomial.cpp.
References c, result, solve_cubic(), solve_quadratic(), and sqr().
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
std::vector< double > Geom::solve_reals | ( | const Poly & | p | ) |
Definition at line 110 of file polynomial.cpp.
References root, roots(), and solve().
Referenced by Geom::EllipticalArc::allNearestTimes(), and intersect().
|
inline |
Definition at line 144 of file crossing.h.
Referenced by Geom::Crosser< T >::crossings(), and merge_crossings().
void Geom::split | ( | vector< Point > const & | p, |
double | t, | ||
vector< Point > & | left, | ||
vector< Point > & | right | ||
) |
Definition at line 111 of file basic-intersection.cpp.
References lerp().
Referenced by Geom::PlanarGraph< EdgeLabel >::_compareAndReglue(), Geom::PlanarGraph< EdgeLabel >::_reglueLasso(), Geom::PlanarGraph< EdgeLabel >::_reglueTeardrop(), Geom::Curve::intersectSelf(), reverse_ta(), reverse_tb(), and reverse_tb().
std::vector< Geom::Piecewise< Geom::D2< Geom::SBasis > > > Geom::split_at_discontinuities | ( | Geom::Piecewise< Geom::D2< Geom::SBasis > > const & | pwsbin, |
double | tol = .0001 |
||
) |
Definition at line 202 of file d2-sbasis.cpp.
References Geom::Piecewise< T >::cuts, L2(), and Geom::Piecewise< T >::segs.
Referenced by Inkscape::LivePathEffect::LPEPatternAlongPath::doEffect_pwd2(), Inkscape::LivePathEffect::LPERecursiveSkeleton::doEffect_pwd2(), Inkscape::LivePathEffect::LPESketch::doEffect_pwd2(), and Inkscape::LivePathEffect::stretch_along().
std::vector< std::vector< Rect > > Geom::split_bounds | ( | PathVector const & | p, |
std::vector< std::vector< double > > | splits | ||
) |
Processes the bounds for a list of paths and a list of splits on them, yielding a list of rects for each.
Each entry i corresponds to path i of the input. The number of rects in each entry is guaranteed to be the number of splits for that path, subtracted by one.
Definition at line 445 of file path-intersection.cpp.
References Geom::PathVector::pointAt(), and Geom::PathVector::size().
Referenced by Geom::MonoCrosser::crossings().
|
inline |
Definition at line 57 of file math-utils.h.
Referenced by Geom::xAx::decompose_df(), Inkscape::UI::Tools::CalligraphicTool::fit_and_split(), get_random_irreducible_quadratic(), Geom::Ellipse::intersect(), max_expansion(), Inkscape::UI::Widget::profile(), Geom::Ellipse::setCoefficients(), and solve_quartic().
Compute the sqrt of a function.
f | function |
Definition at line 188 of file sbasis-math.cpp.
References Geom::Piecewise< T >::cuts, Geom::Piecewise< T >::domain(), max(), order, result, Geom::Piecewise< T >::segs, Geom::Piecewise< T >::setDomain(), Geom::Piecewise< T >::size(), and sqrt_internal().
Compute the sqrt of a.
a | sbasis functions |
\[ \sqrt{a} \]
It is recommended to use the piecewise version unless you have good reason. TODO: convert int k to unsigned k, and remove cast
Definition at line 375 of file sbasis.cpp.
References c, Geom::SBasis::isZero(), multiply(), Geom::SBasis::resize(), shift(), Geom::SBasis::size(), Geom::SBasis::tailError(), and Geom::SBasis::truncate().
Compute the sqrt of a function.
f | function |
Definition at line 181 of file sbasis-math.cpp.
Referenced by Geom::Piecewise< T >::arcLengthSb(), atan_sample_based(), bezier_fit_cubic_full(), compute_max_error_ratio(), Geom::xAx::decompose_df(), Geom::Affine::descrim(), Inkscape::LivePathEffect::LPEFilletChamfer::doEffect_path(), Inkscape::LivePathEffect::LPEDynastroke::doEffect_pwd2(), Inkscape::LivePathEffect::LPESketch::doEffect_pwd2(), Inkscape::LivePathEffect::evalSteinerEllipse(), Geom::Affine::expansionX(), Geom::Affine::expansionY(), Inkscape::LivePathEffect::LPEPts2Ellipse::genSteinerEllipse(), L2(), main(), meanSquareLine(), Geom::Point::normalize(), robust_timer(), sb_length_integrating(), solve_cubic(), solve_quadratic(), sqrt(), TEST_F(), trial_eval(), and wrap_sbasis().
Definition at line 138 of file sbasis-math.cpp.
References Geom::SBasis::at0(), Geom::SBasis::at1(), compose(), Geom::Piecewise< T >::concat(), Geom::SBasis::isZero(), multiply(), order, Geom::SBasis::resize(), Geom::Piecewise< T >::setDomain(), shift(), Geom::SBasis::size(), sqrt_internal(), Geom::SBasis::tailError(), and Geom::SBasis::truncate().
Referenced by sqrt(), and sqrt_internal().
|
inline |
Definition at line 92 of file conicsec.cpp.
Referenced by Geom::xAx::categorise().
|
constexpr |
Definition at line 60 of file interval-test.cpp.
|
extern |
std::vector< std::vector< unsigned > > Geom::sweep_bounds | ( | std::vector< Rect > | a, |
std::vector< Rect > | b, | ||
Dim2 | d | ||
) |
Make a list of pairs of red-blue intersections between two lists of Rects.
[(A = rs[i], B = rs[j]) for i,J in enumerate(pairs) for j in J] then A.left <= B.left, A in a, B in b
Definition at line 74 of file sweep-bounds.cpp.
References end, intersects, max(), min(), and size.
Make a list of pairs of self intersections in a list of Rects.
rs | vector of Rect. |
d | dimension to sweep along |
[(A = rs[i], B = rs[j]) for i,J in enumerate(pairs) for j in J] then A.left <= B.left
Definition at line 35 of file sweep-bounds.cpp.
References intersects, max(), min(), and rs.
Referenced by Geom::MonoCrosser::crossings(), Geom::Crosser< T >::crossings(), crossings_among(), curve_sweep(), draw_bounds(), and self_crossings().
ConvexHull Geom::sweepline_intersection | ( | ConvexHull const & | a, |
ConvexHull const & | b | ||
) |
Definition at line 607 of file convex-hull.cpp.
References Geom::ConvexHull::size(), and Y.
Definition at line 61 of file d2-sbasis.cpp.
Referenced by build_from_sbasis().
|
related |
Geom::TEST | ( | AffineTest | , |
Classification | |||
) |
Definition at line 49 of file affine-test.cpp.
References are_near(), Geom::Affine::flips(), Geom::Affine::isHShear(), Geom::Affine::isIdentity(), Geom::Affine::isNonzeroHShear(), Geom::Affine::isNonzeroNonpureRotation(), Geom::Affine::isNonzeroRotation(), Geom::Affine::isNonzeroScale(), Geom::Affine::isNonzeroTranslation(), Geom::Affine::isNonzeroUniformScale(), Geom::Affine::isNonzeroVShear(), Geom::Affine::isRotation(), Geom::Affine::isScale(), Geom::Affine::isSingular(), Geom::Affine::isTranslation(), Geom::Affine::isUniformScale(), Geom::Affine::isVShear(), Geom::Affine::isZoom(), Geom::Affine::preservesAngles(), Geom::Affine::preservesArea(), Geom::Affine::preservesDistances(), Geom::Affine::rotationCenter(), and Geom::Affine::withoutTranslation().
Geom::TEST | ( | AffineTest | , |
CoordinateAccess | |||
) |
Definition at line 390 of file affine-test.cpp.
Geom::TEST | ( | AffineTest | , |
Equality | |||
) |
Definition at line 40 of file affine-test.cpp.
References Geom::Affine::identity(), and identity().
Geom::TEST | ( | AffineTest | , |
Inversion | |||
) |
Definition at line 380 of file affine-test.cpp.
References Geom::Affine::inverse().
Geom::TEST | ( | AffineTest | , |
Multiplication | |||
) |
Definition at line 410 of file affine-test.cpp.
Geom::TEST | ( | AffineTest | , |
Nearness | |||
) |
Definition at line 403 of file affine-test.cpp.
References are_near().
Geom::TEST | ( | CoordTest | , |
StringRoundtripNice | |||
) |
Definition at line 61 of file coord-test.cpp.
References format_coord_nice(), and parse_coord().
Geom::TEST | ( | CoordTest | , |
StringRoundtripShortest | |||
) |
Definition at line 43 of file coord-test.cpp.
References format_coord_shortest(), and parse_coord().
Geom::TEST | ( | IntervalTest | , |
EqualityTest | |||
) |
Definition at line 53 of file interval-test.cpp.
Geom::TEST | ( | IntervalTest | , |
Hash | |||
) |
Definition at line 90 of file interval-test.cpp.
References test().
Geom::TEST | ( | IntervalTest | , |
StructuredBindingTest | |||
) |
Definition at line 84 of file interval-test.cpp.
Geom::TEST | ( | MinBBoxTest | , |
Empty | |||
) |
Definition at line 47 of file min-bbox-test.cpp.
Geom::TEST | ( | MinBBoxTest | , |
Randomised | |||
) |
Definition at line 61 of file min-bbox-test.cpp.
References aligned_bbox(), approx_min(), and randpts().
Geom::TEST | ( | MinBBoxTest | , |
SinglePoint | |||
) |
Definition at line 54 of file min-bbox-test.cpp.
References Geom::GenericRect< Coord >::from_xywh().
Geom::TEST | ( | PointTest | , |
Hash | |||
) |
Definition at line 141 of file point-test.cpp.
References test().
Geom::TEST | ( | PointTest | , |
IntPointCtors | |||
) |
Definition at line 100 of file point-test.cpp.
Geom::TEST | ( | PointTest | , |
Multiplicative | |||
) |
Definition at line 79 of file point-test.cpp.
Geom::TEST | ( | PointTest | , |
Near | |||
) |
Definition at line 71 of file point-test.cpp.
References are_near(), and are_near_rel().
Geom::TEST | ( | PointTest | , |
Normalize | |||
) |
Definition at line 41 of file point-test.cpp.
References Geom::Point::normalize(), and Geom::Point::normalized().
Geom::TEST | ( | PointTest | , |
PointCtors | |||
) |
Definition at line 86 of file point-test.cpp.
Geom::TEST | ( | PointTest | , |
Rounding | |||
) |
Definition at line 63 of file point-test.cpp.
References Geom::Point::ceil(), Geom::Point::floor(), and Geom::Point::round().
Geom::TEST | ( | PointTest | , |
ScalarOps | |||
) |
Definition at line 51 of file point-test.cpp.
Geom::TEST | ( | RectTest | , |
Expanded | |||
) |
Definition at line 87 of file rect-test.cpp.
References expandedBy().
Geom::TEST | ( | RectTest | , |
ExpansionInPlace | |||
) |
Definition at line 76 of file rect-test.cpp.
References Geom::GenericRect< C >::expandBy().
Geom::TEST | ( | RectTest | , |
Rounding | |||
) |
Definition at line 61 of file rect-test.cpp.
References Geom::Rect::roundInwards(), and Geom::Rect::roundOutwards().
Geom::TEST | ( | RectTest | , |
ShrinkingInPlace | |||
) |
Definition at line 92 of file rect-test.cpp.
References Geom::GenericRect< C >::shrinkBy().
Geom::TEST | ( | RectTest | , |
Shrunk | |||
) |
Definition at line 103 of file rect-test.cpp.
Geom::TEST | ( | RectTest | , |
Upconversion | |||
) |
Definition at line 42 of file rect-test.cpp.
Geom::TEST | ( | Vector | , |
IsPositive | |||
) |
Definition at line 157 of file nl-vector-test.cpp.
References V3().
Geom::TEST | ( | Vector | , |
Max | |||
) |
Definition at line 174 of file nl-vector-test.cpp.
Geom::TEST | ( | Vector | , |
MaxIndex | |||
) |
Definition at line 178 of file nl-vector-test.cpp.
References V3().
Geom::TEST | ( | Vector | , |
Min | |||
) |
Definition at line 182 of file nl-vector-test.cpp.
Geom::TEST | ( | Vector | , |
MinIndex | |||
) |
Definition at line 186 of file nl-vector-test.cpp.
References V3().
Geom::TEST | ( | Vector | , |
SwappingVectors | |||
) |
Definition at line 200 of file nl-vector-test.cpp.
References Geom::NL::swap(), and V3().
Geom::TEST_F | ( | VectorTest | , |
AddAssignment | |||
) |
Definition at line 135 of file nl-vector-test.cpp.
References Geom::NL::detail::BaseVectorImpl::str().
Geom::TEST_F | ( | VectorTest | , |
AssignedVectorMustBeSameSize | |||
) |
Definition at line 109 of file nl-vector-test.cpp.
Geom::TEST_F | ( | VectorTest | , |
IsNonNegative | |||
) |
Definition at line 168 of file nl-vector-test.cpp.
References V3().
Geom::TEST_F | ( | VectorTest | , |
IsZero | |||
) |
Definition at line 163 of file nl-vector-test.cpp.
Geom::TEST_F | ( | VectorTest | , |
OperatorEqualIsDefined | |||
) |
Definition at line 86 of file nl-vector-test.cpp.
Geom::TEST_F | ( | VectorTest | , |
OperatorNotEqualIsntDefined | |||
) |
Definition at line 95 of file nl-vector-test.cpp.
Geom::TEST_F | ( | VectorTest | , |
Reverse | |||
) |
Definition at line 152 of file nl-vector-test.cpp.
Geom::TEST_F | ( | VectorTest | , |
ScaleAndTranslateUsesFluentSyntax | |||
) |
Definition at line 130 of file nl-vector-test.cpp.
References Geom::NL::VectorView::scale(), Geom::NL::detail::BaseVectorImpl::str(), and Geom::NL::VectorView::translate().
Geom::TEST_F | ( | VectorTest | , |
SetAll | |||
) |
Definition at line 190 of file nl-vector-test.cpp.
Geom::TEST_F | ( | VectorTest | , |
SetBasis | |||
) |
Definition at line 195 of file nl-vector-test.cpp.
Geom::TEST_F | ( | VectorTest | , |
SubtractAssignment | |||
) |
Definition at line 141 of file nl-vector-test.cpp.
References Geom::NL::detail::BaseVectorImpl::str().
Geom::TEST_F | ( | VectorTest | , |
SwappingElements | |||
) |
Definition at line 147 of file nl-vector-test.cpp.
Geom::TEST_F | ( | VectorTest | , |
VectorAssignment | |||
) |
Definition at line 102 of file nl-vector-test.cpp.
Geom::TEST_F | ( | VectorTest | , |
VectorConstructFromAnother | |||
) |
Definition at line 81 of file nl-vector-test.cpp.
References Geom::NL::detail::BaseVectorImpl::str().
Geom::TEST_F | ( | VectorTest | , |
VectorScalesInplace | |||
) |
Definition at line 120 of file nl-vector-test.cpp.
Geom::TEST_F | ( | VectorTest | , |
VectorStringRepresentation | |||
) |
Definition at line 77 of file nl-vector-test.cpp.
Geom::TEST_F | ( | VectorTest | , |
VectorTranslatesInplace | |||
) |
Definition at line 125 of file nl-vector-test.cpp.
Geom::TEST_F | ( | VectorViewTest | , |
AddAssignAvailableForViews | |||
) |
Definition at line 293 of file nl-vector-test.cpp.
Geom::TEST_F | ( | VectorViewTest | , |
AssignmentFromVectorAvailableForViews | |||
) |
Definition at line 262 of file nl-vector-test.cpp.
References Geom::NL::detail::BaseVectorImpl::str().
Geom::TEST_F | ( | VectorViewTest | , |
AssignmentFromVectorMustBeSameSize | |||
) |
Definition at line 269 of file nl-vector-test.cpp.
Geom::TEST_F | ( | VectorViewTest | , |
AssignmentFromViewAvailableForViews | |||
) |
Definition at line 275 of file nl-vector-test.cpp.
References Geom::NL::detail::BaseVectorImpl::str().
Geom::TEST_F | ( | VectorViewTest | , |
AssignmentFromViewMustBeSameSize | |||
) |
Definition at line 284 of file nl-vector-test.cpp.
References Geom::NL::detail::BaseVectorImpl::size().
Geom::TEST_F | ( | VectorViewTest | , |
ConstructFromAnotherView | |||
) |
Definition at line 230 of file nl-vector-test.cpp.
References Geom::NL::detail::BaseVectorImpl::str().
Geom::TEST_F | ( | VectorViewTest | , |
PartialSourceModification | |||
) |
Definition at line 239 of file nl-vector-test.cpp.
References Geom::NL::detail::BaseVectorImpl::str(), and Geom::NL::VectorView::translate().
Geom::TEST_F | ( | VectorViewTest | , |
SkipSomeInitialElements | |||
) |
Definition at line 219 of file nl-vector-test.cpp.
Geom::TEST_F | ( | VectorViewTest | , |
SparseViewConstruction | |||
) |
Definition at line 224 of file nl-vector-test.cpp.
Geom::TEST_F | ( | VectorViewTest | , |
SubtractAssignAvailableForViews | |||
) |
Definition at line 299 of file nl-vector-test.cpp.
Geom::TEST_F | ( | VectorViewTest | , |
SwappingDifferentLengthViewFails | |||
) |
Definition at line 325 of file nl-vector-test.cpp.
References Geom::NL::swap_view().
Geom::TEST_F | ( | VectorViewTest | , |
SwappingFromSameSourceVectorDoesNotModifySource | |||
) |
Definition at line 307 of file nl-vector-test.cpp.
References Geom::NL::swap_view().
Geom::TEST_F | ( | VectorViewTest | , |
SwappingFromSameSourceVectorModifiesViews | |||
) |
Definition at line 314 of file nl-vector-test.cpp.
References Geom::NL::detail::BaseVectorImpl::str(), and Geom::NL::swap_view().
Geom::TEST_F | ( | VectorViewTest | , |
ViewCountOnly | |||
) |
Definition at line 214 of file nl-vector-test.cpp.
Geom::TEST_F | ( | VectorViewTest | , |
ViewScaleAndTranslateUsesFluentSyntax | |||
) |
Definition at line 255 of file nl-vector-test.cpp.
References scale.
Geom::TEST_F | ( | VectorViewTest | , |
ViewScalesInplace | |||
) |
Definition at line 250 of file nl-vector-test.cpp.
Definition at line 210 of file linearN.h.
Referenced by plot3d(), and toSBasis().
Definition at line 640 of file sbasisN.h.
References toLinear().
Referenced by bounds_fast(), convole(), convole(), Inkscape::LivePathEffect::LPEKnotNS::CrossingPoints::CrossingPoints(), plot3d(), plot3d(), plot3d(), and TEST_F().
|
static |
Definition at line 69 of file geom-pathstroke.cpp.
References area(), cross(), Geom::Point::cw(), distance(), and start.
|
static |
Find circle that touches inside of the curve, with radius matching the curvature, at time value t
.
Because this method internally uses unitTangentAt, t should be smaller than 1.0 (see unitTangentAt).
Definition at line 38 of file geom-pathstroke.cpp.
References are_near(), cross(), Geom::Point::cw(), derivative(), divide(), dot(), unitTangentAt(), and unitVector().
Referenced by Inkscape::LivePathEffect::path_from_piecewise_fix_cusps().
|
static |
Find circle that touches inside of the curve, with radius matching the curvature, at time value t
.
Because this method internally uses unitTangentAt, t should be smaller than 1.0 (see unitTangentAt).
Definition at line 93 of file lpe-powerstroke.cpp.
References are_near(), cross(), Geom::Point::cw(), derivative(), divide(), dot(), Geom::Piecewise< T >::empty(), Geom::D2< T >::isZero(), size, unitTangentAt(), and unitVector().
|
inline |
Definition at line 117 of file intersection.h.
References result.
|
inline |
Definition at line 126 of file intersection.h.
Referenced by Geom::BezierCurveN< degree >::intersect(), Geom::BezierCurve::intersect(), and Geom::EllipticalArc::intersect().
Definition at line 52 of file d2-sbasis.cpp.
References truncate(), X, and Y.
Referenced by main(), and truncate().
Definition at line 361 of file sbasis.h.
References c, and Geom::SBasis::insert().
|
inline |
Definition at line 857 of file sbasisN.h.
References c, and Geom::SBasisN< n >::sizes.
|
inline |
Definition at line 456 of file sbasis-of.h.
References c.
Definition at line 274 of file sbasis-math.cpp.
References order, and Geom::Piecewise< T >::segs.
Referenced by reciprocal(), and reciprocal().
Geom::TYPED_TEST | ( | GenericRectTest | , |
Area | |||
) |
Definition at line 268 of file rect-test.cpp.
References c.
Geom::TYPED_TEST | ( | GenericRectTest | , |
Contains | |||
) |
Definition at line 211 of file rect-test.cpp.
References c.
Geom::TYPED_TEST | ( | GenericRectTest | , |
Dimensions | |||
) |
Definition at line 290 of file rect-test.cpp.
Geom::TYPED_TEST | ( | GenericRectTest | , |
Emptiness | |||
) |
Definition at line 280 of file rect-test.cpp.
Geom::TYPED_TEST | ( | GenericRectTest | , |
EqualityTest | |||
) |
Definition at line 131 of file rect-test.cpp.
Geom::TYPED_TEST | ( | GenericRectTest | , |
Intersection | |||
) |
Definition at line 186 of file rect-test.cpp.
References c, and intersect().
Geom::TYPED_TEST | ( | GenericRectTest | , |
Intersects | |||
) |
Definition at line 151 of file rect-test.cpp.
References c.
Geom::TYPED_TEST | ( | GenericRectTest | , |
JonCruzRect | |||
) |
JonCruz failure: (10, 20)-(55,30) and (45,20)-(100,30) should intersect.
Definition at line 175 of file rect-test.cpp.
Geom::TYPED_TEST | ( | GenericRectTest | , |
Modification | |||
) |
Definition at line 319 of file rect-test.cpp.
Geom::TYPED_TEST | ( | GenericRectTest | , |
NearestEdgePoint | |||
) |
Definition at line 378 of file rect-test.cpp.
Geom::TYPED_TEST | ( | GenericRectTest | , |
Offset | |||
) |
Definition at line 356 of file rect-test.cpp.
Geom::TYPED_TEST | ( | GenericRectTest | , |
OptRectDereference | |||
) |
Definition at line 348 of file rect-test.cpp.
Geom::TYPED_TEST | ( | GenericRectTest | , |
Union | |||
) |
Definition at line 237 of file rect-test.cpp.
References c.
Geom::TYPED_TEST_CASE | ( | GenericRectTest | , |
CoordTypes | |||
) |
Definition at line 217 of file interval.h.
Definition at line 55 of file int-rect.h.
|
inline |
Definition at line 58 of file int-rect.h.
Union a list of rectangles.
Definition at line 265 of file rect.h.
References Geom::GenericRect< C >::unionWith().
Referenced by Geom::MonoCrosser::crossings(), and wrap_rect().
Referenced by Inkscape::UI::Tools::PencilTool::_fitAndSplit(), Inkscape::UI::Tools::PencilTool::_interpolate(), Inkscape::UI::Tools::PencilTool::_sketchInterpolate(), Inkscape::ObjectSnapper::_snapPathsConstrained(), Inkscape::UI::Node::_updateAutoHandles(), Inkscape::UI::PathManipulator::_updateOutline(), Geom::RatQuad::circularArc(), darray_left_tangent(), Geom::BezierFitter::darray_left_tangent(), darray_left_tangent(), Geom::BezierFitter::darray_left_tangent(), darray_right_tangent(), Geom::BezierFitter::darray_right_tangent(), darray_right_tangent(), Geom::BezierFitter::darray_right_tangent(), Inkscape::UI::direction(), Inkscape::LivePathEffect::LPECopyRotate::doBeforeEffect(), Inkscape::LivePathEffect::LPEAngleBisector::doEffect_path(), Inkscape::LivePathEffect::LPECopyRotate::doEffect_path(), Inkscape::LivePathEffect::LPECurveStitch::doEffect_path(), Inkscape::LivePathEffect::LPEParallel::doEffect_pwd2(), Inkscape::LivePathEffect::LPEPerpBisector::doEffect_pwd2(), Inkscape::LivePathEffect::LPERoughHatches::doEffect_pwd2(), Inkscape::LivePathEffect::LPERuler::doEffect_pwd2(), Inkscape::LivePathEffect::LPETangentToCurve::doEffect_pwd2(), Inkscape::LivePathEffect::LPETextLabel::doEffect_pwd2(), Inkscape::LivePathEffect::LPECopyRotate::doOnApply(), Inkscape::LivePathEffect::LPEParallel::doOnApply(), Inkscape::UI::Handle::dragged(), draw_ray(), Geom::Eigen::Eigen(), Geom::Eigen::Eigen(), Inkscape::Extension::Internal::PrintEmf::fill(), Inkscape::Extension::Internal::PrintWmf::fill(), Inkscape::LivePathEffect::findShadowedTime(), generate_bezier(), Geom::BezierFitter::generate_bezier(), Inkscape::LivePathEffect::LPEPts2Ellipse::genIsometricEllipse(), Inkscape::UI::Handle::grabbed(), line_best_fit(), Inkscape::Display::SnapIndicator::make_alignment_indicator(), plot_offset(), Box3D::Line::point_from_lambda(), reflection(), Inkscape::UI::PathManipulator::scaleHandle(), Inkscape::UI::Handle::setDirection(), Inkscape::UI::Handle::setLength(), Inkscape::LivePathEffect::TextParam::setPosAndAnchor(), Inkscape::UI::Node::setType(), Inkscape::UI::Tools::MeasureTool::showCanvasItems(), tighten(), toPoly(), Geom::Piecewise< T >::unitVector(), Inkscape::Extension::Internal::PrintEmf::vector_rect_alignment(), and wrap_point().
Definition at line 222 of file d2-sbasis.cpp.
References are_near(), length(), and Geom::D2< T >::valueAndDerivatives().
Referenced by Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), and touching_circle().
|
related |
NL::Vector Geom::V3 | ( | double | a, |
double | b, | ||
double | c | ||
) |
|
inline |
Returns the degree of the first non zero coefficient.
a | sbasis function |
tol | largest abs val considered 0 |
Definition at line 1038 of file sbasisN.h.
Referenced by compose_inverse().
unsigned Geom::wangs_theorem | ( | OldBezier | ) |
Definition at line 320 of file recursive-bezier-intersection.cpp.
Referenced by find_intersections_bezier_recursive().
Compute winding number of the path at the specified point.
Definition at line 16 of file path-intersection.cpp.
References Geom::Path::winding().
Referenced by contains(), TEST_F(), and winding().
double Geom::wrap_dist | ( | double | from, |
double | to, | ||
double | size, | ||
bool | rev | ||
) |
Definition at line 15 of file crossing.cpp.
References size.
std::string Geom::write_svg_path | ( | PathVector const & | pv, |
int | prec = -1 , |
||
bool | optimize = false , |
||
bool | shorthands = true |
||
) |
Definition at line 274 of file svg-path-writer.cpp.
References Geom::PathSink::feed(), optimize, Geom::SVGPathWriter::setOptimize(), Geom::SVGPathWriter::setPrecision(), Geom::SVGPathWriter::setUseShorthands(), and Geom::SVGPathWriter::str().
double Geom::xAx_descr | ( | xAx const & | C | ) |
Definition at line 352 of file conicsec.cpp.
References Geom::xAx::c, and det3().
Referenced by intersect().
|
static |
Definition at line 48 of file svg-path-parser.cpp.
Referenced by Geom::SVGPathParser::_parse().
|
static |
Definition at line 1043 of file svg-path-parser.cpp.
Referenced by Geom::SVGPathParser::_parse().
|
static |
Definition at line 513 of file svg-path-parser.cpp.
Referenced by Geom::SVGPathParser::_parse().
|
static |
Definition at line 550 of file svg-path-parser.cpp.
Referenced by Geom::SVGPathParser::_parse().
|
static |
Definition at line 63 of file svg-path-parser.cpp.
Referenced by Geom::SVGPathParser::_parse().
|
static |
Definition at line 476 of file svg-path-parser.cpp.
Referenced by Geom::SVGPathParser::_parse().
|
static |
Definition at line 439 of file svg-path-parser.cpp.
Referenced by Geom::SVGPathParser::_parse().
|
static |
Definition at line 950 of file svg-path-parser.cpp.
Referenced by Geom::SVGPathParser::_parse().
|
static |
Definition at line 100 of file svg-path-parser.cpp.
Referenced by Geom::SVGPathParser::_parse().
|
static |
Definition at line 857 of file svg-path-parser.cpp.
Referenced by Geom::SVGPathParser::_parse().
const double Geom::BEPSILON = ldexp(1.0,-MAXDEPTH-1) |
Definition at line 27 of file solve-bezier-parametric.cpp.
Referenced by control_poly_flat_enough().
xAx Geom::degen |
Definition at line 70 of file conic-6.cpp.
Referenced by Geom::Ellipse::intersect(), TEST(), and TEST_F().
const unsigned Geom::MAXDEPTH = 64 |
Definition at line 25 of file solve-bezier-parametric.cpp.
Referenced by find_parametric_bezier_roots().
|
static |
Definition at line 1083 of file svg-path-parser.cpp.
|
static |
Definition at line 1081 of file svg-path-parser.cpp.
Referenced by Geom::SVGPathParser::_parse().
|
static |
Definition at line 1080 of file svg-path-parser.cpp.
Referenced by Geom::SVGPathParser::reset().
unsigned Geom::total_steps |
Definition at line 29 of file solve-bezier-parametric.cpp.
Referenced by find_parametric_bezier_roots().
unsigned Geom::total_subs |
Definition at line 29 of file solve-bezier-parametric.cpp.
Referenced by find_parametric_bezier_roots().
|
static |
Referenced by bezier_fit_cubic_full(), and bezier_fit_cubic_r().