Class: IntersectionRegistry

algeobra~IntersectionRegistry()

Currently implemented default intersections Brackets indicate additional information. For Bezier, this will list the maximum degree for which the intersection is defined. Line: Line, Vector, Arc, Line strip, Polygon, Bezier (max deg 4), Bezier spline(mag deg 4), Ellipse Vector: Line, Vector, Arc, Line strip, Polygon, Bezier (max deg 4), Bezier spline(mag deg 4), Ellipse Arc: Line, Vector, Arc, Line strip, Polygon, Bezier (max deg 2), Bezier spline(mag deg 2), Ellipse Line strip: Line, Vector, Arc, Line strip, Polygon, Bezier (max deg 4), Bezier spline(mag deg 4), Ellipse Polygon: Line, Vector, Arc, Line strip, Polygon, Bezier (max deg 4), Bezier spline(mag deg 4), Ellipse Bezier: Line (max deg 4), Vector (max deg 4), Arc (max deg 2), Line strip (max deg 4), Polygon(max deg 4), Bezier (deg A * deg B < 5), Bezier spline(deg A * deg B < 5), Ellipse (max deg 2) Bezier spline: Line (max deg 4), Vector (max deg 4), Arc (max deg 2), Line strip (max deg 4), Polygon(max deg 4), Bezier (deg A * deg B < 5) , Bezier spline(deg A * deg B < 5), Ellipse (max deg 2) Ellipse: Line, Vector, Arc, Line strip, Polygon, Bezier (max deg 2), Bezier spline(mag deg 2), Ellipse

Constructor

new IntersectionRegistry()

Source:

Methods

(static) getIntersector(typeA, typeB) → {undefined|function}

Get the intersector for the given types
Parameters:
Name Type Description
typeA String The type of the first object
typeB String The type of the second object
Source:
Returns:
The intersector, if it exists
Type
undefined | function

(static) intersect(a, b) → {Array.<{x:Number, y:Number}>|null}

Computes the intersection of two typed objects
Parameters:
Name Type Description
a Object The first object with a type
b Object The second object with a type
Source:
Returns:
The intersections, if they exist. May also return null, if none exist
Type
Array.<{x:Number, y:Number}> | null

(static) setIntersector(typeA, typeB, intersector, addReverse)

Parameters:
Name Type Default Description
typeA String The type of the first object
typeB String The type of the second object
intersector function The intersection function taking objects of the specified types and returning intersections. May also return null, if none exist
addReverse Boolean true If true, an additional function with swapped arguments (if they are different) is added automatically
Source: