Skip to content

Intersection

Defined in: src/Intersection.ts:8

new Intersection(status?): Intersection

Defined in: src/Intersection.ts:13

IntersectionType

Intersection

points: Point[]

Defined in: src/Intersection.ts:9


optional status: IntersectionType

Defined in: src/Intersection.ts:11

static intersectLineLine(a1, a2, b1, b2, aInfinite?, bInfinite?): Intersection

Defined in: src/Intersection.ts:127

Checks if a line intersects another

Point

Point

Point

Point

boolean = true

check segment intersection by passing false

boolean = true

check segment intersection by passing false

Intersection


static intersectLinePolygon(a1, a2, points, infinite?): Intersection

Defined in: src/Intersection.ts:224

Checks if line intersects polygon

Point

point on line

Point

other point on line

Point[]

polygon points

boolean = true

check segment intersection by passing false

Intersection

account for stroke

intersectSegmentPolygon for segment intersection


static intersectPolygonPolygon(points1, points2): Intersection

Defined in: src/Intersection.ts:277

Checks if polygon intersects another polygon

Point[]

Point[]

Intersection

account for stroke


static intersectPolygonRectangle(points, r1, r2): Intersection

Defined in: src/Intersection.ts:315

Checks if polygon intersects rectangle

Point[]

polygon points

Point

top left point of rect

Point

bottom right point of rect

Intersection

intersectPolygonPolygon for polygon intersection


static intersectSegmentLine(s1, s2, l1, l2): Intersection

Defined in: src/Intersection.ts:183

Checks if a segment intersects a line

Point

boundary point of segment

Point

other boundary point of segment

Point

point on line

Point

other point on line

Intersection

intersectLineLine for line intersection


static intersectSegmentPolygon(a1, a2, points): Intersection

Defined in: src/Intersection.ts:259

Checks if segment intersects polygon

Point

boundary point of segment

Point

other boundary point of segment

Point[]

polygon points

Intersection

intersectLinePolygon for line intersection


static intersectSegmentSegment(a1, a2, b1, b2): Intersection

Defined in: src/Intersection.ts:202

Checks if a segment intersects another

Point

boundary point of segment

Point

other boundary point of segment

Point

boundary point of segment

Point

other boundary point of segment

Intersection

intersectLineLine for line intersection


static isPointContained(T, A, B, infinite?): boolean

Defined in: src/Intersection.ts:51

check if point T is on the segment or line defined between A and B

Point

the point we are checking for

Point

one extremity of the segment

Point

the other extremity of the segment

boolean = false

if true checks if T is on the line defined by A and B

boolean

true if T is contained


static isPointInPolygon(point, points): boolean

Defined in: src/Intersection.ts:91

Use the ray casting algorithm to determine if Point is in the polygon defined by [points]Point

Point

Point[]

polygon points

boolean

https://en.wikipedia.org/wiki/Point_in_polygon